You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep the remote's upload time and yank on cached pull-through files - #1469
On a pull-through distribution with a repository, a file already in the repository replaced the remote's entry on the simple page completely. Its upload time became the time it was cached, so uv --exclude-newer and pip --uploaded-prior-to saw old files as new. A yank on the remote, before or after the file was cached, no longer showed either, so resolvers could pick a yanked release.
When the remote lists the same file (same name and sha256), the entry now keeps the remote's upload time and is yanked when the remote yanked it; a local yank still applies. The URL and everything else still come from the repository, so clients download Pulp's copy.
Testing
Unit tests for merge_pull_through_releases: remote upload time kept, remote yank applied, local yank kept, a different file under the same name takes nothing from the remote, a missing remote upload time keeps the local one.
The pulp_python unit suite passes.
Checklist
Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
A changelog entry or entries has been added for any significant changes
(For new features) - User documentation and test coverage has been added
Summary by CodeRabbit
Bug Fixes
Pull-through package pages now show the remote upload time for matching files already cached locally.
Cached files now reflect the remote package’s yanked status and, when available, its yank reason. Locally yanked files remain marked yanked when the remote package is not yanked.
Files that do not match the remote version retain their local details.
On a pull-through distribution with a repository, a file already in the
repository replaced the remote's entry on the simple page completely. Its
upload time became the time it was cached, so tools filtering releases by
upload time (uv --exclude-newer, pip --uploaded-prior-to) saw old files as
new; and a yank on the remote, before or after caching, no longer showed.
When the remote lists the same file (same name and sha256), the entry now
keeps the remote's upload time and is yanked when the remote yanked it. The
URL and the rest still come from the repository.
Closes: pulp#1371
No actionable comments were generated in the recent review.
Walkthrough
Pull-through simple pages now merge cached releases with remote release metadata. Matching files with equal SHA-256 digests can retain the remote upload time and inherit remote yank metadata. Unit tests cover matching and non-matching releases, missing upload times, and entries present on only one side.
Changes: Pull-through release metadata
Layer / File(s)
Summary
Merge metadata for cached releases pulp_python/app/pypi/views.py, pulp_python/tests/unit/test_pull_through_releases.py, CHANGES/1371.bugfix
The merge keeps local release entries. For matching filenames with equal SHA-256 digests, it uses the remote upload time when available and applies remote yank metadata unless the local release is already yanked. Tests cover metadata precedence and unmatched entries. The changelog describes the upload-time and yank behavior.
Connect the merge to simple-page retrieval pulp_python/app/pypi/views.py
SimpleView.retrieve now uses the merge function instead of directly updating the remote release mapping.
Pull-through simple pages will show the remote upload time and yank state for cached files whose name and SHA-256 match the remote. The change is localized and covered by unit tests, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the main change: cached pull-through files now keep the remote's upload time and yank state. It matches the raw summary, the PR objectives, and the description. It is specific and con…
Description check
The description covers the problem, the fix, and testing. It links issue #1371 and the changelog checkbox is ticked. The template's commit-squash and AI policy items are checked or unchecked as the au…
Linked Issues check
Issue #1371 asks that pull-through packages keep the source upload-time after they are cached, so --uploaded-prior-to and --exclude-newer filter by the source time. At head d7040eb, merge_pull_through…
Out of Scope Changes check
The whole-PR diff against merge base 2e1ce32 touches three areas. pulp_python/app/pypi/views.py adds merge_pull_through_releases and uses it in SimpleView.retrieve. The unit tests in pulp_python/tests…
Full details: Title check
Explanation
The title states the main change: cached pull-through files now keep the remote's upload time and yank state. It matches the raw summary, the PR objectives, and the description. It is specific and concise, and it names the primary behavior change.
Full details: Description check
Explanation
The description covers the problem, the fix, and testing. It links issue #1371 and the changelog checkbox is ticked. The template's commit-squash and AI policy items are checked or unchecked as the author set them. The user documentation and test coverage item is unchecked, which is acceptable because this is a bugfix, not a new feature. The AI policy checkbox is unchecked, so the author has not confirmed compliance with it.
Full details: Linked Issues check
Explanation
Issue #1371 asks that pull-through packages keep the source upload-time after they are cached, so --uploaded-prior-to and --exclude-newer filter by the source time. At head d7040eb, merge_pull_through_releases in pulp_python/app/pypi/views.py copies the remote upload_time onto the local entry when the remote lists the same file (matched by filename and sha256). SimpleView.retrieve now calls this merge instead of dict.update, so the cached copy keeps the source time. The issue does not require a specific mechanism. The PR also applies a remote yank, which is extra behavior that the issue does not request. Unit tests for the merge function are listed in the PR description and the changelog entry is present. I did not run the test suite. The fallback to the local upload_time applies only when the remote does not list the file or gives no upload time. The issue does not specify that case.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against merge base 2e1ce32 touches three areas. pulp_python/app/pypi/views.py adds merge_pull_through_releases and uses it in SimpleView.retrieve. The unit tests in pulp_python/tests/unit/test_pull_through_releases.py cover that function. CHANGES/1371.bugfix documents the behavior. All three support objective #1371. The extra remote-yank behavior is described in the PR and tested. It is part of the same merge logic, so it is not unrelated scope.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This branch has not been deployed
No deployments
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
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.
Closes #1371
On a pull-through distribution with a repository, a file already in the repository replaced the remote's entry on the simple page completely. Its upload time became the time it was cached, so
uv --exclude-newerandpip --uploaded-prior-tosaw old files as new. A yank on the remote, before or after the file was cached, no longer showed either, so resolvers could pick a yanked release.When the remote lists the same file (same name and sha256), the entry now keeps the remote's upload time and is yanked when the remote yanked it; a local yank still applies. The URL and everything else still come from the repository, so clients download Pulp's copy.
Testing
merge_pull_through_releases: remote upload time kept, remote yank applied, local yank kept, a different file under the same name takes nothing from the remote, a missing remote upload time keeps the local one.Checklist
Summary by CodeRabbit