feat(release): add release command group and CI finalization#628
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Telemetry
Other
Bug Fixes 🐛Telemetry
Other
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
|
472ad3d to
d28ca63
Compare
Codecov Results 📊✅ 129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 97.72%. Project has 1385 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.51% 95.59% +0.08%
==========================================
Files 206 219 +13
Lines 30469 31382 +913
Branches 0 0 —
==========================================
+ Hits 29101 29997 +896
- Misses 1368 1385 +17
- Partials 0 0 —Generated by Codecov Action |
6d56d43 to
e4bb644
Compare
b205551 to
b8c1acc
Compare
64c82f7 to
5c8ff77
Compare
07bfc87 to
046085d
Compare
3724d91 to
2e46a78
Compare
773dea1 to
bf79257
Compare
ab82001 to
2b2f481
Compare
3d6394b to
7d39a7a
Compare
.github/workflows/sentry-release.yml
Outdated
| - name: Set commits | ||
| # Non-fatal — requires GitHub integration in Sentry | ||
| continue-on-error: true | ||
| run: npx "sentry@${VERSION}" release set-commits "sentry/${VERSION}" --auto --json |
There was a problem hiding this comment.
Will --auto work without a checkout?
There was a problem hiding this comment.
Yes — --auto uses the Sentry repo integration (server-side API). It sends refs: [{repository: "auto", commit: "auto"}] to the releases API, which tells Sentry to discover commits via the linked GitHub/GitLab integration. No local git repo or checkout needed.
63196c8 to
0cd2395
Compare
75af163 to
c3f2570
Compare
ce7aa44 to
5fa25d6
Compare
cb4c1e5 to
39a84fd
Compare
ab76555 to
125f3c3
Compare
e9892a5 to
35a46e3
Compare
6c9891b to
7050739
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| "Last Deploy", | ||
| `${release.lastDeploy.environment} (${formatRelativeTime(release.lastDeploy.dateFinished)})`, | ||
| ]); | ||
| } |
There was a problem hiding this comment.
Missing null guard on lastDeploy.dateFinished before formatting
Low Severity
release.lastDeploy.dateFinished is passed directly to formatRelativeTime without a truthiness check. The DeployResponse type allows dateFinished to be null (as seen in test fixtures). Both deploy.ts and deploys.ts in this same PR consistently guard with a ternary (d.dateFinished ? formatRelativeTime(d.dateFinished) : "—") before calling the formatter. Here, a null dateFinished produces "production (—)" — a dash wrapped in parentheses — which is an awkward display compared to the clean fallback used elsewhere.
Additional Locations (2)
d7b5c31 to
5b4c4bf
Compare
Add `sentry release` command group with 8 subcommands for full release lifecycle management, plus a CI post-release script for automated finalization. Commands: list, view, create, finalize, delete, deploy, set-commits, propose-version. Supports --auto (repo integration) and --local (git history) modes for commit association via simple-git. CI integration: script/finalize-release.ts runs in .craft.yml postReleaseCommand before version bump to create, set commits, finalize, and deploy releases automatically. Ref: #600
106e2a5 to
b530962
Compare


Summary
Adds the
sentry releasecommand group — the #1 critical gap identified in #600 — with 10 subcommands for full release lifecycle management, plus a GitHub Actions workflow for automated release finalization.Commands
release listrelease viewrelease create--project,--finalize,--ref,--url,--dry-runrelease finalizedateReleased(custom timestamp via--released),--dry-runrelease deletebuildDeleteCommand— auto--yes/--force/--dry-run, type-to-confirmrelease deploy<version> <environment> [name],--time,--dry-runrelease deploysrelease set-commits--auto,--local,--commit REPO@SHA(ranges:REPO@PREV..SHA),--clearrelease propose-versionreleases(alias)release listKey design decisions
buildDeleteCommandforrelease delete— auto-injects--yes/--force/--dry-runflags, non-interactive guard, usesconfirmByTypingfrom shared infrastructureDRY_RUN_FLAGoncreate,finalize,deploy— consistent--dry-run/-nsupport across all mutation commands--commitsupports ranges —REPO@PREV..SHAsends refs format to the API, matching the reference sentry-cliset-commitsdefault mode — tries auto-discovery, falls back to local git with warning. Per-org negative cache in themetadatatable (1-hour TTL) skips the speculative API call on subsequent runssimple-gitdependency —execFileSync(no shell) fromnode:child_processfor all git operations. Avoids shell injection and works natively in both Bun and Node distributions@sentry/apitypes — usesOrgReleaseResponseandDeployResponsedirectly from the SDK instead of redundant Zod schemassrc/lib/git.tsconsolidates primitives used by both release commands andsentry initwizard.src/lib/init/git.tsis now a thin adapterpropose-versionchecks 15 CI env vars (matching the reference impl) before falling back to git HEADCI integration
.github/workflows/sentry-release.yml— triggered onrelease: published, installs the just-published npm package vianpm install -g sentry@$VERSION, then runs create → set-commits → finalize → deploy.Testing
parseReleaseArgandparseRemoteUrl(fast-check)globalThis.fetchmocking for all 11 exported API functionsNew files (35 changed, +3913 / -103)
src/lib/git.ts— centralized git helpers (execFileSync, no shell)src/lib/api/releases.ts— 11 API functionssrc/commands/release/— 10 command files + arg parser.github/workflows/sentry-release.yml— CI finalization workflowtest/— 10 test filesRef: #600