Repository navigation
Add output configuration for JSON output mode - #733
Open
xdelaruelle wants to merge 4 commits into
Open
xdelaruelle wants to merge 4 commits into
xdelaruelle wants to merge 4 commits into
Conversation
Extend the output configuration design to the --json mode of avail, list and spider sub-commands, as a preparatory step to let users select what is reported in JSON documents. Introduce avail_json_output, list_json_output and spider_json_output configuration options, which can be superseded through environment variable or the -o/--output option. Their default value reproduces the JSON document currently produced, so existing consumers are not affected unless configuration is changed. Define a new mtime element, specific to JSON mode, to report the modification time of modulefiles. It is not enabled by default as it requires to stat every modulefile when no module cache file is available. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Introduce avail_json_output, list_json_output and spider_json_output configuration options to define the content of the JSON output of avail, list and spider sub-commands. Elements in these options select the keys reported in each module JSON object. The -o/--output command line switch is now accepted on --json mode to supersede them, with support of the + and - prefixes. Default value of these options can be set at installation time with the --with-avail-json-output, --with-list-json-output and --with-spider-json-output configure options. Default values reproduce the JSON document produced so far, so existing JSON consumers are not affected unless configuration is changed. When an element is not enabled, its key is omitted from JSON objects. When modulepath element is removed, the top-level JSON object is directly keyed by module names. Variants are now reported on avail and spider JSON output when variant or variantifspec element is enabled: the possible values of each variant are set as a JSON array of strings. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Add the mtime element, specific to JSON output mode, to the avail_json_output, list_json_output and spider_json_output configuration options. When enabled, an mtime key is set on each modulefile JSON object with the modification time of the modulefile as an ISO 8601 string (null if it cannot be fetched). This element is not enabled by default as it requires to stat every modulefile when no module cache file is available. Fixes envmodules#615 Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Add a v5.8 section to the migration guide to introduce the JSON output configuration options, the --output support on --json mode, the mtime element and the variant report on avail and spider JSON output. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This branch has not been deployed
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
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.
Introduce
avail_json_output,list_json_outputandspider_json_outputconfiguration options to define the content of the JSON output ofavail,listandspidersub-commands. Elements in these options select the keys reported in each module JSON object. The-o/--outputcommand line switch is now accepted on--jsonmode to supersede them, with support of the+and-prefixes. Default value of these options can be set at installation time with the--with-avail-json-output,--with-list-json-outputand--with-spider-json-outputconfigure options.Default values reproduce the JSON document produced so far, so existing JSON consumers are not affected unless configuration is changed. When an element is not enabled, its key is omitted from JSON objects. When
modulepathelement is removed, the top-level JSON object is directly keyed by module names.A new
mtimeelement, specific to JSON mode, reports the modification time of modulefiles as an ISO 8601 string (nullif it cannot be fetched). It is not enabled by default as it requires to stat every modulefile when no module cache file is available.Variants are now reported on
availandspiderJSON output whenvariantorvariantifspecelement is enabled: the possible values of each variant are set as a JSON array of strings.The first commit extends the output configuration design notes to describe these choices, the second one introduces the JSON output configuration and the last one adds the
mtimeelement.Fixes #615