Skip to content

ci(frontend): add CI gate (lint/types/unit + Playwright functional tier) - #97

Merged
athvin merged 1 commit into
mainfrom
ci/frontend-gate
Oct 15, 2026
Merged

athvin merged 1 commit into
mainfrom
ci/frontend-gate

Conversation

@athvin

@athvin athvin commented Oct 15, 2026

Copy link
Copy Markdown
Owner

What

Adds .github/workflows/frontend.yml — the CI gate for the Next.js app under frontend/ — and
docs/parity-roadmap.md, the living tracker for the Cloudingo/DataGroomr feature-parity program.

Why

The backend (Rust) is gated by rust.yml, but the frontend only ran in CI's blind spot — it was
verified locally via make frontend and nothing else. That is the single biggest hole in the goal of
"build in dev, and when it merges to main it's known to work." This closes it.

How

Two parallel jobs mirror make frontend:

  • check (ubuntu-latest): pnpm check = eslint + prettier + tsc + vitest. No browser; fast.
  • e2e: the fast Playwright tier (mock-erserver + PGlite, all three device projects, including the
    @visual baselines). It runs inside mcr.microsoft.com/playwright:v1.63.0-jammy — the same image
    frontend/dev/update-baselines.sh renders the committed baselines in — so browsers are preinstalled and
    the visual snapshots compare against an identical font-rendering environment. pnpm build runs before
    pnpm test:e2e because under CI=true the Playwright webServer takes the next start branch.

The heavy full-stack tier (playwright.e2e.config.ts, real backend) stays out of CI. Action refs are
SHA-pinned with # vTAG comments per repo policy. Path-filtered to frontend/** so backend-only PRs don't
pay for it.

Verification

  • pnpm check run locally: eslint/prettier/tsc clean, 39/39 vitest tests pass.
  • actionlint clean on the new workflow; YAML validated.
  • The e2e/container job is validated by this PR's own CI run.

Does not break

Adds a new workflow + a doc only; no app, infra, or backend code touched. New required check is additive.

Follow-ups

Once green, this job should be added to main's required status checks (a GitHub setting). PR 0.2 adds
nightly coverage (cargo-llvm-cov + vitest --coverage).

The Rust backend is gated by rust.yml, but the Next.js frontend ran only
locally via `make frontend` — the biggest hole in "merge to main = it works".

Two parallel jobs mirror `make frontend`:
- check: eslint + prettier + tsc + vitest (no browser), fast.
- e2e:   the fast Playwright tier (mock-erserver + PGlite, 3 device projects,
         incl. @visual baselines) run INSIDE mcr.microsoft.com/playwright:
         v1.63.0-jammy, the same image dev/update-baselines.sh renders the
         committed baselines in, so snapshots compare in an identical font
         environment and browsers are preinstalled.

Also adds docs/parity-roadmap.md, the living tracker for the Cloudingo/
DataGroomr parity program.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@athvin
athvin merged commit 97c16d6 into main Oct 15, 2026
8 checks passed
@athvin
athvin deleted the ci/frontend-gate branch October 15, 2026 23:58
athvin added a commit that referenced this pull request Oct 20, 2026
…187)

* ci(frontend): make the gate blocking, and add the supply-chain half

The frontend has had a real CI workflow since #97, but it never gated
anything: branch protection on main requires four contexts and all four
are rust.yml's. `lint + types + unit` and `playwright functional tier`
ran and were then ignored at merge time. On top of that the `paths:`
filter meant #184, #185 and #186 did not run the frontend tier at all.

Making those jobs required needs the filter gone first: a workflow a
path filter skips never reports, so a required check would sit pending
forever on every backend-only PR. rust.yml already solved this for its
`.claude/**` skip — a `detect` job and an `if:` on each real job, since
a job skipped by `if:` reports "skipped", which branch protection
accepts. This mirrors that, filtering on `^frontend/` instead.

Then the half that was missing entirely. The Rust side runs cargo-deny
(advisories + licenses + bans) on every PR; the frontend ran nothing —
no `pnpm audit`, no license check, no SAST — and Dependabot covered only
`github-actions`, so npm dependencies were never bumped. The repo's own
notes flagged it (skills/security/references/secrets-iac.md: "Dependabot
does not cover cargo or npm").

Switching the gate on showed what that cost: 4 HIGH advisories, six of
them against `next` itself, including a HIGH SSRF in image optimization
fixed four patch releases earlier. So this also bumps next 16.3.6 →
16.3.8 (and the two eslint packages in lockstep), sharp → 0.35.5 and
source-map-js → 1.2.2, taking the tree from 4 high / 5 moderate / 1 low
to 1 high / 1 moderate. 16.3.8 rather than 16.4.2 deliberately: it is
the minimum that clears the advisories and stays inside the pinned
minor, which keeps the committed visual baselines in play.

The one remaining HIGH is allowlisted with its reasoning, following
deny.toml's convention of a prose justification per entry: [email protected]
is the newest published version and the advisory records no patched
release, it is reached only through @next/eslint-plugin-next at lint
time, and the only glob patterns it ever sees are our own eslint config.

New gates, each verified to fail as well as pass:

- `pnpm audit:check` — HIGH/CRITICAL fail, moderate and below reported.
  Reports stale allowlist entries so exceptions cannot accumulate.
- `pnpm licenses:check` — an allowlist, not a denylist, so an unseen
  license fails and gets looked at. deny.toml's 12 ids verbatim plus the
  npm tree's additions, each carrying why it is permissive enough.
- `pnpm authz:check` — every tenant route calls requireOrgAccess and
  every admin route requireSuperAdmin (54 handlers, all compliant).
  This was written as a semgrep rule first; semgrep rejected the pattern
  as invalid TypeScript while still reporting the rule as run with zero
  findings, so two deliberately unauthorized handlers passed. It is now
  code with tests that plant violations and require them to be caught.
- semgrep keeps the three sink rules confirmed to fire: HTML injection,
  dynamic eval, and NEXT_PUBLIC_* leakage.
- the `pnpm gen:api` drift gate frontend/README.md has claimed since #38
  but which never existed — the only related step was rust.yml's
  er-openapi-check, suffixed `|| true`.

Also restores the five `make frontend-*` targets dropped by 9a55504,
whose message says the frontend targets were retained. Their scripts
were never deleted, and frontend/dev/run.sh:97 has been calling
`make frontend-seed` since. `frontend-seed` itself is NOT restored: its
implementation went in 7cc444f with no replacement, which is why the
full-stack e2e tier is dormant.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(web): pin the GCM auth-tag length in the credential vault

The first run of the new semgrep gate found this
(javascript.node-crypto.security.gcm-no-tag-length), and it is a real if
modest hardening.

GCM accepts 4-16 byte authentication tags. `open()` slices the last
TAG_BYTES off the stored ciphertext, so a row whose ciphertext is
SHORTER than 16 bytes slices to a short tag — and without an explicit
authTagLength, Node accepts it. A short tag is correspondingly cheaper
to forge. The vault's whole premise is surviving someone who can write
the row (that is what the org+role AAD binding is for), so this is
exactly the threat model to care about.

Pinning authTagLength on both ends makes Node reject any tag that is not
16 bytes. The new test truncates a sealed ciphertext to 0/1/8/15 bytes
and requires each to throw.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants