Add unit test that fails if deprecated config replacement lives in de… #2783
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.
Because config defaults from the defaults yamls don't work with automatic
deprecation mapping, I wanted a way to make sure any time a param is
deprecated its replacement keys won't be configured via these files.
After a quick chat with other Pelican devs, we decided the best way to
do this would be a unit test that fails if a deprecated config replacement
key is found in one of the defaults yaml files.
This test fails in those cases, and also checks an intentionally-bad
yaml string to make sure these keys are in fact caught in the
first place.
The underlying issue was that defaults from
defaults.yamlorosdfDefaults.yamldo not show up to Viper as being defaults, rather they appear as user-supplied.
For a deprecated key like
DisableHttpProxythat's replaced byClient.DisableHttpProxy,we only map the value for the deprecated key as the value for the new key if
the new key is not set by the user. This means that when replacement keys are
defined in the default yamls, we weren't doing the mapping.