Make --cdn-arl-template argument work as expected by Pub [RHELDST-20512] #242
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.
The --cdn-arl-template argument can be used to pass multiple ARL templates, which in practice is needed.
The argument was declared as nargs='*', which means the way it's expected to be used is:
However, the usual convention[1] for list-style arguments in our tools, and the one expected by Pub, is instead:
So that's how arguments were being passed.
Problem: the latter argument style was accepted, but only the last argument had any effect. This meant, for any target configured with multiple ARL templates, only the last one in the list was being used.
Fix the argument handling to support the usual convention (while remaining backwards-compatible).
This issue has always been present but could be missed until now because:
pubtools-pulp never logged the URLs/ARLs flushed, so the mistake can't be noticed from the logs; fixed by [2]
there was no test covering the case of multiple ARL templates; fixed here
technically the need to flush by multiple ARLs has not been particularly important until recenty, when more CDN origins have been integrated into each environment.
[1] https://release-engineering.github.io/pubtools/devguide.html#arguments-with-multiple-values
[2] #240