Repository navigation
ci: Run GitHub Actions jobs on Namespace runners - #25547
Conversation
|
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 da69d0e. Configure here.
da69d0e to
49a4020
Compare
nicohrubec
left a comment
There was a problem hiding this comment.
nice, did you check the wall time for full ci runs before/after?
| jobs: | ||
| stale: | ||
| runs-on: ubuntu-latest | ||
| runs-on: namespace-profile-sentry-javascript-small |
There was a problem hiding this comment.
q: do we have other profiles available than small/default/large? just wondering if we could tune this further for instance in cases where we have jobs that take a long time but don't necessarily have good parallelism so having more cores doesn't help
There was a problem hiding this comment.
Yes, those are custom. I created them manually and were already tuned by how much CPU/memory we use.
There was a problem hiding this comment.
ah so we can create custom profiles as we see fit or do we need to ask someone to do that for us?
There was a problem hiding this comment.
exactly.
You can do it yourself, after I add you to the account
Yes. Namespace: https://github.com/getsentry/sentry-javascript/actions?query=branch%3Ajp%2Fnamespace-arm64-runners+workflow%3A%22CI%3A+Build+%26+Test%22 The details of each run, can be viewed in the namespace dashbaord. There is a nice list of when a Job started, when it finished - that's great for optimizing in the future |
nicohrubec
left a comment
There was a problem hiding this comment.
let's see what it can do 🚤
Move all jobs to the Namespace profiles namespace-profile-sentry-javascript-small, namespace-profile-sentry-javascript and namespace-profile-sentry-javascript-large, by the CPU and memory that each job needs. The build.yml jobs share one cache volume through the cache tag sentry-javascript. Pull request jobs use sentry-javascript-pr, so a pull request cannot change the node_modules that develop and release builds install from. Keep node_modules, the pnpm store, the Playwright browsers and their apt packages on Namespace cache volumes instead of the GitHub cache. Every job runs pnpm install, which is a no-op when the volume matches pnpm-lock.yaml, so the dependency cache key is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49a4020 to
acc8012
Compare
| runs-on: | ||
| namespace-profile-sentry-javascript;overrides.cache-tag=sentry-javascript${{ github.event_name == 'pull_request' | ||
| && '-pr' || '' }} |
There was a problem hiding this comment.
Untrusted PRs can poison caches reused by secret-bearing CI
This expression gives every pull_request the same -pr cache tag, while merge_group jobs use the non-PR sentry-javascript tag. An untrusted run can alter the shared Playwright cache, then a later optional E2E job can reuse and execute the cached browser with E2E credentials.
Evidence
build.ymlaccepts bothpull_requestandmerge_group; this tag expression isolates neither merge-group runs from the main cache nor individual PRs from one another.job_buildchecks out the event commit and runs build commands after mounting the dependency cache.job_browser_playwright_testsuses the same tag, mounts the Playwright cache throughinstall-playwright, and runs code from the checkout.install-playwright/action.ymlmounts theplaywrightcache and runs Playwright installation, which downloads only browsers missing from the cache. A PR-controlled test can alter the mounted cache after installation.job_optional_e2e_testsuses the same cache-tag scheme, exposes E2E credentials, and installs and runs Playwright; it can therefore execute a browser persisted by another PR run. Merge-group runs also write to the cache used by trusted branch jobs.
Also found at 3 additional locations
.github/workflows/build.yml:1056-1058.github/workflows/build.yml:194-196.github/workflows/build.yml:69-71
Identified by Warden · security-review · 5UE-MCQ
This moves all GitHub Actions jobs to Namespace runners. It keeps node_modules, the pnpm store and the Playwright browsers on Namespace cache volumes instead of the GitHub cache, so every job runs
pnpm install --frozen-lockfileand there is no dependency cache key anymore.Runner decisions
Jobs use 3 profiles, sized from the CPU and memory peaks in
nsc instance report:-small(2 vCPU, 4 GB) for bots and checks, the default (4 vCPU, 8 GB) for E2E and light jobs,-large(8 vCPU, 16 GB) for build, lint and tests. One profile for all jobs is simpler, but slower or more expensive.Cache decisions
All
build.ymljobs share one cache volume throughcache-tag=sentry-javascript, for all branches (last write wins). Alternative: let onlydevelopwrite to it ("Protect caches from updates").