-
Notifications
You must be signed in to change notification settings - Fork 203
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
Allow amending easyconfig parameters which are not the default #3651
Allow amending easyconfig parameters which are not the default #3651
Conversation
Overwriting parameters which are not in the EC and not one of a few standard ones is currently impossible. However it is useful when e.g. EasyBlocks introduce new params where the user wants to overwrite the default value without changing the EC manually. This change allows this by simply appending the new parameter when it is not in the default list.
a5f5a04
to
befebc3
Compare
We already have this case covered by the variable naming enforcement, i.e. loading an EC with an unknown parameter not named local_* will already error out
specs.update({ | ||
'foo': 'bar123' | ||
}) | ||
self.assertErrorRegex(EasyBuildError, "Unknown easyconfig parameter: foo", |
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.
I would think this test is still useful for parameters that are not defined in the easyblock, or is that taken care of somewhere else?
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.
That is taken care of elsewhere. I don't think we can trigger this error anymore at all, as that is specific to using non-default parameters which we allow now.
The EasyBlock instantiation will trigger e.g. "Use of 2 unknown easyconfig parameters detected in test.eb: foo, some_list", see test_fix_deprecated_easyconfigs
Co-authored-by: Sam Moors <smoors@users.noreply.github.com>
@smoors Took your suggestion but had to add an is-string check or it will fail for unhashable types (e.g. other dicts) as values. I also reordered the dict and interspersed the comments which IMO is easier to understand. Check if you agree please. |
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.
lgtm
Going in, thanks @Flamefire! |
Overwriting parameters which are not in the EC and not one of a few standard ones is currently impossible.
However it is useful when e.g. EasyBlocks introduce new params where the user wants to overwrite the default value without changing the EC manually.
This change allows this by simply appending the new parameter when it is not in the default list.