Repository navigation
chore: CLI pin reading now goes through an injectable boundary instead of static file IO - #1527
Conversation
The Application layer performed File.ReadAllText and JObject.Parse directly through static CliPinReader calls, hiding a file-system dependency inside setup and installation-detection flows. - Declare ICliPinReader in Application; the static class keeps only the pure BuildDispatcherReleaseTag helper - Move the IO, parsing, and validation into Infrastructure's CliPinReaderService with identical semantics and error messages - Inject the reader into CliSetupApplicationService and CliInstallationDetector, wired once in the composition root; the pin is still resolved on the caller thread before Task.Run - Add CliPinReaderServiceTests covering the valid, missing-file, empty-file, and missing-key branches
|
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 ignored due to path filters (2)
📒 Files selected for processing (8)
📝 WalkthroughWalkthroughIntroduces an ChangesICliPinReader dependency injection
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CliInstallationDetector
participant CliPinReaderService
participant FileSystem
CliInstallationDetector->>CliPinReaderService: LoadMinimumDispatcherVersionOrThrow()
CliPinReaderService->>FileSystem: read pin file at pinPath
FileSystem-->>CliPinReaderService: file content
CliPinReaderService->>CliPinReaderService: parse JSON, validate keys
CliPinReaderService-->>CliInstallationDetector: minimumDispatcherVersion or throw
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.
2 issues found across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Address cubic review findings on the pin reader port: a corrupt pin file now surfaces as a CliPinLoadResult failure instead of an unhandled JsonReaderException, matching the JsonRpcProcessor pattern, and test cleanup guards Directory.Delete so setup failures are not masked by DirectoryNotFoundException. Adds a corrupt-JSON test.
…d of static file IO (hatayama#1527)
Summary
User Impact
Changes
Verification