-
Notifications
You must be signed in to change notification settings - Fork 0
[STU-164] Enforce CI/CD quality gates in CLAUDE.md #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,13 +41,39 @@ Do not commit directly to `main`. Every change goes through a PR. | |
|
|
||
| 1. Create a feature branch from `main` | ||
| 2. Commit changes with conventional commit messages | ||
| 3. Push the branch to `origin` | ||
| 4. Create a PR with a clear title and description | ||
| 5. Request review from at least one team member | ||
| 6. Merge only after approval and passing checks | ||
| 3. **Run the pre-push gate BEFORE pushing** (see CI/CD Enforcement below) | ||
| 4. Push the branch to `origin` | ||
| 5. Create a PR with a clear title and description | ||
| 6. Request review from at least one team member | ||
| 7. Merge only after approval and passing checks | ||
|
|
||
| PR titles follow: `[STU-N] Short description of change` | ||
|
|
||
| ## CI/CD Enforcement (CRITICAL — read before pushing) | ||
|
|
||
| **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. | ||
|
Comment on lines
+54
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 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 Also applies to: 81-81 🤖 Prompt for AI Agents |
||
|
|
||
| **Stale cache warning:** When switching branches, always run `rm -rf .next && npx prisma generate` before type-checking. Stale `.next` caches and outdated Prisma clients cause false errors that masquerade as real bugs. | ||
|
|
||
| **Lint-staged hazard:** The pre-commit hook stashes working changes. Switching branches while lint-staged is running can corrupt files with cross-branch artifacts. Verify working tree is clean before switching branches. | ||
|
|
||
| ## TypeScript & Code Quality | ||
|
|
||
| - Run `npm run test:types` before committing — zero type errors required | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the validation example deterministic to avoid flaky false failures.
npm run dev &followed immediately bynpm run test:validatecan race before port 3000 is ready. Add an explicit readiness wait (and cleanup) in the documented snippet.Suggested doc patch
📝 Committable suggestion
🤖 Prompt for AI Agents