-
Notifications
You must be signed in to change notification settings - Fork 62
GPII-1885: Implemented isConfigurable and makeConfigurable functions #462
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,13 +14,13 @@ Each entry in the solution registry should have a unique ID (`Solution.id` in th | |
| "start": [ .. ], | ||
| "stop": [ .. ], | ||
| "isInstalled": [ .. ], | ||
|
|
||
| "isConfigurable": [ ... ], | ||
| "makeConfigurable": [ ... ] | ||
|
|
||
| // Not yet supported. Post-Cloud4All features. | ||
| "install": [ ... ], | ||
| "uninstall": [ ... ], | ||
| "makeConfigurable": [ ... ], | ||
| "isRunning": [ ... ], | ||
| "isConfigurable": [ ... ] | ||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -143,6 +143,37 @@ This directive is used to detect whether a solution is installed. If any of thes | |
| ] | ||
| ``` | ||
|
|
||
| ####isConfigurable | ||
| This is run before configuration to ensure that the application is actually ready to be configured. This is relevant for applications where e.g. a configuration file needs to be present, a wizard needs to be run on the first launch, etc. Each of the blocks will be evaluated, if *any* of them evaluates to true, the solution is considered configurable. The absense of an `isConfigurable` block is also interpreted as the solution being configurable. | ||
|
|
||
| If a solution is not configurable, the `makeConfigurable` block will be executed (see below). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When will it be executed? |
||
|
|
||
| **Example Entry**: | ||
| ``` | ||
| "isConfigurable": [ | ||
| { | ||
| "type": "gpii.lifecycleActions.pathExists", | ||
| "path": "/tmp/fakemag1.settings.json" | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ####makeConfigurable | ||
| Is the actions that need to be taken to make the application configurable (such as running a wizard, creating a default configuration file, adding a new system user, etc). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit nuts not to allow the use of a settingsHandler here - especially if the action involves creating a JSON file etc. |
||
|
|
||
| **Example Entry**: | ||
| ``` | ||
| "makeConfigurable": [ | ||
| { | ||
| "type": "gpii.lifecycleActions.createFile", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both of these examples now refer to nonexistent functions. I think it would be better to reinstate them, with some tests, so that we create a facility which is actually usable. Don't we have an actual use case for this feature - if not, why are we implementing it? Unfortunately GPII-1885 is a TLJ so the reason why it is on our roadmap is unclear. Could you please
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the feedback @amb26. I've updated GPII-1885 with more details now, and created (and linked) GPII-2057 for the settingshandler work. Would you suggest that I just fix 2057 while I'm at it - together with and implementation of gpii.lifecycleActions.pathExists, these might make for some good examples and useful functionality
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it sounds good - we may as well verify that this functionality is actually good for something, since it is no longer good for the original use case. Is it possible that the ORCA settings handler might be the only genuine use for this function in our current solutions? If we can demonstrate that we can simplify the logic there and have it simply consist of the JSON settings handler, then we have a reasonable win. If we can't actually find a single genuine use of this system, I wonder whether we shouldn't mothball it. I know it's an awful thing to suggest given you have put so much work into this pull, but I think it is desirable to keep the principle that any code we have in the codebase meets at least one real use case.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no - I completely agree, that if there is no proper use case it should be mothballed, else it'll just pollute the code base, risk going stale, etc.. I talked with @javihernandez yesterday, and it does indeed seem that ORCA (and, I believe NVDA) needs extra actions the first time they're used. Though the use case there is that they need to be started and then stopped (which will trigger their initial setup routine), before the settings are set. Anyway, I'll let him confirm/unconfirm this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I can confirm that behavior with both Orca and NVDA. Isn't it a good use case? |
||
| "options": { | ||
| "filename": "/tmp/fakemag1.settings.json", | ||
| "content": "{}" | ||
| } | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| ***** | ||
|
|
||
| ### UNIMPLEMENTED BLOCKS | ||
|
|
@@ -161,26 +192,7 @@ To detect whether a solution is running - this is planned to be integrated in th | |
| ] | ||
| ``` | ||
|
|
||
| ####isConfigurable | ||
| This is run before configuration to ensure that the application is actually ready to be configured. This is relevant for applications where e.g. a configuration file needs to be present, a tutorial needs to be run on the first launch, etc. | ||
|
|
||
| **Example Entry**: | ||
| ``` | ||
| "isConfigurable": [{ | ||
| "type": "gpii.reporter.fileExists", | ||
| "path": "${{environment}.XDG_DATA_HOME}/orca/user-settings.conf"" | ||
| }] | ||
| ``` | ||
|
|
||
| ####makeConfigurable | ||
| Is the actions that need to be taken to make the application configurable (such as running a wizard, creating a default configuration file, adding a new system user, etc). | ||
|
|
||
| **Example Entry**: | ||
| ``` | ||
| "makeConfigurable": [{ | ||
| "launch" // A special key meaning "start it, wait until isConfigurable is met, and then stop it" | ||
| }] | ||
| ``` | ||
|
|
||
| ####install: | ||
| Used for describing the steps required for installing the application | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
typo absence