-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
disambiguate get_override_key treatment of global #1791
Conversation
@@ -1,2 +1,2 @@ | |||
defaults: | |||
- override /group1@_global_: file2 | |||
- override /group1@_global_.group1: file2 |
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.
Instead of this, can you add a global header to the file?
Experiment configs have it but this does not.
A package override in the defaults list is relative to the package of a config.
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.
Done in f12150b.
You must specify 'db@_global_', e.g, db@_global_=<OPTION> | ||
Available options:""" |
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.
Rebased to incorporate changes from PR #1783 so that this test would pass.
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.
A few nits. Overall I am okay with this change.
I believe it will also address the issue you opened about _here_
.
Don't forget news fragment.
param( | ||
"two_group_defaults_different_pkgs_global", | ||
[], | ||
[ | ||
ResultDefault( | ||
config_path="group1/file1", | ||
parent="two_group_defaults_different_pkgs_global", | ||
package="group1", | ||
), | ||
ResultDefault( | ||
config_path="group1/file2", | ||
parent="two_group_defaults_different_pkgs_global", | ||
package="", | ||
), | ||
ResultDefault( | ||
config_path="two_group_defaults_different_pkgs_global", | ||
package="", | ||
is_self=True, | ||
), | ||
], | ||
), |
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.
missing id for this test.
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.
Added in 806eb0b.
parent="group_default_at_global", | ||
), | ||
], | ||
id="include_absolute_config:override_with_global_default2", |
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.
copy paste id? include_absolute_config does not make sense to me.
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.
Yes. Updated in 806eb0b.
This PR also closed #1803 |
This PR closes #1784 by modifying the
InputDefaults.get_override_key
method.Changes Introduced
Previously,
get_override_key
had this behavior:"foo"
and package"foo"
->override key == "foo"
"foo"
and package"bar"
->override key == "foo@bar"
"foo"
and package""
->override key == "foo"
With this PR,
get_override_key
has this behavior:"foo"
and package"foo"
->override key == "foo"
"foo"
and package"bar"
->override key == "foo@bar"
"foo"
and package""
->override key == "foo@_global_"
Updates to Pre-Existing Tests
This PR introduces some new tests, and it also updates two old tests that were relying on the old key-collision behavior.
These two tests had to be updated:
In the first updated tests, the command-line override
"group1/group2=file2"
was being used, while"group1/group2@_global_=file2"
should have been used instead.In the second updated test, the default element
override /group1@_global_: file2
was being used to override group"group1"
at package"group1"
, while the elementoverride /group1@_global_.group1: file2
should have been used instead.