Skip to content

ci(test): fall back to a placeholder SENTRY_CLIENT_ID for fork PRs - #1804

Merged
BYK merged 2 commits into
mainfrom
ci/fork-pr-sentry-client-id
Nov 2, 2026
Merged

BYK merged 2 commits into
mainfrom
ci/fork-pr-sentry-client-id

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Pull requests from forks always fail three Test jobs, sentry, NPM package (sentry) and CLI asset catalog (macOS arm64), plus the aggregate test job. The cause isn't the PR's code: vars.SENTRY_CLIENT_ID is empty on fork pull_request runs, so packages/cli/script/build.ts and bundle.ts exit with SENTRY_CLIENT_ID environment variable is required.

Evidence:

Change

  • In test.yml, SENTRY_CLIENT_ID now falls back to test-client-id in the three CLI build jobs. Local E2E and the CLI unit tests already use that placeholder. When the repository variable is set, it still wins.
  • test.yml uploads and publishes nothing, so the placeholder never ships. Release builds go through cli-build.yml, which this PR doesn't touch.
  • docs/operations/github-actions.md gets a short note on the fallback.

Verification

  • Locally, SENTRY_CLIENT_ID= pnpm --filter sentry run bundle reproduces the CI error. With SENTRY_CLIENT_ID=test-client-id, the bundle completes.
  • pnpm run lint and pnpm run docs:check pass.

After this merges, #1754 needs main merged in (or a new push) to pick up the workflow change.

via @BYK.

--

View Session in Sentry

Fork pull_request runs get an empty vars.SENTRY_CLIENT_ID, so the CLI
build and bundle scripts exit with "SENTRY_CLIENT_ID environment variable
is required". That fails the sentry, NPM package (sentry) and CLI asset
catalog jobs for every fork PR that touches the CLI's dependency graph.

Fall back to test-client-id, the placeholder Local E2E and the CLI tests
already use. test.yml publishes no artifacts, so the placeholder never
ships.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 2, 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 2, 2026 4:56pm UTC

Request Review

@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.

I thought this was already hard-coded in the code???

…uiring SENTRY_CLIENT_ID

src/lib/oauth.ts already has the public sentry.io client ID as the
default, but build.ts and bundle.ts exited when SENTRY_CLIENT_ID was
unset. Fork PR runs get an empty vars.SENTRY_CLIENT_ID, so every fork PR
that touched the CLI failed the sentry, NPM package (sentry) and CLI
asset catalog jobs.

Inject SENTRY_CLIENT_ID_BUILD only when SENTRY_CLIENT_ID is set, so
unset or empty builds use the committed default. This reverts the
test.yml placeholder from the previous commit, which would have baked
'test-client-id' over that default.
@sentry-junior

sentry-junior Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Yep, it is: src/lib/oauth.ts already falls back to the committed public sentry.io client ID. The CI breakage came from script/build.ts and script/bundle.ts, which exited whenever SENTRY_CLIENT_ID was unset, even though the runtime didn't need it.

fc354d3 removes those checks and injects SENTRY_CLIENT_ID_BUILD only when the variable is set, so unset or empty builds use the committed default. It also reverts the test.yml placeholder, which would have baked test-client-id over that default. I confirmed the default ID ends up in both the bundle and the binary when the variable is empty, and that an explicit override still wins.

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: low PR risk score: low labels Nov 2, 2026
@BYK
BYK merged commit 0954949 into main Nov 2, 2026
27 checks passed
@BYK
BYK deleted the ci/fork-pr-sentry-client-id branch November 2, 2026 19:11

This branch was successfully deployed

1 active deployment
Preview — fc354d3c Deployed Nov 2, 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