Skip to content

Commit 8288dcb

Browse files
committed
feat(lighthouse-ci): render report as Job Summary; sync APPS list to matrix
Two changes to make Lighthouse data visible on every run, regardless of trigger: 1. Always write the report markdown to `$GITHUB_STEP_SUMMARY` via `core.summary.addRaw().write()`. The Job Summary renders as a styled panel at the top of the workflow run page \u2014 visible for PR runs, nightly runs, and manual dispatches alike. For PR runs the existing PR comment is still posted/updated; for nightly runs the Job Summary becomes the only output (was previously just `console.log` to the workflow log, which nobody reads). 2. Trim the hardcoded APPS list from 9 entries down to 2 (default-browser, nextjs-16). Only those two apps actually branch on `SENTRY_LIGHTHOUSE_MODE` today \u2014 the other seven were carried over from the original planner output but were never instrumented. With the stale 9-entry list, the matrix only produced 6 of 27 expected cells, tripping the 50%-fill safety check on every run and skipping the report entirely. The MEDIUM-severity bugbot finding called this out. When more apps gain `SENTRY_LIGHTHOUSE_MODE` support (tracked in TODO-aeab11f0), add them to both APPS arrays at the same time.
1 parent 760b128 commit 8288dcb

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

dev-packages/lighthouse-tests/post-comment.mjs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,13 @@ const MODES = ['no-sentry', 'init-only', 'tracing-replay'];
1111
* Apps and their human-readable SDK labels, matching lighthouse-matrix.mjs.
1212
* Order here determines row order in each table.
1313
*/
14-
// Must mirror lighthouse-matrix.mjs APPS. angular, remix, ember, solidstart,
15-
// and react-router-7-spa are intentionally excluded — see note in
16-
// lighthouse-matrix.mjs.
14+
// Must mirror the APPS array in lighthouse-matrix.mjs. Only apps whose Sentry init
15+
// code actually branches on SENTRY_LIGHTHOUSE_MODE are listed here — listing
16+
// uninstrumented apps would dilute the 50%-fill safety check below and produce
17+
// meaningless Δ columns. See lighthouse-matrix.mjs for the full rationale.
1718
const APPS = [
1819
{ app: 'default-browser', sdk: 'browser' },
19-
{ app: 'react-19', sdk: 'react' },
20-
{ app: 'vue-3', sdk: 'vue' },
21-
{ app: 'svelte-5', sdk: 'svelte' },
22-
{ app: 'sveltekit-2', sdk: 'sveltekit' },
23-
{ app: 'astro-5', sdk: 'astro' },
24-
{ app: 'tanstackstart-react', sdk: 'tanstack-start' },
2520
{ app: 'nextjs-16', sdk: 'nextjs' },
26-
{ app: 'nuxt-5', sdk: 'nuxt' },
2721
];
2822

2923
/**
@@ -150,10 +144,14 @@ async function run() {
150144

151145
const body = `${HEADING}\n\n${tables}${footer}`;
152146

147+
// Always render the report as a GitHub Actions Job Summary so it's visible on the
148+
// workflow run page for every trigger (PR, nightly, dispatch). For PR runs we also
149+
// post/update a sticky comment on the PR below.
150+
await core.summary.addRaw(body).write();
151+
core.info('Wrote Lighthouse report to Job Summary.');
152+
153153
if (!isPR || !prNumber) {
154-
// Nightly / non-PR: log to stdout (captured in workflow logs)
155-
// eslint-disable-next-line no-console
156-
console.log(body);
154+
// Nightly / non-PR: Job Summary above is the only output. Nothing to post.
157155
return;
158156
}
159157

0 commit comments

Comments
 (0)