This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Repository navigation
ci: Track release pipeline failures and stuck releases in an issue - #138
Merged
Merged
Conversation
Co-Authored-By: BYK <[email protected]>
sentry-junior
Bot
requested review from
BYK,
MathurAditya724 and
betegon
as code owners
November 9, 2026 16:43
BYK
approved these changes
Nov 9, 2026
2 tasks done
BYK
added a commit
that referenced
this pull request
Nov 9, 2026
… drop failed releases (#137) `@sentry/api` releases have gotten stuck in two ways. This PR changes Release, and the `Release pipeline health` workflow from #138, so neither needs a person to fix it. **Incident 1: commits stranded during a pending release.** The old job guard skipped every release merge. A commit that landed while a release was pending was never released until someone pushed again. In the last 40 release merges, 9 brought in commits like this. 83a2b74 is the latest. **Incident 2: a failed release blocked all later ones (11-07 to 11-09).** Release ran even when Build failed. It cut `release/1.52.0`, Build failed on that branch, and every later Release run failed with craft's `Release branch "release/1.52.0" already exists` until someone cleaned up by hand. ## Changes **Release** (`release.yml`): - Runs on `workflow_run` after Build succeeds on `main` (push builds from this repo only). It checks out that commit and puts a local `main` on it, because craft prepares from the default branch. - Drops the commit-message guard, so release merges run too. That run is what releases commits that landed while the previous release was pending. - `concurrency: { group: release, cancel-in-progress: false }`. - `workflow_dispatch` works as before and skips preflight. **`release-preflight.sh`** skips the three cases where `craft prepare` would fail: - A `release/*` branch exists: "release branch already exists". The merge of that release releases what's left. - The commit predates the newest tag, because Builds finished out of order: craft would cut that version again. - No commits since the last tag: "no commits found since the last release". **Release pipeline health** (`release-pipeline-health.yml`): - When Build fails on `release/**`, `drop-failed-release.sh` deletes the branch, using `--force-with-lease` on the failed commit. It then tries to close the getsentry/publish request with a "Superseded" comment. If the bot can't list or close that request, the job logs a warning and still succeeds, because the branch is already gone. If the branch is already gone or has moved since the failed Build (a rerun, or a new push), the job logs "nothing to drop" and passes (f62189b). The next push to `main` releases again. - Release-branch Build failures are reported to the pipeline issue too. - The issue closes only when a Release run's Prepare release step succeeds. A skipped run also finishes as a success, so it no longer closes an open alert. This needs `actions: read`. - Concurrency moved to the two jobs that write the issue, so a waiting branch drop can't be cancelled. ## Testing - **Preflight and drop script, under `dash`:** I used throwaway git remotes that mirror craft and publish (release branch, tag, merge), with `gh` stubbed. - The stranded commit (83a2b74 model) skips while 1.2.0 is pending, and is released by the merge commit's run. - Two syncs in order: A releases, B waits, and the merge releases B. - B's Build first: B covers both, A skips, and a late run for A skips. - A release merge with nothing new skips. - Incident 2: the fix's Release skips while the failed branch exists. After the drop, it releases both commits. - Drop edge cases: the branch moved, or it's already gone (the job logs "nothing to drop", passes, and leaves the branch and the request alone); no open request; the issue lookup or close fails (warning, branch still deleted). - **Pipeline issue:** with real Release run 42666230595, which prepared a release, the issue closes. With Prepare release skipped, it stays open. - **Live, read-only:** preflight on today's `main` skips because `release/1.56.0` is pending. - **craft:** earlier, `craft prepare --dry-run` (3.9.0) from this checkout shape would have cut `release/1.53.0` with 83a2b74. - `actionlint` and `shellcheck --shell=sh --enable=check-extra-masked-returns` pass. No UI changes, so no screenshots. ## For admins - `drop-failed-release` uses the release bot app (`SENTRY_RELEASE_BOT_*`). It needs to delete branches here, which it can already do since it pushes them. Closing getsentry/publish issues is optional: without triage access there, the job warns and the request stays open. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A3469a89d1b152f2e4ef70bbb981e697e --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/agent%3A3469a89d1b152f2e4ef70bbb981e697e/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From 11-07 to 11-09,
@sentry/apididn't release for 2 days and nobody noticed. Build was red onmain, and every Release run failed on the stalerelease/1.52.0branch, but nothing reported it. Releases can also get stuck with no failing run at all. 83a2b74, for example, landed while 1.52.0 was pending and sat unreleased.This PR adds a
Release pipeline healthworkflow. It keeps one issue, "Release pipeline failing on main", open while the pipeline is broken.Failure alerts.
main, the workflow opens the issue, or comments on it if it's already open.Recovery.
Daily staleness check. At 08:23 UTC, and on manual dispatch, the workflow reports to the same issue in either of these cases:
mainthat isn't in the newest npm release is more than 24h old. The newest npm release comes fromnpm view @sentry/api version, matched to its git tag. A missing tag is reported too.ci-failedfor more than 24h, counted from when the label was added.The first check measures how long a schema commit has been waiting. A commit that landed 1h after a long quiet stretch doesn't trigger it. A commit stranded a minute after a release, like 83a2b74, still does.
The workflow uses the default
GITHUB_TOKENwithcontents: readandissues: write. getsentry/publish is public, so that token can read its issues and their events. No new secrets, no Slack.Testing
I ran both scripts under
dash.Staleness check on real data:
mainis reported as up to date.Stubbed runs:
ci-failedrequest older than 24h is reported. A newer one, and requests for other repos, are not.npm, the issue list, or the events fetch fails, the run fails.actionlintandshellcheck --shell=sh --enable=check-extra-masked-returnspass.No UI changes, so no screenshots.
Notes
via @BYK.
--
View Session in Sentry