fix(ci): skip already-uploaded wheels on publish rerun#241
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds pre-publish artifact validation, a PyPI JSON check that compares remote filenames to local ChangesPyPI Publish Workflow Update
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Note Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Line 268: The publish workflow currently sets skip-existing: true on the
pypa/gh-action-pypi-publish@release/v1 step which makes twine return success
even if every distribution was skipped; update the workflow to detect and fail
when nothing was uploaded by (a) capturing the action/twine output (look for
"Skipping upload" or "File already exists") and adding a follow-up step that
parses that output to fail the job when all artifacts were skipped, or (b) add a
conditional input to the publish step that disables skip-existing for production
publishes and document the behavior in the workflow comment; reference the
publish step using the action id (pypa/gh-action-pypi-publish@release/v1) and
the skip-existing input to locate where to implement the check and the
documentation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e779bd81-61a8-4caf-b590-3076b7c38945
📒 Files selected for processing (1)
.github/workflows/publish.yml
|
✅ Created PR with unit tests: #242 |
5d3b4d6 to
5cf954b
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Line 276: The for-loop declares a counter named attempt that is never used,
triggering SC2034; update the loop header in the publish workflow to either
replace the unused variable with an underscore (for attempt in 1 2 3 4 5; do ->
for _ in 1 2 3 4 5; do) or reference attempt in the loop body (e.g., include
attempt in a logging statement) so the variable is no longer unused; adjust the
loop in the same block where the variable attempt is declared.
- Around line 268-271: The comment incorrectly states duplicate tag pushes will
fail; update .github/workflows/publish.yml to either (a) correct the comment to
say a duplicate push can succeed when skip-existing: true, or (preferred) change
the publish flow to detect “nothing new uploaded” by parsing the publish step
output (the step that runs twine / uses pypa/gh-action-pypi-publish) and fail
the job if every artifact was skipped; implement this by capturing the
action/command output from the publish step (e.g., step id "publish" or the job
step that sets skip-existing) and checking for messages like "Skipping upload" /
"Already exists" / "No files were uploaded" and then add a conditional failure
when all artifacts are skipped, or alternatively disable skip-existing for
production publishes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 60185699-28fe-4329-be4a-9a0991d3e6c9
📒 Files selected for processing (1)
.github/workflows/publish.yml
22cc990 to
a86d259
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Line 298: Replace the mutable ref uses: pypa/gh-action-pypi-publish@release/v1
with an immutable commit SHA from the pypa/gh-action-pypi-publish repo: locate
the uses line (uses: pypa/gh-action-pypi-publish@release/v1) in the workflow and
change it to use the full commit SHA for the release/v1 branch (e.g.,
pypa/gh-action-pypi-publish@<full_commit_sha>), ensuring you copy the exact
commit SHA from the upstream repo and commit that updated reference so the
action is pinned immutably.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 85c85c01-c3fb-444c-82b7-fcea2ea57411
📒 Files selected for processing (1)
.github/workflows/publish.yml
c1c8351 to
92b6d10
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Around line 286-287: The PyPI probe calls must use explicit timeouts: pass a
timeout to urllib.request.urlopen(req) (e.g., urlopen(req, timeout=30)) so the
Python probe fails fast, and update the shell "curl" invocation (the curl call
around lines 327-329) to include connection and overall timeouts (e.g.,
--connect-timeout 10 and --max-time 30) or run curl via subprocess.run with a
timeout argument; modify the calls referencing urlopen(req) and the curl
invocation accordingly so neither call can hang indefinitely.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c3756866-e74c-4c1b-8cd8-773efe0a25a9
📒 Files selected for processing (1)
.github/workflows/publish.yml
92b6d10 to
6073963
Compare
Summary
skip-existing: trueto pypa/gh-action-pypi-publish step400 File already existswhen rerunning failed publish jobs (e.g. transient Rekor/Sigstore failures that crash after partial upload)Test plan
Summary by CodeRabbit