Make deploy workflow idempotent for PyPI release reruns - #5
Conversation
Co-authored-by: SpriteMisaka <[email protected]>
审查者指南(小型 PR 中折叠显示)审查者指南部署工作流现在会在 PyPI 发布操作中设置 幂等 PyPI 发布重新运行的时序图sequenceDiagram
participant Deploy as Deploy workflow
participant PyPI as PyPI publish action
participant Registry as PyPI registry
Deploy->>PyPI: publish package
PyPI->>Registry: upload artifacts
alt artifacts are new
Registry-->>PyPI: accept upload
PyPI-->>Deploy: publish succeeds
else artifacts already exist
PyPI->>Registry: skip-existing: true
Registry-->>PyPI: skip duplicates
PyPI-->>Deploy: rerun succeeds
end
文件级变更
提示和命令与 Sourcery 交互
自定义你的体验访问你的仪表板以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideThe deploy workflow now sets Sequence diagram for idempotent PyPI release rerunssequenceDiagram
participant Deploy as Deploy workflow
participant PyPI as PyPI publish action
participant Registry as PyPI registry
Deploy->>PyPI: publish package
PyPI->>Registry: upload artifacts
alt artifacts are new
Registry-->>PyPI: accept upload
PyPI-->>Deploy: publish succeeds
else artifacts already exist
PyPI->>Registry: skip-existing: true
Registry-->>PyPI: skip duplicates
PyPI-->>Deploy: rerun succeeds
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟢 Approval recommended
The change is minimal, matches the stated root cause, and uses a supported publish-action option to make reruns non-failing without altering build or release semantics.
Pull request overview
Makes the PyPI publish workflow rerun-safe by configuring the publish action to tolerate already-uploaded artifacts, preventing release reruns from failing with duplicate upload errors.
Changes:
- Configure
pypa/gh-action-pypi-publishtoskip-existing: trueso reruns don’t fail onHTTP 400 Bad Requestfor existing files.
File summaries
| File | Description |
|---|---|
| .github/workflows/python-publish.yml | Adds skip-existing: true to the PyPI publish step to make reruns idempotent. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The
deployActions job failed on release reruns because PyPI rejected re-upload of already-published artifacts (HTTP 400 Bad Request). This change makes the publish step tolerant of existing files so reruns are non-failing.Root-cause alignment
.github/workflows/python-publish.yml, not package build output.Workflow change
pypa/gh-action-pypi-publishconfig to skip files that already exist on PyPI during reruns.Resulting behavior
Sourcery 摘要
使 PyPI 发布具备幂等性,从而避免因重复构件导致发布重新运行失败。
错误修复:
CI:
Original summary in English
Summary by Sourcery
Make PyPI publishing idempotent so release reruns do not fail on duplicate artifacts.
Bug Fixes:
CI: