Skip to content

Conversation

@rlorenzo
Copy link
Contributor

  • 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
Copilot AI review requested due to automatic review settings December 12, 2025 11:05
Copy link

Copilot AI left a 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.js to 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
Copy link

Copilot AI left a 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)
Copy link

Copilot AI left a 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
Copy link

Copilot AI left a 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.

@rlorenzo rlorenzo requested a review from bsedwards December 12, 2025 22:44
bsedwards
bsedwards previously approved these changes Dec 15, 2025
throw new Error(`Unknown projectPath "${projectPath}" passed to runBuild. Expected "web" or "test".`)
}
// Use actual project file names to match build-dotnet.js cache keys
const projectName = projectPath === "web" ? "Viper.csproj" : "Viper.test.csproj"
@rlorenzo rlorenzo merged commit 5906ec1 into main Dec 15, 2025
5 checks passed
@rlorenzo rlorenzo deleted the VPR-39-concurrent-test-verify branch December 15, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants