fix: Dispatcher requires the project runner pin instead of parsing CliConstants#1501
Conversation
… runner pin The fallback parsed MINIMUM_REQUIRED_PROJECT_RUNNER_VERSION out of C# source with a regex and substituted a semantically wrong value (the setup minimum instead of the pinned latest release), while hiding pin synchronization failures. The pin JSON is now the only runtime source for resolving the project runner version, so a missing pin fails fast with the existing resolution guidance instead of silently running a stale runner. - Delete readDispatcherPinFromCliConstants, its candidate paths, and the CliConstants regex constants; replace fallback tests with missing-pin error coverage - Log a warning in CliPinSynchronizer when the package source pin is missing instead of returning false silently - Keep editor bootstrap running when pin sync fails so one bad pin cannot take down the rest of initialization
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCli pin synchronization now reports missing source pins with a warning and a false return, while dispatcher pin loading no longer falls back to ChangesUnity CLI Pin Synchronizer
Dispatcher Pin Resolution Simplification
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant UnityCliLoopEditorBootstrapper
participant CliPinSynchronizer
participant FileSystem
UnityCliLoopEditorBootstrapper->>CliPinSynchronizer: SyncCurrentProjectPin()
CliPinSynchronizer->>FileSystem: check source pin file
alt source pin missing
CliPinSynchronizer->>CliPinSynchronizer: Debug.LogWarning(pinFileName, sourcePath)
CliPinSynchronizer-->>UnityCliLoopEditorBootstrapper: false
UnityCliLoopEditorBootstrapper->>UnityCliLoopEditorBootstrapper: continue startup
else source pin present
CliPinSynchronizer-->>UnityCliLoopEditorBootstrapper: true
end
sequenceDiagram
participant compile
participant runDispatcherWithDeps
participant loadDispatcherPin
participant FileSystem
compile->>runDispatcherWithDeps: start compile
runDispatcherWithDeps->>loadDispatcherPin: loadDispatcherPin()
loadDispatcherPin->>FileSystem: check project-runner-pin.json candidates
FileSystem-->>loadDispatcherPin: not found
loadDispatcherPin-->>runDispatcherWithDeps: error
runDispatcherWithDeps-->>compile: non-zero exit, stderr guidance
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
1 issue found across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
The prefix-only regex would keep passing if the warning dropped the missing source path, which is the part that makes the diagnostic actionable. Exact-match the whole message instead.
Summary
Part 1 of the version-gate consolidation (G4). The dispatcher had a regex-based runtime fallback that parsed
MINIMUM_REQUIRED_PROJECT_RUNNER_VERSIONout of C#CliConstants.cswhen the project-runner pin JSON was missing. The fallback substituted a semantically wrong value (the setup minimum instead of the pinned latest release) and hid pin synchronization failures. The pin JSON is now the only runtime source for resolving the project runner version.readDispatcherPinFromCliConstants, its CliConstants candidate paths, and the regex constants; a missing pin now fails fast with the existingdispatcherPinResolutionErrorguidanceCliPinSynchronizerlogs a warning when the package source pin is missing instead of returning false silentlyUpgrade path
If
.uloop/project-runner-pin.jsonis missing, the dispatcher searches the package-shipped pin copies; when none is found it exits with NextActions guidance, and opening the Unity project regenerates the pin viaCliPinSynchronizer.Validation
scripts/check-go-cli.sh(fmt, vet, lint, tests, binary rebuild)uloop compile: 0 errors / 0 warningsCliPinSynchronizerTests: 6/6 passed