-
Notifications
You must be signed in to change notification settings - Fork 112
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
Fix error when listing repo version while running orphan cleanup #1681
Conversation
88aeff4
to
f7a66c6
Compare
Attached issue: https://pulp.plan.io/issues/9481 |
f7a66c6
to
c44e79c
Compare
f989a28
to
5b03531
Compare
ctype_query = Content.objects.filter( | ||
pulp_type=self.content_type, pk__in=repository_content.values_list("content", flat=True) | ||
) | ||
ctype_model = ctype_query.first().cast().__class__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring of this function doesn't match what it is doing (or what it was doing previously, to be fair). Could you update it to convey the requirement that it be capable of handling the types of content "removed" from the repository version as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"present" is the misleading term
5b03531
to
daec1b0
Compare
pulpcore/app/models/repository.py
Outdated
For each content type present in the RepositoryVersion, create the URL of the viewset of | ||
that variety of content along with a query parameter which filters it by presence in this | ||
RepositoryVersion. | ||
For each content type that is or was apart of the RepositoryVersion, create the URL of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is present in or removed from this RepositoryVersion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested a slightly different phrasing, LGTM otherwise.
daec1b0
to
df6c0ee
Compare
Just tested this patch by manually making the changes on |
fixes: #9481
Since orphan cleanup became a non-blocking task it was possible for this query to "return'"
None
if the firstContent
was deleted before thecast
call was completed. Now it should use aContent
object that is apart ofRepositoryVersion
.Please be sure you have read our documentation on creating PRs:
https://docs.pulpproject.org/contributing/pull-request-walkthrough.html