Skip to content

ci: Keep one rolling PR on the newest @sentry/api release - #2291

Merged
BYK merged 4 commits into
mainfrom
ci/bump-sentry-api
Nov 16, 2026
Merged

BYK merged 4 commits into
mainfrom
ci/bump-sentry-api

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

@sentry/api now releases from getsentry/sentry static/packages/api as api@x.y.z. Nothing in this repo picks up new releases: there is no Renovate or Dependabot config, and the catalog still pins 2.0.0.

The new bump-sentry-api.yml workflow runs daily or on dispatch. It keeps one PR, on the fixed bot/bump-sentry-api branch, that pins the catalog to the newest npm release. That makes this repo the first outside consumer of each release. Part of getsentry/sentry#131204.

  • With no open bump PR, it opens one. When a newer release ships while that PR is open, it rebuilds the branch from main, force-pushes with --force-with-lease, and retitles the PR. It never opens a second PR, and does nothing when the PR already pins the latest release.
  • The branch is bot-owned. If anyone else has pushed a commit to it, the run leaves it alone and logs a warning, so a hand-made adapter fix isn't lost. Merge commits, such as from "Update branch", don't count (ea60d58).
  • The script updates the catalog entry, the matching minimumReleaseAgeExclude entry so a fresh release installs, and the lockfile. Nothing merges automatically.
  • The PR is opened with the release bot app that release.yml already uses, because PRs opened with github.token don't start other workflows. Open question: does that app's installation allow opening PRs here?
  • getsentry/sentry already has the same release bot credentials. ci(api): Dispatch the toolkit @sentry/api bump on each api@ release sentry#131244 dispatches this workflow from its bump-sentry-docs.yml on each api@ release and merges after this PR. The daily schedule stays as a fallback.
  • The first bump goes from 2.0.0 to the current latest, so that PR may need adapter fixes.

via @BYK.

--

View Session [Sentry]

getsentry/sentry releases @sentry/api from static/packages/api. A daily
workflow pins the catalog to the newest npm release and opens a PR, so
test.yml checks the CLI, MCP and shared packages against each release.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from BYK November 16, 2026 11:49
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 16, 2026 1:52pm UTC

Request Review

Comment thread scripts/bump-sentry-api.mjs Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread scripts/bump-sentry-api.mjs Resolved
Comment thread scripts/bump-sentry-api.mjs Resolved
run() trimmed execFileSync's result, which is null for the pnpm install
that inherits stdout, so every bump crashed before committing. Check
for an open bump PR first and leave it alone, so a daily run does not
force-push over adapter fixes pushed to it.

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A PR per upgrade is too noisy and we should be using workspace: definition for in-repo updates anyway.

A PR per release is noisy. The bump now keeps a single PR on the
bot/bump-sentry-api branch: it opens one when none is open, and when a
newer release ships it rebuilds the branch from main, force-pushes with
a lease and retitles the PR. A commit on the branch from anyone but the
bot makes it skip with a warning instead of overwriting the commit.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@sentry-junior sentry-junior Bot changed the title ci: Open a PR for each new @sentry/api release ci: Keep one rolling PR on the newest @sentry/api release Nov 16, 2026
@sentry-junior
sentry-junior Bot requested a review from BYK November 16, 2026 13:40

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use the token from the release.yml workflow's app?

@sentry-junior

sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

84d4d7a switches to one rolling PR on bot/bump-sentry-api. Each new release rebuilds that branch from main and force-pushes it with a lease, and the run never opens a second PR. It skips with a warning if someone else has pushed a commit to the branch.

@sentry-junior

sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@BYK It already does: bump-sentry-api.yml mints its token with the same vars.SENTRY_RELEASE_BOT_CLIENT_ID / secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY app as release.yml, through the same pinned create-github-app-token step. The only unknown is whether that app's installation has pull-request write access, which the first run will show.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 84d4d7a. Configure here.

