Skip to content
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

PEP 740: add provenance to simple API #16801

Merged
merged 20 commits into from
Oct 21, 2024

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Sep 27, 2024

This adds the final part of surfacing PEP 740: it connects the persisted provenance to the simple HTML and JSON APIs, and bumps the API version in the process.

This is currently branched off of #16778, so I'm leaving this as a draft until that's merged.

Supersedes #16624.

The latest PEP 740 language doesn't include this,
so we don't need it.

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Broken out from pypi#16624.

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
@woodruffw woodruffw self-assigned this Oct 3, 2024
@woodruffw woodruffw marked this pull request as ready for review October 3, 2024 16:21
@woodruffw woodruffw requested a review from a team as a code owner October 3, 2024 16:21
Copy link
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read through once or twice, and added some comments inline.

I'm still unfamiliar with some of these, and would want to spend a bit more time on checking the performance of the changes to the /simple/ endpoints, since those get relatively highly trafficked.

tests/functional/api/test_simple.py Outdated Show resolved Hide resolved
tests/unit/api/test_simple.py Outdated Show resolved Hide resolved
tests/unit/api/test_simple.py Outdated Show resolved Hide resolved
@@ -22,7 +22,7 @@
from warehouse.packaging.interfaces import ISimpleStorage
from warehouse.packaging.models import File, LifecycleStatus, Project, Release

API_VERSION = "1.2"
API_VERSION = "1.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough yet about incrementing this value and what that does.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from the PEP itself:

The api-version SHALL specify version 1.3 or later.

(Via https://peps.python.org/pep-0740/#json-based-simple-api)

In this context, all incrementing it does is signal to a client that the index is now serving PEP 740 objects. Clients are expected to handle this gracefully, since api-version is intended to be a semantic version.

(I can find a cite for that last claim if you'd like, although I'd have to go digging. But for context, this was just bumped a few weeks ago from 1.1 to 1.2 with no client breakage due to PEP 708.)

woodruffw and others added 2 commits October 16, 2024 22:05
Copy link
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, we'll send this next weekish

@miketheman miketheman merged commit e04b7bb into pypi:main Oct 21, 2024
18 checks passed
@miketheman miketheman deleted the ww/pep740-simple-api branch October 21, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants