Repository navigation
ci: collect coverage on a nightly schedule only (off PR/merge_group) - #2402
Conversation
Drop --coverage from the backend and frontend jest runs on pull_request / merge_group / push, and gate the coverage-report upload to the scheduled event. A new nightly schedule (08:00 UTC ~ 01:00 PT) runs the full job with --coverage and uploads the report. The required check keeps its exact name, "Test & Coverage", so branch protection is untouched. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L
lilyshen0722
left a comment
There was a problem hiding this comment.
Unasked review — unreviewed, and it changes the job whose green tick I cite as evidence in every gate verdict, so I checked it rather than assume. No GATE: line; no gate was requested.
I checked the thing that would have made this dangerous, and it is clean. Dropping --coverage on pull_request/merge_group would silently retire a gate if a coverage floor existed. There is no coverageThreshold in backend/jest.config.js, frontend/jest.config.js, either package.json, or anywhere under backend//frontend/ outside node_modules. So coverage was informational, and this removes no enforcement from any PR.
And nothing downstream consumed the report. The only coverage reference across .github/workflows/*.yml is this workflow's own upload step, which the diff gates to schedule. No other job or workflow reads the artifact.
The nightly is real rather than a no-op. There is no job-level if: anywhere in the file, so a schedule event runs the test job through the same steps with --coverage and reaches the now-conditional upload. (Worth having checked: a coverage move that collects coverage nowhere would look exactly like this diff.)
One consequence worth deciding deliberately, because the obvious remedy is worse than the status quo.
The job is name: Test & Coverage (:53). After this, on every PR and merge-queue run, that job runs no coverage — so the check name asserts something it no longer does. That matters a little more than cosmetics here: it is the string every reviewer (me included) quotes as evidence that a head is tested, and the AX audit exists for names that teach a reader a false model.
The trap is in the fix: that string is also the required-check context branch protection matches. Renaming the job alone would stop the required context from ever reporting, and every PR would sit at BLOCKED on a check that no longer exists under that name. So the options are to leave the name as a historical label, or rename and update branch protection in the same change — not rename alone.
Related and not a defect, just worth stating so nobody later assumes otherwise: a nightly coverage regression blocks nothing and notifies, at most, whoever last edited the cron. That is consistent with there being no threshold — coverage here is a report, not a gate — but it does mean "coverage is collected" stops implying "coverage is watched".
No defect in the change itself.
lilyshen0722
left a comment
There was a problem hiding this comment.
The full one-file merge-base diff preserves all prior triggers, job conditions, test steps, permissions and concurrency settings; the sole added trigger is schedule 0 8 * * *. The required job name remains exactly Test & Coverage. Backend and frontend Jest keep their complete discovery with no path filters: only schedule adds --coverage. PR, merge_group, push and workflow_dispatch omit it. Frontend node --test checks, MCP, CLI, hosted-runtime and real-DB service testing remain unchanged. The existing backend coverage artifact upload is schedule-only.
Independent verification: parsed workflow structure against merge base 6b828f9 and executed the actual changed shell blocks for all five event values with command-recording npx/node stubs: 10/10 branches produce the exact prior commands, minus coverage on the four non-schedule events. Other jobs and steps compare equal to the merge base. This verifies command routing, not a live scheduled Actions run or a rerun of application tests. Initial harness comparison against current main caught an unrelated later chart-check addition; corrected to the merge base. One invocation from the archive directory lacked git context and was corrected before the clean probe.
Full diff read; diff check clean. Current main inspected at be32f10; this head remains exact. No blocking defect found.
Written by Rhea — https://commonly.me/pods/6a8f6dc7a1dccf2e02f31015
Written by Rhea, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015
GATE: PASS
What
Coverage now runs on a nightly schedule only.
tests.ymlgains ascheduletrigger (0 8 * * *, ~01:00 PT).--coverageonly whengithub.event_name == 'schedule'; otherwise they run without it.Upload coverage reportstep is gated to the scheduled event.The required check keeps its exact name,
Test & Coverage, so branch protection is untouched. This is the small, standalone coverage move from WS3 — independent of the largertests.ymlsplit (path filters, shards, aggregator) that ci-doctor takes Sat.Why
CI speed-up (sprint WS3).
--coverageinstrumentation ran on every pull_request and merge_group commit for a report nobody reads on the PR.Done when
--coverage.coverage-report.No deploy impact — CI config only. Gate: Rhea. Cleared to merge Thu per WS3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L