ci: gate PRs on the dashboard Vitest suite#274
Conversation
The `test` and `coverage` jobs only build the SPA (`rake frontend:build` = tsc + vite); they never run the committed Vitest suite, so a frontend regression that typechecks clean (e.g. the #272 /dead null-render) ships unblocked. Add a dedicated Node-only `frontend (vitest)` job that runs the existing suite (4 files / 25 tests) on every PR. Runs unconditionally (no `frontend/**` path filter) so the check is safe to mark required without the "Expected - waiting" trap on backend-only PRs. Closes #273. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedAn error occurred during the review process. Please try again later. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds a ChangesFrontend Vitest CI job
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
📊 Benchmark vs base
Regression is flagged when the slowdown exceeds both runs' combined ± noise plus 5.0% (tune via |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai approve |
✅ Action performedComments resolved and changes approved. |
What
Add a dedicated
frontend (vitest)CI job so the dashboard's existing Vitest suite gates PRs. Closes #273.Why
frontend/package.jsondefinestest: vitest runwith 4 committed suites (25 tests), but no workflow runs them — CI only builds the SPA viarake frontend:build(tsc + vite).tsccan typecheck clean while the app null-renders at runtime (exactly how #272's/deadwhite-screen shipped), so the build step is not a regression gate. Frontend regressions currently merge unblocked.Changes
.github/workflows/test.yml: newfrontend (vitest)job, sibling totest/parity/coverage. Node-only (no Ruby/Redis):blacksmith-4vcpu-ubuntu-2404,timeout-minutes: 10, pinnedactions/setup-node@v6(node 24, npm cache onfrontend/package-lock.json),npm ci+npm run testinfrontend/. Inherits the workflow-levelconcurrencygroup andcontents: readpermissions.Notes / decisions
frontend/**path filter). A path-filtered required check hangs "Expected — waiting for status" on backend-only PRs and blocks merge forever (a known GitHub trap). The job is ~2s and the existingtestjob already runs the full node/vite toolchain on every PR, so an always-on run is consistent and negligible. Deliberate deviation from the issue's "gated on frontend/**" wording./deadnull-error_classregression test is red on currentmain(it only goes green once Dashboard /dead (and /search) white-screens on dead jobs with null error_class/error_message (kill/migration path) #272'struncateguard + serializer normalize land), so adding it here would block the gate. It rides with Dashboard /dead (and /search) white-screens on dead jobs with null error_class/error_message (kill/migration path) #272 as one atomic red->green change. The CI never runs the frontend vitest suite (no gate on dashboard JS regressions) #273 acceptance criterion "the /dead null case is covered by a test that runs in CI" closes jointly: this PR builds the gate, Dashboard /dead (and /search) white-screens on dead jobs with null error_class/error_message (kill/migration path) #272 delivers the test the gate runs.Verification
cd frontend && npm ci && npm run test-> 4 files / 25 tests pass (~2.3s, node 24).actionlint .github/workflows/test.ymlreports only the pre-existingblacksmith-4vcpu-ubuntu-2404unknown-label warning (identical on the existingtest/parity/coveragejobs — actionlint doesn't know Blacksmith's custom runner label; it resolves on the real runner). No other findings. Additive change — existing Ruby gates and the requiredtest (x, y)contexts are unaffected.Post-merge (admin, ordering-sensitive)
After the
frontend (vitest)job reports green once, addfrontend (vitest)tomainbranch-protection required status checks. Do NOT register it before it has reported at least once, or open PRs will hang on a phantom required check.Summary by CodeRabbit