Skip to content
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

Make --cdn-arl-template argument work as expected by Pub [RHELDST-20512] #242

Merged
merged 1 commit into from
Sep 28, 2023

Commits on Sep 28, 2023

  1. Make --cdn-arl-template argument work as expected by Pub [RHELDST-20512]

    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:
    
        --cdn-arl-template arg1 arg2 arg3 ...
    
    However, the usual convention[1] for list-style arguments in our tools,
    and the one expected by Pub, is instead:
    
        --cdn-arl-template arg1 \
        --cdn-arl-template arg2 \
        --cdn-arl-template arg3 ...
    
    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] release-engineering#240
    rohanpm committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    e509d04 View commit details
    Browse the repository at this point in the history