Conversation
df63ed8 to
0840ccd
Compare
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a helper builder abstraction ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@confik/src/helpers.rs`:
- Around line 396-400: Replace the manual impl Default for
MergingUnsetBuilder<T> with a derived Default: add Default to the enum's derive
list and mark the Unset variant with #[default]; specifically, update the
MergingUnsetBuilder definition (the enum with variant Unset) to #[derive(...,
Default)] and annotate Unset with #[default] so the compiler/Clippy no longer
flags the manual impl.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 64fad18b-0dc7-40fb-bfd5-08b6d0ee02c4
📒 Files selected for processing (4)
confik/CHANGELOG.mdconfik/src/helpers.rsconfik/src/third_party.rsconfik/tests/third_party.rs
0840ccd to
85001ce
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
confik/tests/third_party.rs (1)
211-226: Consider clarifying the test name or adding a comment.This test validates the PR's core fix, but the name
object_merged_missing_in_first_sourcecould be confusing given confik's merge semantics. Based on learnings, override sources are reduced in reverse order — sotoml_2(last added) is the "first" source in the merge chain (higher priority), and it's the one missingdata. Meanwhile,toml_1(first added) is lower priority but provides the value.Consider either:
- Renaming to
object_merged_missing_in_higher_priority_source, or- Adding a brief comment explaining the merge order
💡 Suggested comment clarification
#[test] fn object_merged_missing_in_first_source() { + // toml_2 is higher priority (last override) but lacks `data` field. + // Verifies that MergingUnsetBuilder falls back to toml_1's value. let toml_1 = r#" [leaf.data] item_2 = 2 "#; let toml_2 = "[leaf]";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@confik/tests/third_party.rs` around lines 211 - 226, The test name object_merged_missing_in_first_source is misleading given confik's reverse reduction of override sources; update the test to either rename the function to object_merged_missing_in_higher_priority_source or add a one-line comment above the test explaining that override sources passed via Root::builder().override_with(...) are reduced in reverse order (so toml_2 is higher priority and missing data while toml_1 supplies it), referencing the test symbols toml_1, toml_2, Root::builder(), override_with, try_build, and config.leaf.data so future readers understand the merge semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@confik/tests/third_party.rs`:
- Around line 211-226: The test name object_merged_missing_in_first_source is
misleading given confik's reverse reduction of override sources; update the test
to either rename the function to object_merged_missing_in_higher_priority_source
or add a one-line comment above the test explaining that override sources passed
via Root::builder().override_with(...) are reduced in reverse order (so toml_2
is higher priority and missing data while toml_1 supplies it), referencing the
test symbols toml_1, toml_2, Root::builder(), override_with, try_build, and
config.leaf.data so future readers understand the merge semantics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 04acf80c-d15e-4ce6-aea8-9b55df09c01c
📒 Files selected for processing (4)
confik/CHANGELOG.mdconfik/src/helpers.rsconfik/src/third_party.rsconfik/tests/third_party.rs
✅ Files skipped from review due to trivial changes (1)
- confik/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (2)
- confik/src/third_party.rs
- confik/src/helpers.rs
robjtede
left a comment
There was a problem hiding this comment.
makes sense to me, we can chat about the wider behavioral change elsewhere
I kind of want to replace
OptionBuilderwith this approach too, but it's a pretty big breaking change as unset won't default toNoneanymore without an explicitdefaultannotation.This is a positive in that you can require an explicit null if you want one (currently not possible to do), but also an easy to miss breakage.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests