[STU-164] Enforce CI/CD quality gates in CLAUDE.md#38
Conversation
STU-164: 5 open PRs had failing CI due to missing pre-push verification. Add gate rule requiring tsc, build, and validate to pass locally before push. Add stale cache and lint-staged hazard warnings. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughCLAUDE.md is updated with expanded CI/CD enforcement guidance in the PR process section. The change replaces a minimal workflow with detailed pre-push validation requirements, including specific commands, a gate rule against pushing failed builds, and operational warnings about artifact cleanup and working tree consistency. ChangesCI/CD Enforcement Process Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CLAUDE.md`:
- Around line 54-71: Update the Gate rule to include linting and use the
project's script names consistently: replace the raw `tsc --noEmit` step with
`npm run test:types`, and add `npm run lint` to the mandatory pre-push checklist
alongside `npm run build` and `npm run test:validate`; ensure the Gate rule text
and the example command block list these four checks (`npm run test:types`, `npm
run build`, `npm run lint`, `npm run test:validate`) so pushes that pass the
gate cannot fail CI due to linting mismatches.
- Around line 64-65: The docs currently show running "npm run dev &" then
immediately "npm run test:validate", which races with the server startup; update
the example to start the dev server in the background, wait deterministically
for port 3000 (e.g., a small loop polling http://localhost:3000 or using a
wait-for utility until it responds), run "npm run test:validate" only after the
readiness check succeeds, and finally clean up by killing the background dev
server process (capture the background PID and use kill). Mention both the
readiness check and PID cleanup in the CLAUDE.md snippet.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0830d0e0-6cde-44e0-a2d3-a86fbf2fc986
📒 Files selected for processing (1)
CLAUDE.md
| **Every branch pushed to origin must pass the full CI pipeline.** Pushing code that fails CI wastes reviewer time and blocks the board. These checks run on every PR and must be verified locally before pushing: | ||
|
|
||
| ```bash | ||
| # 1. TypeScript — zero errors required | ||
| npx tsc --noEmit | ||
|
|
||
| # 2. Build — must compile cleanly | ||
| npm run build | ||
|
|
||
| # 3. Validation — requires dev server on port 3000 | ||
| npm run dev & # start dev server, then: | ||
| npm run test:validate | ||
|
|
||
| # Or run all three together: | ||
| npm run test:all | ||
| ``` | ||
|
|
||
| **Gate rule:** If any of `tsc --noEmit`, `npm run build`, or `npm run test:validate` fails locally, do NOT push. Fix the failures first. Only push when all three pass. |
There was a problem hiding this comment.
Align the hard gate with lint and project script conventions.
The “Gate rule” currently enforces only typecheck/build/validate, but Line 81 still requires lint before pushing. This mismatch can let “gate-passing” pushes fail CI on lint. Please include lint in the mandatory gate list (and preferably use npm run test:types consistently with the rest of this doc).
Suggested doc patch
# 1. TypeScript — zero errors required
-npx tsc --noEmit
+npm run test:types
+
+# 2. Lint — zero errors required
+npm run lint
-# 2. Build — must compile cleanly
+# 3. Build — must compile cleanly
npm run build
-# 3. Validation — requires dev server on port 3000
+# 4. Validation — requires dev server on port 3000
npm run dev & # start dev server, then:
npm run test:validate
@@
-**Gate rule:** If any of `tsc --noEmit`, `npm run build`, or `npm run test:validate` fails locally, do NOT push. Fix the failures first. Only push when all three pass.
+**Gate rule:** If any of `npm run test:types`, `npm run lint`, `npm run build`, or `npm run test:validate` fails locally, do NOT push. Fix the failures first. Only push when all four pass.Based on learnings: "Run npm run build before pushing — project must compile cleanly".
Also applies to: 81-81
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CLAUDE.md` around lines 54 - 71, Update the Gate rule to include linting and
use the project's script names consistently: replace the raw `tsc --noEmit` step
with `npm run test:types`, and add `npm run lint` to the mandatory pre-push
checklist alongside `npm run build` and `npm run test:validate`; ensure the Gate
rule text and the example command block list these four checks (`npm run
test:types`, `npm run build`, `npm run lint`, `npm run test:validate`) so pushes
that pass the gate cannot fail CI due to linting mismatches.
| npm run dev & # start dev server, then: | ||
| npm run test:validate |
There was a problem hiding this comment.
Make the validation example deterministic to avoid flaky false failures.
npm run dev & followed immediately by npm run test:validate can race before port 3000 is ready. Add an explicit readiness wait (and cleanup) in the documented snippet.
Suggested doc patch
-# 3. Validation — requires dev server on port 3000
-npm run dev & # start dev server, then:
-npm run test:validate
+# 3. Validation — requires dev server on port 3000
+npm run dev &
+DEV_PID=$!
+until curl -fsS http://localhost:3000 >/dev/null; do sleep 1; done
+npm run test:validate
+kill $DEV_PID📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| npm run dev & # start dev server, then: | |
| npm run test:validate | |
| # 3. Validation — requires dev server on port 3000 | |
| npm run dev & | |
| DEV_PID=$! | |
| until curl -fsS http://localhost:3000 >/dev/null; do sleep 1; done | |
| npm run test:validate | |
| kill $DEV_PID |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CLAUDE.md` around lines 64 - 65, The docs currently show running "npm run dev
&" then immediately "npm run test:validate", which races with the server
startup; update the example to start the dev server in the background, wait
deterministically for port 3000 (e.g., a small loop polling
http://localhost:3000 or using a wait-for utility until it responds), run "npm
run test:validate" only after the readiness check succeeds, and finally clean up
by killing the background dev server process (capture the background PID and use
kill). Mention both the readiness check and PID cleanup in the CLAUDE.md
snippet.
Summary
npm run test:typesmust pass with zero errors.nextand PrismaRelated
Part of STU-164 — fixing failing CI checks on 5 open PRs and preventing future regressions.
Summary by CodeRabbit