feat(ci): add delta patch generation for stable releases#618
Conversation
Extract patch generation from publish-nightly into a shared generate-patches job that runs on both main and release/** branches. Old-binary source switches by branch: main fetches previous nightly from GHCR, release/** fetches previous stable release from GitHub Releases. Patches are uploaded as sentry-patches workflow artifact that craft picks up for stable releases. publish-nightly downloads the artifact and pushes to GHCR as before. On failure, an issue is filed automatically.
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
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 100.00%. Project has 1351 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.47% 95.46% -0.01%
==========================================
Files 204 204 —
Lines 29738 29738 —
Branches 0 0 —
==========================================
+ Hits 28389 28387 -2
- Misses 1349 1351 +2
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Artifact pattern inadvertently downloads patch files into binaries
- Changed artifact download pattern from 'sentry-*' to 'sentry-*64' to match only uncompressed binary artifacts, excluding sentry-patches and compressed artifacts.
Or push these changes by commenting:
@cursor push fbd8ded3e3
Preview (fbd8ded3e3)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -484,7 +484,7 @@
- name: Download uncompressed artifacts (for SHA-256 computation)
uses: actions/download-artifact@v8
with:
- pattern: sentry-*
+ pattern: sentry-*64
path: binaries
merge-multiple: trueThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
## Summary
- Restores `GH_TOKEN: ${{ github.token }}` env for all `gh` CLI steps in
`generate-patches` job
- Also restores it for the `eval-skill` fork check step that was
inadvertently removed in #618
`gh` CLI supports both `GH_TOKEN` and `GITHUB_TOKEN` as env vars, but
GitHub Actions does not automatically expose `GITHUB_TOKEN` as a shell
environment variable — it's only available in `${{ }}` expressions. The
token must be explicitly mapped via `env:` for `gh` to find it.
This fixes the `generate-patches` failure on `release/0.24.0`:
https://github.com/getsentry/cli/actions/runs/23875917691/job/69619096534


Summary
publish-nightlyinto a sharedgenerate-patchesjobmain(nightlies) andrelease/**(stable) branches, skips PRsmain→ previous nightly from GHCR,release/**→ previous stable release from GitHub Releasessentry-patchesworkflow artifact — craft picks these up for stable releases via the existing/^sentry-.*$/patternpublish-nightlyslimmed down: downloads pre-generated patches from the artifact and pushes to GHCR (no more inline bsdiff)continue-on-error: trueensures patch failures never block releases or nightliesMotivation
The client-side delta upgrade code (
src/lib/delta-upgrade.ts) expects.patchassets on GitHub Releases but no CI step was generating them for stable releases. Delta upgrades silently fell back to full binary download every time. This PR closes that gap while unifying the patch generation logic between both channels.