-
Notifications
You must be signed in to change notification settings - Fork 62
GPII-413: Add a dynamic Device Reporter #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Each element of the array uses a different name for the same software because the name is different for different distributions.
Changed contents of gpii.packageKit context to be an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use === for comparison here - we should ensure that these files are lintable using jshint and, for example, the infusion .jshintrc - also there is a missing semicolon on this line
In response to first comment on pull request GPII#246, added .jshintrc file to "universal" root directory, ran jshint on device reporter JavaScript files, and fixed the errors.
Fixing jshint errors
…lution. Focus on the solutions test data for linux (linux.json).
Changes: - GNOME Interface Settings (org.gnome.desktop.interface) -- changed to gsettings-desktop-schemas (was gnome-themes-standard). - GNOME Assistive Technology - Screen Keyboard (org.gnome.desktop.a11y.applications.onscreen-keyboard) -- changed to gsettings-desktop-schemas (was caribou). - GNOME Shell Keyboard Settings (org.gnome.desktop.a11y.keyboard) -- changed to gsettings-desktop-schemas (was control-center).
Added "gnome-shell" as the app to look for with respect to GNOME Shell overrides (org.gnome.shell.overrides). Similarly, changed GNOME Assistive Technology - Screen Keyboard (org.gnome.desktop.a11y.applications.onscreen-keyboard) to "gnome-shell" (was "gsettings-desktop-schemas").
Including deviceReporter data into linux' solutions registry
… entire deviceReporter section from the solutions registry entry rather than just the name, and map the function arguments accordingly.
|
I've added a pull request to Javi's branch at javihernandez#6 |
GPII-413: Adding graded function invocation so that we can pass in the entire deviceReporter section from the solutions registry entry rather than just the name, and map the function arguments accordingly.
|
@javihernandez @amb26 Just pinging to see if there is any more discussion on this ticket, and how much more engineering is required for it. Is it just in holding until the unit tests for the linux side of the pull request are updated based on that pull request? |
|
Just checking in again to see if there is anymore work to be done on this specific pull request, or if it's just waiting for finishing touches on the linux side. |
|
@sgithens, still working on the linux side of the pull request after the latests comments from Antranig. I'll ping Antranig once that pull request is ready for another review. |
|
@javihernandez Thanks for the info Javi! |
Merge remote-tracking branch 'upstream/master' into device-reporter-draft-2
|
Hi - I saw these comments in an email notification but I don't seem to see them in the pull here: @amb26, splitted into 'static' and 'live' here, but I still need to address the "Other notes". ii) how can I use the flowManager's solutionsRegistryDataSource? By having replaced the current {solutionsRegistryDataSource} with {flowManager}.solutionsRegistryDataSource in my argument list didn't do the trick? ii) how "didn't do the trick"? It should work fine as far as I can see. What result do you get? |
|
ii) I'm getting an empty response from the solutions registry, so when calling to localhost:8081/device I'm getting iii) I did this in javihernandez@f842a40, is this correct? |
|
ii) That seems very odd - could you check in a branch that shows this behaviour and tell me how to trigger it? We should make sure that this is working iii) looks good, yes |
|
@javihernandez I'm not sure if this addresses the issue, but there is a problem in DeviceGet.js. There is a "func" property in the invoker section, but it should be "funcName". See: |
|
@klown - "func" is correct here, although with the current framework there is no difference. Perhaps you could put a log statement in line 314 of Kettle's dataSource.js to read the following, and see if it helps to see what is happening: |
|
@javihernandez, @amb26, I recently pushed a version of the ProcessReporter[1] that uses grades instead of the fat API, and it works in both development and production configurations. I decided to come back to the device reporter and see if I could detect a difference to explain your problem @javihernandez . But, when I run this "draft2" branch of the deviceReporter in development and production configurations, I get what is expected: [1] #355, specifically klown@8381ec7 |
|
@javihernandez, @amb26, never mind me. I just read the comment about duplicating "the entire solutionsRegistryDataSource", and realized that's what the issue is. I'll look into it since the ProcessReporter is likewise duplicating. |
|
@javihernandez , @amb26, When I test Javi's "tempBranch", I get the same result as he does. It depends on running with the development configuration, i.e. using all.development.dr.production.json Adding a "console.log()" as @amb26 suggested gives the following. The problem is the url to the test data ends in "null.json" instead of "linux.json". Trying to figure out why: |
|
I wrote:
The first argument to solutionsRegistryDataSource() at line 100 is 'null'. But it needs to communicate the OS somehow. I don't know how to do that. To test the hypothesis, I tried: And that worked. But, there's got to be a better way. |
|
that's correct, I was missing that. Thanks a lot!! |
Also: * added more definitions to be tested in linux-dynamicDeviceReporter-testSpec.js * added linux-dynamicDeviceReporter-testSpec.js to be run within the Integration tests
|
up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a 2nd onCreate fires, one should imagine that it is part of a further test case which may well require different expectInstalled contents. So we should just remove this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I'm checking whether we need to mock or not. Isn't it the right place/way for doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nameResolver should give a completely fresh name for the deviceReporter under the mock configuration - for example, the way our settingsHandlers do. There should never be a question of overwriting the global name of the real deviceReporter, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I've updated this, but I'm not feeling specially proud of it. Can you take a look at it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is ok but messy - it will be clearer for readers (and for YOU, VANTTUNEZZ!) if you just use the same scheme that we have for settings handlers - that is, just inject the nameResolver as a component of gpii.deviceReporter.base and expect for all users to invoke it from there (rather than make a fresh invoker) - that is. deviceReporter.nameResolver.resolveName
|
@klown 🍻 🍻 🍻 🍻 |
|
👏 woot @klown @javihernandez! |
|
c’est magnifique, @javihernandez. 🎶 (in honour of tuxguitar). |
Related literature about this can be found here, and can be tested with this pull request to GPII/linux.
The implementation follows a similar approach to how the settingsHandlers work.
Here you can see how a solution entry should be written in order to call to a deviceReporter plugin.
{ "name": "ORCA Screen Reader", "id": "org.gnome.orca", "contexts": { "OS": [{ "id": "linux", "version": ">=2.6.26" }], "isInstalled": [ { "type": "gpii.packageKit.find", "name": "orca" } ] }For this first example I have used the packageKit module for GNU/Linux but we could create a few common deviceReporter plugins such as:
Inspired by this, and as a replacement for the Linux' packageKit module in Windows, a node module can be built in order to poke the Windows registry for installed solutions.
Any testing/feedback will be awesome :)
Cheers!