fix: isolate pre-push Git environment - #71
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pre-push hook now removes repository-local Git environment variables before running lint and unit tests. A unit test verifies the sanitization commands occur before both quality gates. ChangesPre-push Git environment sanitization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/hooks/pre-push`:
- Around line 10-12: Update the Git environment sanitization loop to explicitly
capture and validate the output of git rev-parse --local-env-vars before
iterating. If discovery fails, terminate the pre-push hook without launching
either quality gate; otherwise, preserve the existing unset behavior for every
discovered variable.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: fc25c61f-a683-4e06-9427-f51b2b9fd3ef
📒 Files selected for processing (2)
scripts/hooks/pre-pushtest/unit/scripts/pre-push-hook.test.js
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: test-unit
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-02-28T19:21:13.982Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 15
File: test/unit/domain/services/CasService.envelope.test.js:326-330
Timestamp: 2026-02-28T19:21:13.982Z
Learning: In fuzz tests for cryptographic operations, use a seeded PRNG (e.g., xorshift32) for control-flow variables such as plaintext size selection and recipient index selection to ensure reproducibility. Continue to use randomBytes() for cryptographic keys and nonces to preserve realistic randomness and avoid security anti-patterns. This guideline applies to test files that perform fuzz testing of crypto logic; implement a consistent seed setup (e.g., fixed seed in test initialization) and document the rationale to enable deterministic replays across runs.
Applied to files:
test/unit/scripts/pre-push-hook.test.js
🔇 Additional comments (1)
test/unit/scripts/pre-push-hook.test.js (1)
1-23: LGTM!
Linked Issue\n\n- Fixes #70\n\n## Change\n\n- Clears repository-local variables reported by
git rev-parse --local-env-varsbefore the hook launches child quality commands.\n- Keeps lint and the full unit suite enabled.\n- Adds a contract test that preserves the sanitation boundary ahead of both gates.\n\n## Evidence\n\n- Focused hook and GUIDE tests: 5/5 passed.\n- ESLint: passed.\n- Bash syntax validation: passed.\n- Normalgit pushwith the repaired hook: 213 test files passed; 1,873 tests passed; 2 skipped.\n- Graft review: two-file non-structural change; no breaking changes.\n\n## Why this is separate\n\nThis test-infrastructure defect blocked the scoped cache acquisition branch but is independent of that public API change. Landing it first keeps the acquisition PR focused and makes all future pre-push verification honest in linked worktrees.\n