feat: Identify compatible legacy projects automatically - #1801
Conversation
Identify pinless projects from the installed package metadata so the dispatcher can guide users to the compatible CLI instead of reporting a misleading missing-pin failure.
|
Warning Review limit reached
Next review available in: 51 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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe dispatcher detects pinless Unity projects using dispatcher V2, resolves their package version from package cache or lock data, and exits with structured Node.js and npx guidance. Tests cover detection, exclusions, fallback resolution, error output, and updated shared-input stamps. ChangesDispatcher V2 detection and guidance
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant RunDispatcher
participant Detector
participant UnityProject
participant stderr
User->>RunDispatcher: run dispatcher command
RunDispatcher->>Detector: inspect project root
Detector->>UnityProject: read pins, manifest, cache, or lock
UnityProject-->>Detector: package metadata
Detector-->>RunDispatcher: V2 status and version
RunDispatcher->>stderr: write structured guidance
RunDispatcher-->>User: exit code 1
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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 `@cli/dispatcher/internal/dispatcher/dispatcher_v2_detect.go`:
- Around line 109-125: Replace filepath.Glob in dispatcherV2PackageCacheVersion
with component-wise os.ReadDir traversal so projectRoot brackets and other glob
metacharacters are treated literally; locate the dispatcher package cache
directory, filter entries matching the dispatcher package name and package.json
target, and inspect each candidate. When readDispatcherPackageVersion fails for
an individual cache entry, skip it and continue checking remaining entries
instead of returning the error; preserve the existing matching-version return
and no-match behavior.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7a948079-b62e-4300-abb8-c649fdd38899
📒 Files selected for processing (6)
cli/common/errors/error_envelope.gocli/dispatcher/internal/dispatcher/dispatcher_v2_detect.gocli/dispatcher/internal/dispatcher/dispatcher_v2_detect_test.gocli/dispatcher/internal/dispatcher/run_dispatcher.gocli/dispatcher/shared-inputs-stamp.jsoncli/project-runner/shared-inputs-stamp.json
Keep the package metadata fallback safe by verifying both compatible and incompatible locked versions when the cache is unavailable.
Scan cache directory entries directly so project path characters and stale cache metadata cannot prevent compatible project detection.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cli/dispatcher/internal/dispatcher/dispatcher_v2_detect_test.go (1)
147-147: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse a raw string literal with
fmt.Sprintffor better readability.Building JSON strings via concatenation and escaped quotes can be hard to read and error-prone. Consider using a raw string literal (backticks) with
fmt.Sprintfto make the JSON structure clearer.♻️ Proposed refactor
- content := "{\n \"dependencies\": {\n \"" + dispatcherUnityPackageName + "\": {\n \"version\": \"" + version + "\"\n }\n }\n}\n" + content := fmt.Sprintf(`{ + "dependencies": { + "%s": { + "version": "%s" + } + } +} +`, dispatcherUnityPackageName, version)🤖 Prompt for 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. In `@cli/dispatcher/internal/dispatcher/dispatcher_v2_detect_test.go` at line 147, Update the test JSON setup around content to use fmt.Sprintf with a backtick-delimited raw string literal, substituting dispatcherUnityPackageName and version through format placeholders. Preserve the existing JSON structure and resulting content while removing manual concatenation and escaped quotes.
🤖 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.
Nitpick comments:
In `@cli/dispatcher/internal/dispatcher/dispatcher_v2_detect_test.go`:
- Line 147: Update the test JSON setup around content to use fmt.Sprintf with a
backtick-delimited raw string literal, substituting dispatcherUnityPackageName
and version through format placeholders. Preserve the existing JSON structure
and resulting content while removing manual concatenation and escaped quotes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 57f8c7ee-0d38-4f97-a492-aab29532338c
📒 Files selected for processing (1)
cli/dispatcher/internal/dispatcher/dispatcher_v2_detect_test.go
c6f0af7
into
feature/v2-cli-delegation-integration
Refs: V3 dispatcher to V2 CLI delegation — To-Do 2–4
Summary
User Impact
Changes
Verification
scripts/check-go-cli.sh(pass)go test ./dispatcher/internal/dispatcher -run TestDetectV2DispatcherProject -count=1(pass)