fix(ci): poll PyPI JSON API for availability check#348
Merged
Conversation
Replace `pip install --dry-run --no-cache-dir` with a curl request to
the PyPI JSON API. pip resolves against the Simple Index, which is
served via Fastly and can return stale `/simple/reqstool/` pages for
minutes after upload. `--no-cache-dir` only disables pip's on-disk
cache; it does not bypass the upstream CDN cache. The JSON endpoint
`/pypi/{name}/{version}/json` is the canonical, cache-friendly way to
check whether a specific version exists.
Observed failure: run 24624666126 (release of 0.9.0) polled for the
full 15 minutes and never saw the package, even though the JSON API
returns 200 for reqstool 0.9.0.
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
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.
Summary
pip install --dry-run --no-cache-dirwithcurlagainst the PyPI JSON API (/pypi/{name}/{version}/json) in the "Wait for PyPI availability" step ofrelease_prod.yml.Root cause
PR #341 intended this switch but landed with
--no-cache-dironly. That was insufficient: pip resolves through the Simple Index, which is served via Fastly and can return stale/simple/reqstool/pages to a given POP for minutes after upload.--no-cache-dirdisables pip's on-disk cache but does not bypass the upstream HTTP/CDN cache.Observed in run 24624666126 — release of 0.9.0 polled 90× over 15 minutes and never saw the package, even though `GET https://pypi.org/pypi/reqstool/0.9.0/json\` returns 200 right now.
The JSON API is the canonical, cache-friendly endpoint for "does this version exist".
Test plan