fix(ci): allow for immutable GitHub releases#790
Conversation
Move release artifact creation from a separate workflow step into release-it's `after:bump` hook and use `github.assets` to upload them atomically with the GitHub release. This eliminates the `--clobber` flag and the split between release creation and artifact upload that allowed artifacts to be silently overwritten on re-runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude review |
- Add `set -e` to archive creation hook so a failing `tar` aborts instead of silently continuing (bash for-loop exit code gotcha) - Remove accidental `v` prefix from archive filenames to preserve existing naming convention (`langfuse-js-sdk-core-3.1.0.tar.gz`) - Update rollback notification text: with atomic release+assets, the stale "re-run to upload artifacts" advice no longer applies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
All three issues from my previous review have been addressed: set -e added for loop error propagation, the unintended v prefix removed from tarball filenames, and rollback guidance updated. LGTM.
Extended reasoning...
Overview
This PR moves GitHub release artifact creation and upload from separate workflow steps into release-it's after:bump hook and github.assets, making artifact upload atomic with the release creation. Three files are changed: .release-it.ci.json, .github/workflows/release.yml, and .gitignore.
Previous Review Feedback Addressed
My prior review flagged three issues, all of which the author resolved in commit 25420aa ('address review feedback for immutable releases'):
- 🔴 Error handling:
set -e;was added before the for loop, ensuring any failingtarinvocation aborts the shell with a non-zero exit — release-it will then not create the GitHub release with incomplete artifacts. - 🟡 Filename v-prefix: The unintended
vprefix inv${version}.tar.gzwas removed, preserving the same naming convention as the old workflow. - 🟡 Stale rollback guidance: The rollback notification now accurately describes the atomic release model and removes the misleading 'Re-run' / 'Manually upload' options.
Security Risks
No security-sensitive code is touched. The PR does not affect authentication, permissions, or data handling. The release token (GH_ACCESS_TOKEN) usage is unchanged.
Level of Scrutiny
This is CI/release automation code. The changes are focused and the improvement (atomic release vs. two-step process) is clearly beneficial. The pattern of moving archive creation into release-it hooks is a well-understood approach.
Other Factors
No bugs were found by the automated bug hunting system in this pass. The bug hunting system's prior inline comments have all been addressed. The .gitignore addition is correct and unambiguous.
Summary
after:bumphookgithub.assetsto upload archives atomically with the GitHub release creationgh release upload --clobberstep that allowed artifacts to be silently overwritten on re-runsrelease-artifacts/to.gitignoreContext
Previously, the GitHub release was created by release-it and the artifact upload was a separate workflow step. This meant:
--clobberflag was needed as a workaround, but it also meant artifacts could be overwritten at any timeNow release-it handles both in a single atomic operation.
Test plan
release-it --dry-runshows correct lifecycle ordering (bump → build → archive → release)prepatch --preRelease=alpha) to verify end-to-end🤖 Generated with Claude Code
Disclaimer: Experimental PR review
Greptile Summary
This PR consolidates GitHub release artifact creation and upload into release-it's
after:bumphook andgithub.assets, replacing the former separategh release upload --clobberstep. The result is an atomic release where the GitHub release and its 6 tarballs are either created together or not at all, eliminating the previous race condition where a failed upload left a release without artifacts.Confidence Score: 5/5
Safe to merge; the core atomic release logic is correct and the only finding is a stale comment in the rollback notification step.
All findings are P2. The implementation correctly moves archive creation into
after:bumpbefore the GitHub release is created, achieving the stated atomicity goal. The gitignore addition and config changes are clean. The single flagged issue (stale rollback message text) is a documentation-quality concern that doesn't affect runtime behavior..github/workflows/release.ymllines 498–509 — stale rollback guidance should be updated to reflect the new atomic flow.Important Files Changed
after:bumphook andgithub.assetsglob; release-it now atomically creates the GitHub release with all 6 tarballs.release-artifacts/to prevent generated tarballs from being accidentally committed.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Workflow trigger] --> B[pnpm build + verify artifacts] B --> C[release-it: bump versions in package.json] C --> D["after:bump hook: pnpm build (versioned)"] D --> E["after:bump hook: tar all packages → release-artifacts/*.tar.gz"] E --> F[release-it: git commit + tag + push] F --> G["release-it: create GitHub release WITH assets (atomic)"] G --> H["after:release hook: pnpm -r publish to npm"] H --> I[Slack notification] G -- upload fails --> X[❌ Release creation fails — no orphaned release] D -- build fails --> Y[❌ Hook fails — no version bumped yet]Comments Outside Diff (1)
.github/workflows/release.yml, line 498-509 (link)With the new atomic approach, if
steps.releasesucceeds, the GitHub release and its artifacts are already uploaded — there is nothing left to re-upload. Options 1 and 2 in this echo block no longer apply and could mislead an on-call engineer into performing unnecessary manual work. The only remaining failure scenario at this point is the Slack notification steps, which are non-critical.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(ci): make GitHub release artifacts i..." | Re-trigger Greptile