Repository navigation
ci(e2e): Only give secrets to E2E test apps that need them - #26869
Conversation
Every optional E2E job got all CI secrets, so PRs from forks ran no optional E2E tests at all. Only some of these test apps need secrets. A test app now sets `sentryTest.needsSecrets` if it needs CI secrets. The jobs of all other apps get no secrets and use the dummy DSN, so the optional ones also run on PRs from forks. The test apps that call a real LLM API are now required for PRs from this repository. PRs from forks, Dependabot PRs and release branches skip them.
size-limit report 📦Compared: 57f350a (PR test merge using develop at b06ca66) Against: b06ca66 (develop) · base run #67921 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 72 successful. See the run.
Successful checks
|
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d5c3143. Configure here.
|
Hmm, I feel like
should not be optional (generally speaking)? 🤔 |
andreiborza
left a comment
There was a problem hiding this comment.
Thanks for taking care of this 🙏
| matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-aws-layer) }} | ||
| steps: *e2e-steps | ||
|
|
||
| # PRs from forks and Dependabot get no secrets, so they skip these jobs. Release branches skip them too, so that an |
There was a problem hiding this comment.
not 100% sure, but would it also work to just continue two have two jobs (required/optional), and only pass in the secrets conditionally in the matrix? e.g.
E2E_OPENAI_DECISIONS_API_KEY: ${{ matrix.has-secret && ... || '' }}
and then have the build-matrix workflow take care of including/excluding things based on what is available for the given environment (so outputs.e2e-matrix and outputs.e2e-matrix-optional get stripped results based on fork or not)?
There was a problem hiding this comment.
That would work, and optional-e2e.yml already does it that way in this PR.
But I kept a separate job for the required tests so that the other (around 300) required jobs do not reference a secret at all. With matrix.needs-secrets && secrets.X || '' the env var is empty, but GitHub does not say whether the runner process could still receive the secret value. If it does, a malicious dependency can read it from the runner's memory 😬
This is a follow up I'm taking care of. They will be moved soon to be required (see #26845 (comment) - also Junior is already on it) |
What
An E2E test app now says if it needs CI secrets:
"sentryTest": { "needsSecrets": true }. Only the jobs of these apps get the secrets.What CI does for each
sentryTestsetting"needsSecrets": trueFork PRs: runs, blocks the merge
Fork PRs: skipped
"optional": trueFork PRs: runs, does not block, a failure is a red "(optional)" check
Fork PRs: skipped
optionalVariantsof an app count as optional. Dependabot PRs and release branches skip the jobs with secrets.Which tests are in each group
All apps and variants that are not in another cell
cloudflare-mastra,cloudflare-pi-durable,cloudflare-think,gen-ai-libraries,node-eve,node-flue,node-mastra,node-openai-decisions,node-pi-durableApps:
astro-7,hono-5,nuxt-5*,solidstart-2*,node-express-mcp-v*,node-fastify-6,cloudflare-agent,nextjs-14-supabase,react-router-7-framework-instrumentation,tanstackstart-react-cloudflare,tanstackstart-react-sourcemapsVariants:
* (bun),* (deno),* (cloudflare*)exceptgen-ai-libraries (cloudflare),nextjs-15 (latest),nextjs-15 (turbo),nextjs-16 (vinext*),nuxt-4-sourcemaps (Vite server),tanstackstart-react (latest),vinext-cf-workers (workers cache),vue-3 (no Options API),deno (latest)Apps:
*-send-to-sentry,debug-id-sourcemapsVariants of the required apps with secrets:
* (latest),node-eve (*),gen-ai-libraries (cloudflare),cloudflare-think (ai v6)Why
Every optional E2E job got all CI secrets, and external contributions did not run any of optional tests.
But most optional apps need no secrets: they test a prerelease of a framework or another runtime.
Notes for the review: