chore: local CI-mirror gate (verify.sh) + pre-push hook#164
Conversation
Point agent-checklist Gate 1 and CONTRIBUTING at scripts/verify.sh (the local mirror of the CI matrix) and the committed pre-push hook, so "build passed locally" stops diverging from "CI passed". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 9 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a local verification gate ( ChangesLocal CI gate with pre-push integration
Sequence DiagramsequenceDiagram
participant Developer
participant PrePush as pre-push hook
participant VerifyScript as verify.sh
participant ChangeDetect as change detection
participant DotnetStep as .NET checks
participant FEStep as Frontend checks
participant DocsStep as Docs check
Developer->>PrePush: git push
PrePush->>VerifyScript: exec verify.sh fast
VerifyScript->>ChangeDetect: compute git range and detect changed files
ChangeDetect-->>VerifyScript: sets DOTNET/FE flags
VerifyScript->>DotnetStep: run .NET steps if DOTNET
DotnetStep-->>VerifyScript: exit codes
VerifyScript->>FEStep: run frontend steps if FE
FEStep-->>VerifyScript: exit codes
VerifyScript->>DocsStep: run check-doc-drift (always)
DocsStep-->>VerifyScript: exit code
VerifyScript-->>PrePush: PASS or FAIL (aggregated)
PrePush-->>Developer: exit 0 or exit 1
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 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. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@scripts/verify.sh`:
- Around line 15-16: The MODE variable is currently set with MODE="${1:-fast}"
and any unknown value behaves like "fast", so add explicit validation: after
setting MODE, check that MODE equals either "fast" or "full" and if not, print a
clear error and exit non-zero (do not silently default); update the same
validation where MODE is re-used in the other block (lines handling test
selection) so both places use the same check (e.g., a small helper validate_mode
or a single if/case that references MODE) to ensure typos like "ful" fail fast
and require an explicit correct value.
- Line 13: The repo-root change directory command using "$(dirname "$0")/.."
should guard against failure and exit immediately if cd fails; update the cd
invocation in scripts/verify.sh (the line that calls cd "$(dirname "$0")/..") to
check its return status and fail fast (e.g., by appending an explicit failure
handler that prints a clear error and exits non‑zero) so subsequent commands
never run in the wrong directory.
- Around line 53-59: The script's "full" MODE branch omits the build step
contrary to the documented contract; update the if branch that checks MODE to
include the same build invocation used in the non-full branch by adding a step
call for ".NET build" with the command "dotnet build Axis.sln --nologo" before
running the ".NET format" and ".NET test (full, Testcontainers)" steps (locate
the MODE conditional and the step function calls such as ".NET test (full,
Testcontainers)" and ".NET format" to insert the build step).
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 17b5ed9a-d61d-41ce-9336-94c30df912a6
📒 Files selected for processing (5)
CONTRIBUTING.mddocs/playbooks/agent-checklist.mdscripts/hooks/pre-pushscripts/install-hooks.shscripts/verify.sh
Address CodeRabbit findings on the local CI gate: - guard `cd "$(dirname "$0")/.."` with `|| exit` so a missing repo root fails fast instead of running subsequent steps in the wrong directory (SC2164). - validate the MODE arg via a `case` so typos like `ful` exit 2 with a usage hint rather than silently downgrading to fast. - restore the script's own contract: `full` mode must include `dotnet build` (header says `full = fast scope + full test`); the build step now runs in both modes and `full` only adds the Testcontainers test pass on top. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The verify.sh header and the CONTRIBUTING / agent-checklist notes listed "integration" among the classes the local gate catches, but the default mode and the pre-push hook run `fast` (no Testcontainers). State plainly that integration surfaces only in `verify.sh full` or CI, so the gate's guarantee is not overstated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Closes the biggest source of red-CI round-trips in the register-org slices: "build passed locally but CI failed" (charset/format, integration, casing). Mechanical, not self-reported.
scripts/verify.sh [fast|full]— runs the same commands as.github/workflows/build-and-test.yml, only for the layers whose files changed (vsorigin/main):fast—dotnet build+dotnet format --verify-no-changes+ frontendnpm run ci/test+check-doc-drift.sh(no Docker).full— adds the fulldotnet test(Testcontainers), exactly like CI.scripts/hooks/pre-push+scripts/install-hooks.sh— committed pre-push hook (enabled viacore.hooksPath) runsverify.sh fastautomatically. Bypass only withgit push --no-verify.agent-checklist.mdGate 1 andCONTRIBUTING.md.Verified end-to-end (forced the violation, per "green ≠ active"):
doc driftruns → PASS (change-detection works)..csprobe →verifydetects.NETchanged →dotnet formatstep fails withCHARSET→verify.sh: FAIL(the exact feat(identity): Terms acceptance, legal versions API, and org slug preview #154 bug, caught locally).verify.sh: PASS (fast).Linked spec
Process/tooling — no use-case AC. Motivated by the register-org CI cycle (charset, integration cascade, casing).
Requirements
verify.shmirrors the CI matrix with change-detection + fast/full modes./scripts/check-doc-drift.shgreen🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores