Deduplicate repeated chunk tree entries#18
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a helper Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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
🧹 Nitpick comments (1)
test/integration/round-trip.test.js (1)
317-317: These checks currently drop first-seen order validation.Sorting both sides verifies set equality only; it won’t catch order regressions.
♻️ Suggested assertion tightening
- expect([...emittedChunkNames].sort()).toEqual([...uniqueChunkDigests(manifest)].sort()); + expect(emittedChunkNames).toEqual(uniqueChunkDigests(manifest)); ... - expect([...emittedChunkNames].sort()).toEqual([...uniqueChunkDigests(manifest)].sort()); + expect(emittedChunkNames).toEqual(uniqueChunkDigests(manifest));Also applies to: 362-362
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/integration/round-trip.test.js` at line 317, The test currently sorts both sides which only verifies set equality and loses first-seen order; change the assertions to compare the sequences directly (preserve order) by removing the .sort() calls and asserting that [...emittedChunkNames] ===/toEqual uniqueChunkDigests(manifest) (i.e., compare the arrays in their natural order) for both occurrences that use emittedChunkNames and uniqueChunkDigests(manifest).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/integration/round-trip.test.js`:
- Around line 76-85: The runGitFsck function must detect spawn failures and
non-clean termination instead of masking them; change runGitFsck to first check
result.error and throw or return a failing status with the error message if
present, and if result.status is null inspect result.signal (treat as failure)
and set status to a non-zero default (e.g., 1) rather than 0; include
result.stderr/result.stdout in the returned output and ensure callers/tests that
expect fsck.status === 0 will only pass when result.status === 0 and not when
spawnSync failed.
---
Nitpick comments:
In `@test/integration/round-trip.test.js`:
- Line 317: The test currently sorts both sides which only verifies set equality
and loses first-seen order; change the assertions to compare the sequences
directly (preserve order) by removing the .sort() calls and asserting that
[...emittedChunkNames] ===/toEqual uniqueChunkDigests(manifest) (i.e., compare
the arrays in their natural order) for both occurrences that use
emittedChunkNames and uniqueChunkDigests(manifest).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e4551944-d355-4e01-9dd0-8bf65de9eaa3
📒 Files selected for processing (4)
src/domain/services/CasService.jstest/integration/round-trip.test.jstest/unit/domain/services/CasService.merkle.test.jstest/unit/domain/services/CasService.test.js
|
Pushed follow-up commit I intentionally did not switch the integration assertions from sorted-set comparison to direct sequence comparison. |
Summary
createTree()and_createMerkleTree()while preserving first-seen emission ordergit fsck --full --no-danglingcoverage on a real Git repoValidation
npx eslint .npm testGIT_STUNTS_DOCKER=1 npx vitest run test/integrationbunx vitest run test/unitGIT_STUNTS_DOCKER=1 bunx vitest run test/integrationdeno run -A npm:vitest run test/unitGIT_STUNTS_DOCKER=1 deno run -A npm:vitest run test/integrationNotes
apt-get updateinside the test image rejected Debian repo signatures in this environment.Summary by CodeRabbit
Bug Fixes
Tests