-
Notifications
You must be signed in to change notification settings - Fork 23
Update handling and validation of JSON input/output user settings #196
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Always update the cache value if option or env var is set for json_output; this brings effect of the user setting more on par with effect of json_input setting. This also includes an immediate effect of the option setting on the return value of qgis_using_json_output(), just like it already was the case in qgis_using_json_input(). - If json_output is set by the user, don't follow it if it's set as FALSE AND the user has explicitly set json_input as TRUE. The latter always triggers json_output as TRUE in backend qgis_process.
During package configuration, reconfigure the use_json_output cache value if the corresponding option/envvar is set by the user and resolves to the opposite of the cache value. The 'resolving' part of the user setting includes the check for a conflicting explicit setting for json_input vs json_output, just as resolving is done in qgis_using_json_output().
Never allow a pre-existing cache value 'FALSE' to survive if JSON INput is EXPLICITLY and ACCEPTABLY set as TRUE
…t setting * If the json_output user setting (ie option or env var) is empty, but the json_input user setting is not empty AND set as TRUE in an acceptable way (i.e. minimum QGIS version requirement satified), then the use_json_output cache value must be TRUE. If not, the cache must be reconfigured and the cache file rewritten.
qgis_query_plugins() calls qgis_using_json_output(). If json_input user setting is present, this now makes that qgis_version() is called. But the latter needs qgisprocess_cache$version, so we need to temporarily set this cache element too to prepare for qgis_query_plugins().
…e of user settings * This was already the case on Windows and macOS, and this commit extends this approach to all systems. AFAIK it was never clear in the first place why at some point it didn't work on GHA Ubuntu runner (the reason for testing '--json' in case of non-win & non-mac), and I've never witnessed such behaviour in Linux or GHA. This commit causes a speed gain up to several seconds for the query=TRUE case. Note that the test mimicking a situation where --json would not work, was only relevant in the previous state and only on Linux, so dropping these expectations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempt to fix #195.
Changes should not affect typical use of the package, but only make the experience more intuitive when one wants to fiddle with JSON input/output.