-
Notifications
You must be signed in to change notification settings - Fork 54
Change handling of multiple matches in atmchange/atmquery #3014
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
Use ANY:: in the node name string to allow multiple matches
* Added example in help to show how to change all matches * Deprecated --all. If used, it will print an error and exit
|
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
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.
Nice improvement!
Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED Note: Testing will normally be attempted again in approx. 2 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run. Pull Request Auto Testing has FAILED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
SCREAM_PullRequest_Autotester_Weaver # 6074 FAILED (click to see last 100 lines of console output)
SCREAM_PullRequest_Autotester_Mappy # 5845 FAILED (click to see last 100 lines of console output)
|
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED Note: Testing will normally be attempted again in approx. 2 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run. Pull Request Auto Testing has FAILED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
SCREAM_PullRequest_Autotester_Weaver # 6075 FAILED (click to see last 100 lines of console output)
SCREAM_PullRequest_Autotester_Mappy # 5846 FAILED (click to see last 100 lines of console output)
|
7182d34
to
0260e85
Compare
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED Note: Testing will normally be attempted again in approx. 2 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run. Pull Request Auto Testing has FAILED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
SCREAM_PullRequest_Autotester_Weaver # 6077 FAILED (click to see last 100 lines of console output)
SCREAM_PullRequest_Autotester_Mappy # 5848 FAILED (click to see last 100 lines of console output)
|
Besides not adding much, when used in cime-nml-tests, as part of finding matches to atmchange, it messes up future searches
Before we had two styles, 'short', and 'full'. The former only printed the leaf name, the latter printed the full scope. I changed those to 'node-name' and 'full-scope', and added a new style called 'parent-scope', which only adds one parent to the scope of the name. These types are used by default for: - node-name: when printing recursively - full-scope: when using --grep (unless the grep matches a non-leaf node, in which case the nested values are printed with node-name format) - parent-scope: the default when printing a parameter
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED Note: Testing will normally be attempted again in approx. 2 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run. Pull Request Auto Testing has FAILED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
SCREAM_PullRequest_Autotester_Weaver # 6081 PASSED (click to see last 100 lines of console output)
SCREAM_PullRequest_Autotester_Mappy # 5852 FAILED (click to see last 100 lines of console output)
|
Ok, I think I reached a final version for this PR. @jgfouca I added quite a few things, including:
There are still some small inconsistencies, but I'm not going to fix them. E.g., $ ./atmquery mac_aero_mic::ANY
mac_aero_mic::atm_procs_list: shoc,cldFraction,spa,p3
mac_aero_mic::number_of_subcycles: 12
mac_aero_mic::Type: Group
mac_aero_mic::schedule_type: Sequential
mac_aero_mic::enable_precondition_checks: true
mac_aero_mic::enable_postcondition_checks: true
mac_aero_mic::repair_log_level: trace
mac_aero_mic::internal_diagnostics_level: 0
mac_aero_mic::compute_tendencies: None
shoc:
enable_column_conservation_checks: false
check_flux_state_consistency: false
lambda_low: 0.001
lambda_high: 0.04
lambda_slope: 2.65
lambda_thresh: 0.02 Here, |
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED Pull Request Auto Testing has PASSED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
|
Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
All Jobs Finished; status = PASSED, target_sha=1b7eb5b67cebf4f19068490e339634741145ab6f, However Inspection must be performed before merge can occur... |
The old syntax was
atmchange --all my_param=1
to allow changing all matches ofmy_param
. This had two disadvantages:This PR changes the syntax. Instead of passing a flag, we add
ANY
in the scoped name. For instance, given this xml:we have:
atmchange ANY::prop1=2
: changes ALL occurrences ofprop1
atmchange sub::ANY::prop1=2
: changes all occurrences ofprop
that are nested insidesub
, hence skippingroot::prop1
.Basically, using this syntax allows to better scope the area of the XML where "--all" (as it was called before) will act.Use ANY:: in the node name string to allow multiple matches.
Notice that as implemented,
ANY
does NOT have to match at least one sub-node. In the example above,sub::ANY::prop1
also matchessub::prop1
. I considered adding a second keyword, to enforce that ANY would not expand to nothing, something likesub::ANY_CHILD::prop1
, which would only matchsub::other1::prop1
, but it seemed complicated, and I did not see a real need for it.WARNING: this is not a backward compatible change. If your run script contains the
--all
flag, it will not work. However, the error message will explain how to change the syntax to comply with the new interface.