Fixes #35740 - Composite content view versions can be emptied out during same-repo merging #10350
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 are the changes introduced in this pull request?
This PR stops repositories from being completely cleared out at composite CV publish time. The
remove_all
flag comes from a bit of theCopyAllUnits
action that only runs when the related CV is composite.Considerations taken when implementing this change?
I was considering refactoring the part of
CopyAllUnits
that pertains to composite CVs to usecopy_all
, since filters shouldn't be present. However, since this piece of code may make it back to older versions of Katello, I wanted to keep it as simple as possible. I left a TODO for getting to this down the road.What are the testing steps for this pull request?
Follow the steps from the issue:
source_repositories = source_repositories.reverse
here: https://github.com/Katello/katello/blob/master/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb#L21Also, it would be work running an incremental update on a component CV version that is part of a composite and ensuring that the resulting composite incremental CV version makes sense. In particular, try running incremental update twice on a version with different RPM packages. For example, incrementally add foo.rpm to version 1.0, creating 1.1, and then incrementally add bar.rpm to version 1.0, creating version 1.2. I want to ensure that, in the incremental update case, the content is cleared out appropriately. There have been issues in the past with incremental versions affecting each other (e.g. version 1.1 gets foo.rpm, version 1.2 gets bar.rpm and foo.rpm when it was only requested to get bar.rpm).