Commit df529c5
committed
feat(lighthouse-ci): bundle test apps and upload to lighthouse.sentry.gg lab
Replace the in-CI Lighthouse runs with a build-bundle-upload pipeline that
ships prebuilt test apps to the dedicated Sentry Lighthouse lab service
(https://lighthouse.sentry.gg). The lab runs Lighthouse on stable, dedicated
hardware — eliminating the measurement noise we hit on shared GitHub-hosted
runners — persists results, and ships every metric to Sentry under the
lighthouse.* namespace.
Companion to the spec at ~/Projects/sentry-lhci/docs/sentry-javascript-handoff.md.
Concretely:
- Rename dev-packages/lighthouse-tests/ to dev-packages/lighthouse-bundle/.
The directory's job is no longer 'tests' — it's bundle preparation.
- Delete the in-CI Lighthouse infrastructure: lighthouserc.cjs (lab owns
the LHCI config now), report.mjs (Job Summary moves into the new script),
and lighthouse-matrix.mjs (matrix is just a hardcoded constant in the
upload script — no GitHub Actions matrix expansion needed anymore).
- Add bundle-and-upload.mjs: zero-deps (Node 22 builtins only — fetch,
FormData, Blob, system tar). For each (app, mode) cell, copies the app
to a temp dir, applies the existing ci:pnpm-overrides helper, builds
with the right SENTRY_LIGHTHOUSE_MODE / NEXT_PUBLIC_SENTRY_LIGHTHOUSE_MODE
/ REACT_APP_SENTRY_LIGHTHOUSE_MODE env vars (every prefix set at once —
each app's bundler picks up whichever it knows), and tars the result.
Static cells (default-browser, react-19) bundle only their build/ dir.
SSR cell (nextjs-16) strips node_modules + pnpm-lock.yaml, copies the
packed SDK tgzs into ./packed/ inside the bundle, and rewrites every
workspace-absolute file: path in package.json (dependencies,
devDependencies, pnpm.overrides) to file:./packed/... so pnpm install
can resolve them after the lab extracts the tarball.
All 9 bundles are POSTed as one multipart request to /api/builds; the
script then polls /api/builds/:id every 15s for up to 25 minutes and
appends a markdown summary table to $GITHUB_STEP_SUMMARY with per-cell
status, median score, and Lighthouse-report links.
- Strip dependencies from dev-packages/lighthouse-bundle/package.json.
The script only needs Node builtins.
- Rewrite .github/workflows/lighthouse.yml. Two jobs:
* job_build — SDK build + tarball generation (unchanged).
* job_bundle_and_upload — single non-matrix job; runs the script after
restoring tarballs and seeding dev-packages/e2e-tests/packed/ via
yarn test:prepare. Per-cell parallelism gained nothing once Lighthouse
moved off the runner.
Requires two new repo secrets in getsentry/sentry-javascript:
- LIGHTHOUSE_LAB_URL (https://lighthouse.sentry.gg)
- LIGHTHOUSE_UPLOAD_TOKEN (mirror of the lab's Northflank UPLOAD_TOKEN)
Triggers: nightly cron at 00:00 UTC plus workflow_dispatch for ad-hoc runs.1 parent bb5ee63 commit df529c5
7 files changed
Lines changed: 374 additions & 413 deletions
File tree
- .github/workflows
- dev-packages
- lighthouse-bundle
- lighthouse-tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
14 | | - | |
15 | | - | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
32 | | - | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 71 | + | |
| 72 | + | |
75 | 73 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 74 | + | |
| 75 | + | |
85 | 76 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
91 | 81 | | |
92 | 82 | | |
| 83 | + | |
| 84 | + | |
93 | 85 | | |
94 | 86 | | |
95 | 87 | | |
| 88 | + | |
96 | 89 | | |
97 | 90 | | |
98 | 91 | | |
| 92 | + | |
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
102 | | - | |
| 96 | + | |
| 97 | + | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
| |||
111 | 106 | | |
112 | 107 | | |
113 | 108 | | |
114 | | - | |
| 109 | + | |
115 | 110 | | |
116 | 111 | | |
117 | 112 | | |
118 | 113 | | |
119 | 114 | | |
120 | 115 | | |
121 | 116 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
0 commit comments