ci: run web typecheck and tests on web-only PRs - #475
Conversation
- Add apps/web/**, root package.json, pnpm-workspace.yaml, the workflow and the matrix script to the pull_request paths filter - Emit a dedicated_jobs output from ci-test-matrix.mjs that is false only when every change is confined to apps/web (or inert paths) - Gate api-tests, ai-facade-tests and ai-py-facade-tests on it so web-only PRs run just the package (web) matrix entry
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe CI matrix script now emits a ChangesDedicated CI job gating
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
KIvanow
left a comment
There was a problem hiding this comment.
Good, tightly-scoped fix for a real gap - web-only PRs weren't running any web typecheck or tests, and since web was already a matrix entry this is just wiring the trigger. Approving.
The part I specifically checked: gating api-tests / ai-facade-tests / ai-py-facade-tests with job-level if: + needs: test-matrix rather than a workflow-level paths skip is the right call. Skipped jobs report a "skipped" conclusion that branch protection counts as passing, so a web-only PR won't hang on a required check that never reports. That's the trap this avoids, and it's easy to get wrong. The dedicated_jobs boolean also coerces to the "true"/"false" strings the == 'true' gate expects.
One tiny non-blocking note: dedicatedJobs comes from [...selected].some(...), which is false for an empty selected - so an empty set would skip the dedicated jobs while also running no node suites. It looks unreachable (the else branch requires non-empty direct, and withDependents includes it), but an explicit selected.size === 0 guard would document that assumption. Fine to leave.
Nice touch adding the workflow and matrix script to the paths filter so CI changes exercise themselves.
Problem
api-tests.ymlonly triggers onapps/api/**,packages/**,proprietary/**andpnpm-lock.yaml. A PR that touches onlyapps/web/**(e.g. #472) runs no web typecheck and no web tests — only CLA / Constants Guard / bot reviews.webis already a matrix entry inscripts/ci-test-matrix.mjs(package (web)runspnpm build --filter web...→tsc && vite build, thenvitest run), so the gap is just the trigger.Change
apps/web/**, pluspackage.json,pnpm-workspace.yaml, the workflow itself andscripts/ci-test-matrix.mjs(CI changes previously didn't run CI).dedicated_jobsoutput from the matrix script:falseonly when every changed file lives inapps/web(or inert docs/.mdpaths).api-tests,ai-facade-tests,ai-py-facade-testsnowneeds: test-matrixand are gated on it, so web-only PRs don't pay for the full API suite.Coverage is unchanged for everything else: any change touching api, packages, proprietary, or a root file still runs all dedicated jobs, and
workflow_dispatchstill runs everything. I deliberately did not gateapi-testson the workspace dependency graph, since api reaches intoproprietary/*without declaring it as a workspace dependency.Verification
tsc --noEmitclean,vitest run82 files / 676 tests pass.apps/web/...apps/web/...+docs/x.mdapps/web/...+apps/api/...packages/shared/...proprietary/entitlement/...package.jsonThis PR itself touches the workflow + script, so it runs the full suite.
🤖 Generated with Claude Code
Note
Low Risk
CI trigger and job gating only; no application runtime, auth, or data-path changes.
Overview
Extends the API Tests workflow so PRs that only touch
apps/webactually run CI (typecheck/build/vitest via the existing matrix), and stops paying for API/AI dedicated jobs on those PRs.The workflow path filter now includes
apps/web/**, root workspace manifests (package.json,pnpm-workspace.yaml), and changes to the workflow orscripts/ci-test-matrix.mjsso CI edits and web-only changes trigger the pipeline.ci-test-matrix.mjsemits a newdedicated_jobsflag: it isfalsewhen the diff-selected suites are confined to isolated apps (currentlyweb); otherwise it staystrue(including “run everything” when there is no PR base or a change outside any package).api-tests,ai-facade-tests, andai-py-facade-testsnow depend ontest-matrixand run only whendedicated_jobs == 'true', while matrixpackage-testsstill run forwebon web-only changes.Reviewed by Cursor Bugbot for commit bd47753. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit