Skip to content

[STU-164] Enforce CI/CD quality gates in CLAUDE.md#38

Merged
BAWES merged 1 commit into
mainfrom
chore/STU-164-ci-enforcement
May 21, 2026
Merged

[STU-164] Enforce CI/CD quality gates in CLAUDE.md#38
BAWES merged 1 commit into
mainfrom
chore/STU-164-ci-enforcement

Conversation

@BAWES
Copy link
Copy Markdown
Owner

@BAWES BAWES commented May 21, 2026

Summary

  • Add CI/CD enforcement section to CLAUDE.md with gate rules
  • Pre-commit: npm run test:types must pass with zero errors
  • Pre-push: lint + types must pass
  • Pre-PR: full test suite must pass
  • Stale cache warnings for .next and Prisma
  • lint-staged hazard note about stash/pop and branch pollution

Related

Part of STU-164 — fixing failing CI checks on 5 open PRs and preventing future regressions.

Summary by CodeRabbit

  • Documentation
    • Updated development process guidelines with enhanced CI/CD enforcement checklist and mandatory pre-push validation requirements.

Review Change Stack

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studenthub-next Error Error May 21, 2026 9:03pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Walkthrough

CLAUDE.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.

Changes

CI/CD Enforcement Process Documentation

Layer / File(s) Summary
Pre-push CI/CD gates and warnings
CLAUDE.md
Pre-push validation checklist adds required commands (tsc --noEmit, npm run build, npm run test:validate), declares a rule to not push on failure, and warns about clearing .next directory, regenerating Prisma client, and ensuring clean working tree when switching branches.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • BAWES/studenthub-codex#34: Updates CLAUDE.md with process guardrails for contributors including CI/CD and git workflow rules.
  • BAWES/studenthub-codex#2: Updates CLAUDE.md to define CI/test gate commands (tsc --noEmit, npm run build, npm run test:validate) and PR validation workflow.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the Summary and Related sections adequately, outlining the key changes and linking to the issue. However, it lacks critical template sections like Type, Checklist, Test Plan, and Screenshots. Complete the missing template sections, particularly the Type checkbox (likely 'Documentation' or 'CI / tooling') and the Checklist to verify compliance with CLAUDE.md standards.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main change: adding CI/CD quality gate enforcement to CLAUDE.md, which aligns with the raw summary and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/STU-164-ci-enforcement

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e060590 and 81d4abc.

📒 Files selected for processing (1)
  • CLAUDE.md

Comment thread CLAUDE.md
Comment on lines +54 to +71
**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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Comment thread CLAUDE.md
Comment on lines +64 to +65
npm run dev & # start dev server, then:
npm run test:validate
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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.

@BAWES BAWES merged commit 3adbf9d into main May 21, 2026
8 of 9 checks passed
@BAWES BAWES deleted the chore/STU-164-ci-enforcement branch May 21, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant