Parameter overrides should not clobber other previous parameter values #2701
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.
What does this change
A user should be able to override a parameter value and not have all other previously used parameter values disregarded.
Currently, any time an override is set, all previous override values are being thrown away. We should update the installation record to use previous values, and any new values specified. So in the example above, both parameters logLevel AND featureA should be remembered on the installation after upgrade is run.
Note that if a user overrides a value using
--param
, the only way to remove that override is to edit the installation and remove it. You can't "unset" a parameter override via a CLI flag.As part of this fix, I found some relevant unit tests that had been accidentally commented out and not added back while refactoring. I've uncommented the tests and updated them to work with the new function that resolves parameters. I have also added a smoke test that checks for this regression so that we can't quite so easily break it again in the future.
When I fixed this bug, I found that when we persist the parameters from the installation on the Run (to remember what parameters were used for a particular run of the bundle), we were copying ALL parameters, including ones that don't apply to the current action. I've fixed that as well so that we only persist parameters that apply to the Run's action. The installation will continue to keep a record of all previous parameter values, but for the Run we only persist parameter values used by that particular action.
What issue does it fix
Fixes #2700
Notes for the reviewer
N/A
Checklist
Reviewer Checklist