-
Notifications
You must be signed in to change notification settings - Fork 119
ci: retry PyPI install smoke test to tolerate index propagation #437
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,10 @@ jobs: | |
|
|
||
| - name: Extract version from tag | ||
| id: get_version | ||
| run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
| run: | | ||
| VERSION="${GITHUB_REF#refs/tags/}" | ||
| VERSION="${VERSION#v}" | ||
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||
|
|
||
| - name: Update version in pyproject.toml | ||
| run: | | ||
|
|
@@ -72,10 +75,22 @@ jobs: | |
|
|
||
| - name: Extract version from tag | ||
| id: get_version | ||
| run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
| run: | | ||
| VERSION="${GITHUB_REF#refs/tags/}" | ||
| VERSION="${VERSION#v}" | ||
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||
|
|
||
| - name: Install Comfy CLI via pip and Test | ||
| run: pip install comfy-cli==${{env.VERSION}} | ||
| run: | | ||
| # PyPI's index can lag behind a successful upload by a minute or | ||
| # two, so retry before failing the job. | ||
| for i in 1 2 3 4 5 6 7 8; do | ||
| pip install --no-cache-dir "comfy-cli==${VERSION}" && exit 0 | ||
| echo "Attempt $i: package not yet available on PyPI, waiting 15s..." | ||
| sleep 15 | ||
| done | ||
| echo "::error::Failed to install comfy-cli==${VERSION} after 8 attempts" | ||
| exit 1 | ||
|
Comment on lines
83
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Retry loop looks solid — here's a small polish to keep diagnostics crisp. The logic holds up (thanks to GitHub's default
🛠️ Proposed polish for the retry loop - name: Install Comfy CLI via pip and Test
run: |
# PyPI's index can lag behind a successful upload by a minute or
# two, so retry before failing the job.
for i in 1 2 3 4 5 6 7 8; do
- pip install --no-cache-dir "comfy-cli==${VERSION}" && exit 0
- echo "Attempt $i: package not yet available on PyPI, waiting 15s..."
+ if timeout 60s pip install --no-cache-dir --timeout 30 "comfy-cli==${VERSION}"; then
+ exit 0
+ fi
+ echo "Attempt $i failed (exit=$?); waiting 15s for PyPI index to catch up..."
sleep 15
done
echo "::error::Failed to install comfy-cli==${VERSION} after 8 attempts"
exit 1A rhyme to sum it up: the loop is sound and tightly bound; log the cause so the fault is found. 🐇 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Test Comfy CLI Help | ||
| run: comfy --help | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Tiny DRY nit: the
v-stripping dance is duplicated in both jobs.No bug here — just a pinch of repetition. You could compute
VERSIONonce inbuild-n-publish-pypiand expose it viajobs.<id>.outputs, then consume it intest-pip-installationthroughneeds.build-n-publish-pypi.outputs.version. One tag, one truth — no copy-paste to chase.Also worth noting:
${VERSION#v}strips only a lowercase leadingv. If a maintainer ever tagsV1.2.3, it'll sneak through un-stripped. Unlikely given your tagging convention, but a${VERSION#[vV]}would slam that door shut.♻️ Optional refactor sketch (share the version across jobs)
build-n-publish-pypi: ... + outputs: + version: ${{ steps.get_version.outputs.version }} steps: ... - name: Extract version from tag id: get_version run: | VERSION="${GITHUB_REF#refs/tags/}" - VERSION="${VERSION#v}" + VERSION="${VERSION#[vV]}" echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo "version=${VERSION}" >> $GITHUB_OUTPUT ... test-pip-installation: needs: build-n-publish-pypi ... steps: ... - - name: Extract version from tag - id: get_version - run: | - VERSION="${GITHUB_REF#refs/tags/}" - VERSION="${VERSION#v}" - echo "VERSION=${VERSION}" >> $GITHUB_ENV + - name: Resolve version from upstream job + run: echo "VERSION=${{ needs.build-n-publish-pypi.outputs.version }}" >> $GITHUB_ENVAlso applies to: 78-81
🤖 Prompt for AI Agents