Fix RepositoryVersion.remove_content using wrong queryset for lazy co…#7853
Open
git-hyagi wants to merge 1 commit into
Open
Fix RepositoryVersion.remove_content using wrong queryset for lazy co…#7853git-hyagi wants to merge 1 commit into
git-hyagi wants to merge 1 commit into
Conversation
…ntent The remove_content method was incorrectly using the unfiltered `content` queryset instead of `to_remove` when deleting or marking RepositoryContent entries as removed. This caused all content to be removed from the repository version rather than only the specified lazy content. Fixes: pulp#7851 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gerrod3
reviewed
Jul 9, 2026
| @@ -0,0 +1 @@ | |||
| Fixed `RepositoryVersion.remove_content` incorrectly removing all content instead of only the specified lazy content. | |||
Contributor
There was a problem hiding this comment.
This doesn't really reflect the scenario the remove could fail in. It's when the remove is self-referential and the amount is greater than 65k, correct?
gerrod3
reviewed
Jul 9, 2026
| RepositoryContent.objects.filter( | ||
| repository=self.repository, | ||
| content_id__in=content, | ||
| content_id__in=to_remove, |
Contributor
There was a problem hiding this comment.
What happens when to_remove is greater than 65k? Does this break?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…ntent
The remove_content method was incorrectly using the unfiltered
contentqueryset instead ofto_removewhen deleting or marking RepositoryContent entries as removed. This caused all content to be removed from the repository version rather than only the specified lazy content.Fixes: #7851
📜 Checklist
See: Pull Request Walkthrough