Repository navigation
refactor(diff): compare analysis key inventories - #102
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 (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe diff package now compares ChangesDiff inventory comparison
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Diff comparison now uses analysis-owned key inventories while retaining existing file-based behavior. Missing-key results remain deterministic and value-free, with no current merge-blocking risk identified. 🚥 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 |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Closes #96
Summary
Move diff key comparison onto the analysis-owned key inventory while preserving the existing diff result and compatibility behavior.
Why
Discussion #58 defines analysis as the normalized fact boundary consumed by command engines. Diff should compare analysis key inventories instead of deriving private key sets directly from parser-owned files.
Type
Breaking change
Changes
diff.CompareInventoriesfor comparing twoanalysis.KeyInventoryvalues.diff.Result,HasDifferences, deterministic missing-key ordering, case sensitivity, empty assignments, duplicate handling, malformed-line filtering, and value non-disclosure.CompareFilesto convert parsed documents into value-free analysis inventories before comparison.CompareandCompareFilesas temporary compatibility wrappers for the later diff CLI migration in refactor(diff): migrate the diff command to shared loading and reporting #97.User-visible changes
None.
The diff CLI, output formats, exit behavior, and command syntax are unchanged. CLI migration is intentionally deferred to #97.
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 modify the lint command.Tests
Tests cover matching inventories, missing keys, deterministic ordering, empty assignments, duplicate declarations, case-sensitive comparison, bare and malformed declarations,
HasDifferences, labels, and value non-disclosure.Documentation
Added API and compatibility-wrapper documentation describing the analysis boundary and the temporary migration seam.
Release notes
Moves diff key comparison onto value-free analysis inventories without changing current CLI behavior.
Reviewer notes
Please pay particular attention to:
CompareInventoriesdepending only onanalysis.KeyInventory.diff.ResultandHasDifferencesbehavior.CompareandCompareFilesremaining temporary compatibility wrappers for refactor(diff): migrate the diff command to shared loading and reporting #97.The legacy
internal/envfilewrapper remains intentionally until the diff command migration in #97.Checklist
Summary by CodeRabbit