ci: make the frontend gates real, and fix the coverage script
The repo configured four frontend gates and enforced one of them. eslint
and prettier ran in no workflow and no hook; `bun run check` ran only in
build-release.yml, so a type error could sit on master until somebody cut
a tag; and `bun run test:coverage` had been dead for months.
CI (build-and-test.yml) now runs format:check, lint, check and coverage
alongside the existing boundary and doc-link tripwires.
The coverage script failure was a version mismatch, not a config problem:
@vitest/coverage-v8 resolved to 4.1.10, whose peer range pins vitest
exactly, while package.json asked for ">=1.0.0 <5.0.0" and got 4.0.16 --
every run died on a missing BaseCoverageProvider export. The loose range
is what allowed the pair to drift, so it is now ^4.1.10.
Two ratchets, same policy as MIN_THRESHOLD in traceability-check.yml:
eslint --max-warnings=159 (0 errors; 159 is today's backlog, only
ever lower it)
vitest thresholds (statements 51 / branches 45 /
functions 46 / lines 52, measured at
54.6 / 48.7 / 49.6 / 55.1)
no-console is promoted from "off" to "error": the logger-facade
migration it was waiting on is finished -- 8 calls remained, 2 of them
real stragglers in the settings page, now on the facade the file already
imported. The sink itself, tests, and scripts/ are exempted; a CLI whose
stdout is the product is not a stray debug statement.
The threshold was verified to bite by raising it to 99 and watching the
run go red, not by assuming an unfailed gate works.
DR-205 moves to Done; the coverage gate is DR-215.
This commit is contained in:
@@ -82,10 +82,38 @@ jobs:
|
||||
- name: Check documentation links
|
||||
run: bash scripts/check-doc-links.sh
|
||||
|
||||
# Formatting, linting and type-checking were all configured in this repo
|
||||
# and enforced by nothing: .prettierrc described a tree where 199 files did
|
||||
# not match it, eslint.config.js ran in no workflow and in no hook, and
|
||||
# `bun run check` ran only in build-release.yml — i.e. a type error could
|
||||
# sit on master until somebody cut a tag. These three steps are what make
|
||||
# those configs load-bearing. All are project deps installed by
|
||||
# `bun install`; nothing is fetched at job time.
|
||||
- name: Check formatting
|
||||
run: bun run format:check
|
||||
|
||||
# RATCHET — this number only ever goes DOWN. Same policy as MIN_THRESHOLD
|
||||
# in traceability-check.yml and the coverage thresholds in
|
||||
# vitest.config.ts. 159 is what the tree carried when the gate went in; the
|
||||
# backlog is real findings (dead bindings, unkeyed {#each}, `any` at the
|
||||
# IPC boundary) that eslint.config.js documents rule by rule, each parked
|
||||
# at "warn" until its class is cleared and it can be promoted to "error".
|
||||
# Lower this as you clear them. Never raise it to make a build pass.
|
||||
- name: Lint
|
||||
run: bun run lint -- --max-warnings=159
|
||||
|
||||
- name: Check TypeScript
|
||||
run: |
|
||||
bunx svelte-kit sync
|
||||
bun run check
|
||||
|
||||
# Coverage rather than a bare `bun run test`: same suite, plus the
|
||||
# thresholds in vitest.config.ts, so a large untested module or a deleted
|
||||
# test fails here instead of being noticed months later.
|
||||
- name: Run frontend tests
|
||||
run: |
|
||||
bunx svelte-kit sync
|
||||
bun run test
|
||||
bun run test:coverage
|
||||
|
||||
# CLAUDE.md has required `cargo fmt` + `cargo clippy` before every commit
|
||||
# for as long as the rule has existed, but nothing in CI checked either,
|
||||
|
||||
Reference in New Issue
Block a user