ci(hooks): separate pre-commit and pre-push stages - #5901
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR switches static hook checks and related contract tests from ChangesPre-commit stage alignment
Sandbox NPROC fixture
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
PR Review Advisor (Nemotron Ultra) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Automated review follow-up:
Follow-up commit |
|
Maintainer rationale for the latest Nemotron findings (
The GPT advisor reports no blocking findings, CodeRabbit has no inline findings, all completed required checks are green, and the remaining checks are runtime E2E/coverage aggregation. |
<!-- markdownlint-disable MD041 --> ## Summary Make prek's lifecycle stages explicit so pre-commit owns formatting, linting, and tests while pre-push owns typechecking and version synchronization. This keeps local hooks and static CI aligned without running the same expensive work twice. ## Changes - Set `pre-commit` as the default stage and pin upstream hooks that opt into multiple stages to pre-commit. - Run the static-checks action against the pre-commit stage; keep TypeScript and version-sync hooks exclusively on pre-push. - Add a workflow contract test that ratchets the intended stage ownership. - Raise only the copied rlimit test fixture's process cap to 4096 so 16-worker Vitest runs cannot starve their own shell; the production cap remains 512. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: internal hook and CI stage scheduling only; the stage boundary is documented by an executable contract test. - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) Targeted verification: - `VITEST_MAX_WORKERS=16 npx vitest run --project cli test/pr-workflow-contract.test.ts test/sandbox-rlimit-hooks.test.ts` - `npx prek validate-config .pre-commit-config.yaml` - `npx prek run --all-files --stage pre-push --dry-run --no-progress` - Signed commit and push hooks with `VITEST_MAX_WORKERS=16` --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Updated CI static hook checks to run during the `pre-commit` lifecycle (instead of `pre-push`) and aligned related hook skipping behavior. * Improved sandbox test stability by standardizing the overridden `NPROC` limit during test setup. * **Tests** * Enhanced pre-commit contract tests to validate `default_stages` and confirm which hooks are explicitly pinned to `pre-commit` vs `pre-push`. * Added coverage ensuring the production `sandbox-rlimits.sh` fixture retains its default `NPROC` limit. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Make prek's lifecycle stages explicit so pre-commit owns formatting, linting, and tests while pre-push owns typechecking and version synchronization. This keeps local hooks and static CI aligned without running the same expensive work twice.
Changes
pre-commitas the default stage and pin upstream hooks that opt into multiple stages to pre-commit.Type of Change
Quality Gates
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Targeted verification:
VITEST_MAX_WORKERS=16 npx vitest run --project cli test/pr-workflow-contract.test.ts test/sandbox-rlimit-hooks.test.tsnpx prek validate-config .pre-commit-config.yamlnpx prek run --all-files --stage pre-push --dry-run --no-progressVITEST_MAX_WORKERS=16Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Bug Fixes
pre-commitlifecycle (instead ofpre-push) and aligned related hook skipping behavior.NPROClimit during test setup.Tests
default_stagesand confirm which hooks are explicitly pinned topre-commitvspre-push.sandbox-rlimits.shfixture retains its defaultNPROClimit.