Post screenshots and Lighthouse scores on each merge request from GitLab CI #392

Closed
opened 2026-10-13 11:35:41 +00:00 by project_1_bot_05dcee5cd59f879ab35191d664847a9d · 4 comments
project_1_bot_05dcee5cd59f879ab35191d664847a9d commented 2026-10-13 11:35:41 +00:00 (Migrated from gitlab.core-project.space)

What to build

Bring back on GitLab the two review aids that GitHub's preview.yml gave every pull request and that the move to GitLab left out (infra/gitlab/DECISIONS.md, "Not ported"):

  • Screenshots: production ("before") and the merge request's review app ("after"), captured with the existing apps/e2e/screenshots suite (pnpm --filter @chess/e2e screenshots), shown side by side in one merge request note.
  • Lighthouse: / and /local, on mobile and desktop, audited against the review app with lighthouse@13.5.0, scores gathered into one merge request note.

Both stay informational: neither fails the pipeline nor blocks a merge.

How

  • Two jobs after review in infra/gitlab/vps/deploy.gitlab-ci.yml, skipped on docs-only merge requests like the other preview jobs.
  • PNGs and Lighthouse reports kept as job artifacts and linked by URL; no pr-screenshots-style branch, which the GitHub push mirror would carry.
  • One note per job (marker <!-- chess-screenshots -->, <!-- chess-lighthouse -->), created once and updated on each pipeline, through POST/PUT /projects/:id/merge_requests/:iid/notes.
  • The four audits run in one job, not a matrix: the single runner would queue four jobs anyway.
  • The note-writing step reads the artifacts as data and never runs the merge request's code with the token.

Prerequisite (owner)

A project access token mr-notes, role Reporter, scope api, stored as the masked CI/CD variable MR_NOTES_TOKEN: the job token cannot write notes.

Acceptance

  • A merge request touching apps/front gets a screenshots note with before/after images and a Lighthouse note with the 4 scores.
  • A second pipeline on the same merge request updates both notes instead of adding new ones.
  • A docs-only merge request gets neither job.
  • A failed capture or audit shows n/a in its cell and leaves the pipeline green.

Reference

GitHub's version: .github/workflows/preview.yml (jobs screenshots, screenshots-commit, lighthouse, lighthouse-report, lighthouse-comment), still in the repo though disabled.

## What to build Bring back on GitLab the two review aids that GitHub's `preview.yml` gave every pull request and that the move to GitLab left out (`infra/gitlab/DECISIONS.md`, "Not ported"): - **Screenshots**: production ("before") and the merge request's review app ("after"), captured with the existing `apps/e2e/screenshots` suite (`pnpm --filter @chess/e2e screenshots`), shown side by side in one merge request note. - **Lighthouse**: `/` and `/local`, on mobile and desktop, audited against the review app with `lighthouse@13.5.0`, scores gathered into one merge request note. Both stay informational: neither fails the pipeline nor blocks a merge. ## How - Two jobs after `review` in `infra/gitlab/vps/deploy.gitlab-ci.yml`, skipped on docs-only merge requests like the other preview jobs. - PNGs and Lighthouse reports kept as job artifacts and linked by URL; no `pr-screenshots`-style branch, which the GitHub push mirror would carry. - One note per job (marker `<!-- chess-screenshots -->`, `<!-- chess-lighthouse -->`), created once and updated on each pipeline, through `POST`/`PUT /projects/:id/merge_requests/:iid/notes`. - The four audits run in one job, not a matrix: the single runner would queue four jobs anyway. - The note-writing step reads the artifacts as data and never runs the merge request's code with the token. ## Prerequisite (owner) A project access token `mr-notes`, role Reporter, scope `api`, stored as the masked CI/CD variable `MR_NOTES_TOKEN`: the job token cannot write notes. ## Acceptance - [ ] A merge request touching `apps/front` gets a screenshots note with before/after images and a Lighthouse note with the 4 scores. - [ ] A second pipeline on the same merge request updates both notes instead of adding new ones. - [ ] A docs-only merge request gets neither job. - [ ] A failed capture or audit shows `n/a` in its cell and leaves the pipeline green. ## Reference GitHub's version: `.github/workflows/preview.yml` (jobs `screenshots`, `screenshots-commit`, `lighthouse`, `lighthouse-report`, `lighthouse-comment`), still in the repo though disabled.
project_1_bot_05dcee5cd59f879ab35191d664847a9d commented 2026-10-13 11:59:53 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 948e96c09d

mentioned in commit 948e96c09d0efa87d0a579867c8a42359c2370b1
project_1_bot_05dcee5cd59f879ab35191d664847a9d commented 2026-10-13 12:00:21 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !509

mentioned in merge request !509
project_1_bot_05dcee5cd59f879ab35191d664847a9d commented 2026-10-13 12:14:10 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !510

mentioned in merge request !510
root commented 2026-10-13 14:13:07 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 02444676dd

mentioned in commit 02444676dda3c65a0eed42cfdee3a2fc64be1d76
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-13 14:24:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amaurycoudr/chess-project#392
No description provided.