Skip to content

Commit 0b18da5

Browse files
leliaclaude
andcommitted
Harden release verify step against PyPI index propagation delays
The verify loop assumed a new release appears in PyPI's simple index within its 10-minute budget. Both socketsecurity 2.5.9 and socketdev 3.4.2 (2026-08-05) took longer than that: the upload succeeded and the JSON API showed the release immediately, but the CDN-cached simple index kept serving a stale version list past the loop's last attempt, failing the release and skipping the Docker publish. Extend the retry window to 30 minutes, add --no-cache-dir so each attempt refetches the index rather than revalidating pip's locally cached stale copy, and log when the JSON API already has the version so index staleness is distinguishable from a failed publish. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 142449b commit 0b18da5

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,23 @@ jobs:
7979
env:
8080
VERSION: ${{ env.VERSION }}
8181
run: |
82-
for i in {1..30}; do
83-
if pip install socketsecurity==${VERSION}; then
82+
# PyPI's simple index is CDN-cached and can lag a successful upload
83+
# by 10+ minutes when a cache purge is delayed (both socketsecurity
84+
# 2.5.9 and socketdev 3.4.2 hit this on 2026-08-05), so retry for up
85+
# to 30 minutes and use --no-cache-dir so each attempt refetches the
86+
# index instead of revalidating a stale copy from pip's HTTP cache.
87+
for i in {1..60}; do
88+
if pip install --no-cache-dir socketsecurity==${VERSION}; then
8489
echo "Package ${VERSION} is now available and installable on PyPI"
8590
pip uninstall -y socketsecurity
8691
echo "success=true" >> $GITHUB_OUTPUT
8792
exit 0
8893
fi
89-
echo "Attempt $i: Package not yet installable, waiting 20s... (${i}/30)"
90-
sleep 20
94+
if curl -s -f "https://pypi.org/pypi/socketsecurity/${VERSION}/json" > /dev/null; then
95+
echo "Release ${VERSION} exists on PyPI (JSON API) but is not in the simple index yet - CDN propagation delay"
96+
fi
97+
echo "Attempt $i: Package not yet installable, waiting 30s... (${i}/60)"
98+
sleep 30
9199
done
92100
echo "success=false" >> $GITHUB_OUTPUT
93101
exit 1

0 commit comments

Comments
 (0)