Repository navigation
refactor(diff): migrate diff command to shared loading and reporting - #103
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe diff command now uses a shared dotenv loader, analysis conversion, and inventory comparison service. The CLI delegates comparison and output rendering. The loader returns typed errors with preserved display paths. Legacy raw-byte comparison wrappers were removed. ChangesDiff command migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The diff command now uses shared dotenv loading and analysis-backed comparison while preserving key-only results and path-aware loading errors. No actionable merge-blocking risk is identified. Sequence Diagram(s)sequenceDiagram
participant DiffCLI
participant ApplicationDiffService
participant LoadMany
participant Analysis
participant DiffEngine
DiffCLI->>ApplicationDiffService: Run(leftPath, rightPath)
ApplicationDiffService->>LoadMany: Load both dotenv paths
LoadMany-->>ApplicationDiffService: Return dotenv documents
ApplicationDiffService->>Analysis: Build analysis snapshots
Analysis-->>ApplicationDiffService: Return key inventories
ApplicationDiffService->>DiffEngine: CompareInventories
DiffEngine-->>ApplicationDiffService: Return diff result
ApplicationDiffService-->>DiffCLI: Return result or error
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
Closes #97
Summary
Migrate
vaar diffto the shared source, analysis, diff-engine, application, and output boundaries while preserving existing behavior.Why
The diff command previously performed direct filesystem reads and invoked raw-byte compatibility wrappers. This change aligns it with the architecture defined in Discussion #58 and makes the CLI a thin application boundary.
Type
Breaking change
Changes
internal/application/diffto coordinate source loading, analysis conversion, snapshot creation, inventory comparison, and error normalization.internal/cli/diff.goto delegate loading and comparison while retaining argument validation, flags, output writing, and exit-code mapping.internal/diff.--quiet,--json, conflict handling, and existing exit behavior.User-visible changes
None.
The command syntax, output formats, flags, path handling, and exit behavior remain unchanged.
Validation
Commands run:
gofmt -w <touched Go files>make lintgo test ./...go run ./cmd/vaar lint ...Additional commands:
go run ./cmd/vaar lint ...was not run because this ticket does not change lint behavior.Tests
Documentation
Updated affected package comments and API documentation.
Release notes
Migrates
vaar diffto the shared source and analysis pipeline without changing user-visible behavior.Reviewer notes
Please pay particular attention to:
internal/application/difforchestration boundary.enginespackage or unrelated query functionality.Checklist
Summary by CodeRabbit
New Features
Bug Fixes