Support different commit modes [RHELDST-20490] #364
Merged
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.
This adds support to exodus-rsync for using the new commit_mode argument added to the exodus-gw commit API in [1]. The use-case is to allow rhsm-pulp to do a phase1 commit during Pulp publish tasks, to ensure that all RPMs have reached the CDN storage and later fast-forward publishes will work correctly even if the current exodus-gw publish later fails.
The default behavior is not to pass any
commit_mode
, which ensures that exodus-rsync remains compatible with older versions of exodus-gw.This change is aiming for flexibility:
the argument's value is intentionally not validated as being "phase1" or "phase2"; validation is left to the server. This avoids exodus-rsync needing further code changes if more commit modes become supported later.
the mode can be configured both using command-line arguments and the config file. The intent is to use the command-line argument from pubtools-exodus, but it seems wise to also support using the config file for cases not yet anticipated.
[1] release-engineering/exodus-gw#596