Comment thread scripts/bump-sentry-api.mjs Resolved
Merging main into the bump branch, such as with GitHub's Update branch,
made the bump stop following new releases. The rebuild from main loses
nothing such a merge added, so only non-merge commits now count.

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BYK It already does: bump-sentry-api.yml mints its token with the same vars.SENTRY_RELEASE_BOT_CLIENT_ID / secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY app as release.yml, through the same pinned create-github-app-token step. The only unknown is whether that app's installation has pull-request write access, which the first run will show.

Then why can we not use cross-repo triggers both on sentry-docs and here from getsentry/sentry on every release of @sentry/api package?

@sentry-junior

sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@BYK We can, and the PR body was wrong to say it needs another app. getsentry/sentry already has the release bot's SENTRY_RELEASE_BOT_* creds (its bump-sentry-in-getsentry.yml uses them), so bump-sentry-docs.yml can get a second job that mints a toolkit-scoped actions: write token and runs gh workflow run bump-sentry-api.yml --repo getsentry/toolkit --ref main on each api@ release, next to the sentry-docs dispatch. That change is ready on getsentry/sentry's ci/api-dispatch-toolkit-bump branch, and it would merge after this PR, since the dispatch needs this workflow on toolkit's main. The daily schedule here stays as a fallback in case a dispatch fails.

@BYK

BYK commented Nov 16, 2026

Copy link
Copy Markdown
Member

The job triggers on releases from getsentry/sentry side should wait till the package is available on npm before triggering downstream jobs.

@BYK
BYK enabled auto-merge (squash) November 16, 2026 13:59
@sentry-junior
sentry-junior Bot requested a review from BYK November 16, 2026 14:00
@BYK
BYK merged commit 3bb34d3 into main Nov 16, 2026
41 checks passed
@BYK
BYK deleted the ci/bump-sentry-api branch November 16, 2026 14:03
@sentry-junior

sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Done in getsentry/sentry#131244 (a321c2d4). A new wait-for-npm job polls npm until it serves the api@ release's version, for up to about 10 minutes, and both the sentry-docs and toolkit dispatches run only after it passes.

BYK pushed a commit to getsentry/sentry that referenced this pull request Nov 16, 2026
…131244)

getsentry/toolkit#2291 added toolkit's `bump-sentry-api.yml`, which
keeps one PR on the newest `@sentry/api` release so toolkit's CI checks
the CLI and MCP packages against it (part of #131204). It runs on a
daily schedule. This change also dispatches it from
`bump-sentry-docs.yml` whenever an `api@` release is published, next to
the existing sentry-docs dispatch, so toolkit picks up each release as
it ships.

- The dispatches are one matrix job with an entry for sentry-docs and
one for toolkit. Each entry names the repo, the workflow file, the ref,
and the app that can dispatch there. The entries run in parallel without
fail-fast, so one failing doesn't cancel the other, and adding a
downstream repo is one more entry.
- sentry-docs keeps its existing app. The toolkit entry uses the release
bot app (`SENTRY_RELEASE_BOT_*`), which this repo's
`bump-sentry-in-getsentry.yml` and toolkit's own workflows already use,
scoped to getsentry/toolkit with `actions: write`.
- Both dispatches wait for a `wait-for-npm` job. It polls npm until it
serves the release's version, for up to about 10 minutes. Craft
publishes to npm before the GitHub release, but the registry can lag,
and a bump dispatched too early would still read the previous version.
- getsentry/toolkit#2291 has merged, so `bump-sentry-api.yml` now exists
on toolkit's `main`.
- Toolkit's daily schedule stays as a fallback.
- Open question: does the release bot's installation have `actions:
write` on toolkit? If it doesn't, the toolkit dispatch fails and the
daily schedule still picks the release up.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A69da19b385017e68b7f9eace56e9477f -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A69da19b385017e68b7f9eace56e9477f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A69da19b385017e68b7f9eace56e9477f/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — ea60d58f Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant