perf(build-cli): speed up assert-tag validation - #28253
Craig Macomber (Microsoft) (CraigMacomber) wants to merge 2 commits into
Conversation
…eject messages with */. Add test suite for actual validation and tagging. Validation times goes from 44 to 10 seconds.
Cache module resolutions per project and skip ambient type packages to avoid repeated filesystem lookups and unnecessary declaration loading. Clarify the performance rationale and local-file reachability assumptions. Local repository-wide validation now takes 5.27 seconds, down from about 10 seconds after the previous optimization and 44 seconds originally, with identical validation output. Verified all 23 focused tests, TypeScript compilation, formatting, lint, and repository-wide validation.
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (359 lines, 2 files), I've queued these reviewers:
How this works
|
Bundle size comparisonBase commit: could not be determined; will be reported when the comparison runs Pending — |
There was a problem hiding this comment.
🔵 Needs a closer look
Validation and module-resolution changes warrant final human review.
Pull request overview
Speeds up generate:assertTags validation while preserving local import traversal and improving safety.
Changes:
- Optimizes TypeScript loading and module resolution.
- Skips unnecessary validation-time tagging.
- Rejects unsafe
*/messages. - Adds isolated integration coverage.
File summaries
| File | Description |
|---|---|
build-tools/packages/build-cli/src/test/commands/generate/assertTags.test.ts |
Adds integration tests for tagging and validation scenarios. |
build-tools/packages/build-cli/src/commands/generate/assertTags.ts |
Implements validation performance optimizations and safety checks. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
Reduce local repository-wide assert-tag validation from approximately 44 seconds to 5.3 seconds, with identical validation output.
--requireTaggedis requested.*/before they can produce invalid block comments.Verified all 23 focused tests, TypeScript compilation, formatting, lint, and repository-wide validation using the locally built CLI.
Reviewer Guidance
The review process is outlined in the pull request guidelines.
The optimization assumes no additional package-local files are reachable only through external imports or ambient type packages. This limitation is documented alongside the project configuration.