-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(precommit): VPR-39 Optimize Backend Testing and Build Verification for Concurrency #82
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
Conversation
rlorenzo
commented
Dec 12, 2025
- Run lint, tests, and build verification in parallel via run-parallel.js
- Build to isolated bin/Precommit to avoid conflicts with running dev server
- Add content-hash build caching with success/failure tracking
- Replace lint-staged with custom workflow using shared build cache
- Add partial-staging detection to prevent linting wrong content
…cation for Concurrency - Run lint, tests, and build verification in parallel via run-parallel.js - Build to isolated bin/Precommit to avoid conflicts with running dev server - Add content-hash build caching with success/failure tracking - Replace lint-staged with custom workflow using shared build cache - Add partial-staging detection to prevent linting wrong content
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.
Pull request overview
This PR refactors the precommit workflow to optimize backend testing and build verification by introducing parallel execution, content-hash based build caching, and a custom lint-staged replacement. The changes eliminate redundant builds by caching both successful and failed build states, use an isolated bin/Precommit output directory to prevent conflicts with the running dev server, and run lint, tests, and build verification concurrently for faster feedback.
Key changes:
- Replaced lint-staged with a custom workflow that shares build cache across lint, test, and verify operations
- Implemented content-hash based build caching with success/failure tracking to avoid redundant builds
- Added parallel task execution via
run-parallel.jsto run lint, tests, and build verification concurrently
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.husky/pre-commit |
Refactored to run builds conditionally in Phase 1, then execute lint/test/verify in parallel via run-parallel.js |
.lintstagedrc.json |
Removed - replaced with custom workflow in precommit-lint.js and lint-staged-runner.js |
package.json |
Removed lint-staged dependency, updated lint:staged and precommit scripts to use new custom implementations |
scripts/build-dotnet.js |
New script for precommit .NET builds with success/failure caching to isolated bin/Precommit directory |
scripts/lib/build-cache.js |
Enhanced caching to track both success/failure states, added quiet mode, filterBuildErrors utility, and wasBuildSuccessful checker |
scripts/lib/script-utils.js |
Added partial-staging detection (getPartiallyStaged, checkPartiallyStaged) and refactored waitForProcessTermination to use recursive polling |
scripts/lint-staged-dotnet.js |
Updated cache key logic to use actual project file names (Viper.csproj, Viper.test.csproj) matching build-dotnet.js |
scripts/lint-staged-runner.js |
New script providing npm run lint:staged command that checks for partially staged files before linting |
scripts/precommit-lint.js |
New script called from pre-commit hook that validates staged files and delegates to lint-any.js |
scripts/precommit.js |
New cross-platform script for running pre-commit hook via Git bash on Windows |
scripts/run-parallel.js |
New parallel task runner that captures output and displays only failed tasks' output on failure |
scripts/test-dotnet.js |
Refactored to use precommit build from bin/Precommit, removed dev service stopping logic |
scripts/verify-build.js |
Enhanced with build caching support to skip verification if build-dotnet.js already built successfully |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Make .NET build unconditional since tests always run and need the build - Add projectPath validation in lint-staged-dotnet.js to catch invalid inputs - Cache build failures in test-dotnet.js to avoid redundant rebuild attempts - Capture build output in verify-build.js for proper failure caching
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.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace recursive poll() with while loop for clearer intent and no stack growth - Add null guards for clearTimeout calls in verify-build.js - Add oxlint-disable for no-await-in-loop (polling requires sequential await)
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.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix merge commit race condition by building before parallel TEST/VERIFY - Check both Viper.csproj and Viper.test.csproj in cached build validation - Move projectPath validation before derived value computation (fail fast) - Reduce bash detection timeout from 5000ms to 2000ms
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.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.