pip gets the package in place of its metadata through a pull-through link once the package is cached
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
Read the linked pull request #1454, which follows this report. The issue identifies Distribution.content_handler() and PythonRemote.get_remote_artifact_url() as relevant entry points; understand how pull-through links announce PEP 658 metadata and how the proposed change handles them. Done means pip no longer receives a package where it expects metadata after the package has been cached.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
pulp_python 3.36.2 with pulpcore 3.120.0; the same code is on main.
Describe the bug
For a package that is not in the repository yet, the simple page links
<base>/<file>?redirect=<upstream URL> and announces its PEP 658 metadata on that
link (data-core-metadata / core-metadata). pip builds the metadata URL by
appending .metadata to the whole link, so the suffix lands in the redirect
parameter and the path still names the package:
<base>/<file>?redirect=<upstream URL>.metadata.
PythonRemote.get_remote_artifact_url() handles that form, but only on the
pull-through branch of the content handler. When the package is already in the
repository, because another client fetched it in the meantime, the handler finds it
by its path first and answers the metadata request with the package itself. pip then
fails the metadata's hash check. A client gets into this whenever it read the simple
page before the package was cached, for example two CI jobs installing the same new
package at the same time.
To Reproduce
- A distribution with a Python repository and a PyPI remote (pull-through).
- On
simple/<project>/, take the link of a wheel that is not cached yet; it carries
?redirect=and announces metadata. - GET the link: the wheel is downloaded and added to the repository.
- GET the same link with
.metadataappended: the response is the wheel (its sha256),
not the metadata.
Expected behavior
A link either announces metadata that is served at the URL pip derives from it, or
announces none.
Additional context
Fixing it on the serving side would need the query string where the package is looked
up by path, which Distribution.content_handler() does not get. Not announcing
metadata on pull-through links avoids the request altogether: installers fall back to
the metadata in the package they download, and once the package is in the repository
its local link has no query string and announces the metadata again. A pull request
doing that follows.
- Ngôn ngữ chính
- Python
- Star
- 49
- Fork
- 92
- Merge trung bình
- 23 giờ 45 phút
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pulp/pulp_python
-
Pull-through: pip gets the wheel instead of its PEP 658 metadata (or the reverse), hash mismatchCó thể đã có người làm @gerrod3 đã nhận 39 ngày trước. Đang mởIssue
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
pulp/pulp_python#1428 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
pulp/pulp_python#1219 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
pulp/pulp_python#1005 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
pulp/pulp_python#999 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Implement PEP-708 - Extend the repository API to mitigate "dependency confusion" attacksCó thể đã có người làm @gerrod3 đã nhận 374 ngày trước. Đang mởFeature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
pulp/pulp_python#998 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của pulp/pulp_python
Issue tương tự
-
Triage-Needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pulp/pulp-oci-images#875 ·
-
intake mcp-intake needs-human-review priority:high type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Ikalus1988/MisakaNet#5718 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
facebookresearch/autoform-bot#872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dataset.to_json() writes "Value": [] for an empty sequenceCó thể đã có người làm @DG47 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
area: docs area: providers/oci priority: p3 size: S type: documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
finos/open-resource-broker#933 ·
Maintainer thường phản hồi trong vòng 1 ngày