CI phase 5: stricter eslint, design system integrity check, PR screenshots #56

Merged
jared merged 1 commits from ci-phase5 into main 2026-11-22 20:12:54 -05:00
Owner

Finishes #45 phase 5.

Stricter eslint (npm run lint now uses --max-warnings 0)

These are now errors: ==, unused or shadowed variables, eval/new Function/implied eval, prefer-const, curly (multi-line), throwing literals, useless catch or escape, constant conditions (loops allowed), and unused expressions (short-circuits allowed).

I measured each rule first and left out the ones that would mostly be noise:

  • no-var: older browser code;
  • no-await-in-loop: the loops are deliberately sequential;
  • no-console: server logging;
  • require-await.

The fixes needed:

  • server.js had two unused requires (vm, cron-parser); lib/utils.js keeps using both.
  • A test mock shadowed the test helpers' names.

Design system integrity (in the Scan job)

scripts/ci/check-web-template.sh fetches upstream base.css and base.js at the commit in public/web_template/VERSION and fails if Pulse's copy differs at all. It passes on today's copy and fails after a one-line local edit. The README now says to change the design system upstream and vendor it with scripts/sync-web-template.sh.

UI screenshots (before/after), PRs only, not required

When a PR touches public/, views/, lib/render.js or lib/nav.js, the job:

  1. starts the base branch (port 8401) and the PR (port 8400), each with its own database and the same seeded data;
  2. captures all 6 pages on desktop and on a Pixel 7;
  3. uploads a ui-screenshots artifact with one side-by-side image per page (rendered in the browser, so no image tooling is needed);
  4. lists pages that came out byte-identical in unchanged.txt.

It uses reducedMotion rather than injected CSS, because Pulse's CSP correctly blocks inline styles. I tested it locally with main against this branch: 12 comparisons were produced, 4 of them identical. This PR doesn't touch UI files, so the job will skip here; its first real run will be the next UI PR.

Locally: lint is clean, jest 83/83, integration 21/21, Playwright 32/32, actionlint is clean.

🤖 Generated with Claude Code

Finishes #45 phase 5. ## Stricter eslint (`npm run lint` now uses `--max-warnings 0`) These are now errors: `==`, unused or shadowed variables, `eval`/`new Function`/implied eval, `prefer-const`, `curly` (multi-line), throwing literals, useless catch or escape, constant conditions (loops allowed), and unused expressions (short-circuits allowed). I measured each rule first and left out the ones that would mostly be noise: - `no-var`: older browser code; - `no-await-in-loop`: the loops are deliberately sequential; - `no-console`: server logging; - `require-await`. The fixes needed: - `server.js` had two unused `require`s (`vm`, `cron-parser`); `lib/utils.js` keeps using both. - A test mock shadowed the test helpers' names. ## Design system integrity (in the Scan job) `scripts/ci/check-web-template.sh` fetches upstream `base.css` and `base.js` at the commit in `public/web_template/VERSION` and fails if Pulse's copy differs at all. It passes on today's copy and fails after a one-line local edit. The README now says to change the design system upstream and vendor it with `scripts/sync-web-template.sh`. ## UI screenshots (before/after), PRs only, not required When a PR touches `public/`, `views/`, `lib/render.js` or `lib/nav.js`, the job: 1. starts the base branch (port 8401) and the PR (port 8400), each with its own database and the same seeded data; 2. captures all 6 pages on desktop and on a Pixel 7; 3. uploads a `ui-screenshots` artifact with one side-by-side image per page (rendered in the browser, so no image tooling is needed); 4. lists pages that came out byte-identical in `unchanged.txt`. It uses `reducedMotion` rather than injected CSS, because Pulse's CSP correctly blocks inline styles. I tested it locally with `main` against this branch: 12 comparisons were produced, 4 of them identical. This PR doesn't touch UI files, so the job will skip here; its first real run will be the next UI PR. Locally: lint is clean, jest 83/83, integration 21/21, Playwright 32/32, actionlint is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-22 20:04:18 -05:00
CI phase 5: stricter eslint, design system integrity check, PR screenshots
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (push) Successful in 42s
CI / Test (jest) (push) Successful in 45s
CI / Integration (api) (push) Successful in 2m21s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m35s
CI / Lint (eslint) (push) Successful in 20s
CI / Lint (eslint) (pull_request) Successful in 14s
CI / Test (jest) (pull_request) Successful in 24s
CI / Security (npm audit) (pull_request) Successful in 25s
CI / UI (playwright) (push) Successful in 2m20s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped
CI / Integration (api) (pull_request) Successful in 1m45s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m1s
CI / UI screenshots (before/after) (pull_request) Successful in 13s
CI / UI (playwright) (pull_request) Successful in 1m52s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
74eb525413
- eslint: errors for ==, unused or shadowed variables, eval and friends,
  prefer-const, curly, throw literals, useless catch/escape, constant
  conditions (loops allowed), unused expressions (short-circuit allowed);
  --max-warnings 0. Fixed the few violations (two unused requires in
  server.js, a shadowed mock argument in a test).
- Scan job: scripts/ci/check-web-template.sh fails if public/web_template
  differs from upstream at the commit in its VERSION (change it upstream,
  then scripts/sync-web-template.sh).
- New job UI screenshots (before/after), PRs only, when public/, views/
  or the render/nav code changed: runs the base branch and the PR side by
  side with the same seeded data and uploads one before/after image per
  page, desktop and phone (scripts/ci/screenshots.js). Not required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared merged commit 57a6cf72ce into main 2026-11-22 20:12:54 -05:00
jared deleted branch ci-phase5 2026-11-22 20:12:57 -05:00
Sign in to join this conversation.