Fix type display in hhds_tree_diff#217
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughConsolidates dump parsing and full-line label extraction into a single load_dump(), extends DumpData with type_names, and updates print_tree() to register per-key attribute callbacks so attributes are available during tree printing. ChangesDump Processing and Attribute Display
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hhds/hhds_tree_diff.cpp`:
- Around line 66-72: DumpData's default copy operations can leave type_table's
Type_entry string_views pointing into the original type_names; make DumpData
safe by either deleting copy constructor and copy assignment (declare
DumpData(const DumpData&)=delete; DumpData& operator=(const DumpData&)=delete;)
or implement custom copy/move that rebuilds type_table from the destination's
type_names after copying (ensure symbols DumpData, type_table, type_names, and
hhds::Type_entry are updated so string_view targets the new storage).
- Around line 120-140: The second-pass loader currently skips the first line and
pushes only non-empty extracts from extract_full_content into contents, then
quietly writes whatever it has into data.full_labels; instead enforce that the
second pass produced a full label for every node: after collecting contents,
check that contents.size() == data.nodes.size() and that no entry is empty (or
that extract_full_content succeeded for every node), and if not, fail the load
(e.g., return an error/empty result or throw) instead of partially populating
data.full_labels; update the logic around contents, data.nodes and
data.full_labels to perform this validation and abort early on mismatch so
cost_fn can't fall back to empty strings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
dca8c42 to
a5f2ee4
Compare
a5f2ee4 to
5b0580e
Compare
Summary
Fixes type name display in
hhds_tree_diffand adds attribute handling to matchhhds_tree_catoutput.Changes
type_namesvector inDumpDatato ensureType_entrystring views remain valid throughout the tree lifecycleload_dumpfor cleaner ownership semanticsprint_tree, matching the approach used byhhds_tree_catSummary by CodeRabbit
Refactor
Enhancements