-
Notifications
You must be signed in to change notification settings - Fork 787
Fullpath fix #1053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fullpath fix #1053
Conversation
📝 WalkthroughWalkthroughThis pull request adds runtime validation to detect duplicate SubTree paths in the XML parsing pipeline and introduces comprehensive test coverage for SubTree naming behavior. Additional configuration entries and documentation have been included. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 2 inconclusive)
✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
CLAUDE.md (1)
100-115: Consider adding a language identifier to the fenced code block.The static analysis tool flagged this code block for lacking a language specification. Since this is a directory tree structure, you could use
```textor```plaintextto satisfy linters while preserving readability.🔎 Proposed fix
-``` +```text src/ ├── *.cpp # Core: tree_node, blackboard, xml_parsing, bt_factorytests/gtest_subtree.cpp (1)
868-892: Test name could be more descriptive.The test name
NestedDuplicateNames_ShouldFailsuggests testing nested subtree structures, but it actually tests duplicates under aSequenceparent (similar toDuplicateSubTreeName_Groot2Issue56which usesParallelAll). Consider renaming to something likeDuplicateSubTreeNames_UnderSequence_ShouldFailfor clarity.That said, the test itself is correct and provides valuable coverage for different parent node types.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.gitignoreCLAUDE.mdsrc/xml_parsing.cpptests/gtest_subtree.cpp
🧰 Additional context used
🧬 Code graph analysis (3)
CLAUDE.md (1)
conanfile.py (1)
BehaviortreeCppConan(4-39)
src/xml_parsing.cpp (2)
include/behaviortree_cpp/exceptions.h (1)
RuntimeError(58-67)include/behaviortree_cpp/xml_parsing.h (2)
BT(9-84)XMLParser(16-44)
tests/gtest_subtree.cpp (3)
include/behaviortree_cpp/exceptions.h (1)
RuntimeError(58-67)include/behaviortree_cpp/decorators/subtree_node.h (3)
BT(6-86)SubTreeNode(52-84)setSubtreeID(66-69)include/behaviortree_cpp/bt_factory.h (2)
Tree(94-190)std(98-105)
🪛 markdownlint-cli2 (0.18.1)
CLAUDE.md
100-100: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: pixi_conda_build (ubuntu-latest)
- GitHub Check: pixi_conda_build (windows-latest)
- GitHub Check: build (ubuntu-22.04, asan_ubsan)
- GitHub Check: build (ubuntu-22.04, tsan)
- GitHub Check: build (ubuntu-22.04)
- GitHub Check: industrial_ci (humble, main)
- GitHub Check: industrial_ci (jazzy, main)
- GitHub Check: build (windows-latest)
- GitHub Check: clang-tidy
- GitHub Check: industrial_ci (rolling, main)
🔇 Additional comments (7)
.gitignore (1)
25-26: LGTM!Sensible additions to ignore generated log and trace files from examples/tutorials.
src/xml_parsing.cpp (1)
1013-1025: LGTM! Clear duplicate path detection with actionable error message.The implementation correctly addresses the Groot2 issue #56. The linear scan over existing subtrees is acceptable for typical tree sizes.
One minor observation: for very large trees with many subtrees, this O(n) check per subtree could accumulate, but this is unlikely to be a bottleneck in practice.
tests/gtest_subtree.cpp (5)
2-2: LGTM!The
<set>include is necessary for the path uniqueness verification in the new tests.
730-759: LGTM! Well-documented test case with clear issue reference.The test correctly verifies that duplicate SubTree names under the same parent trigger a
RuntimeError. The comment linking to Groot2 issue #56 provides excellent traceability.
761-796: LGTM! Thorough error message validation.Testing the error message content ensures users get actionable feedback. The use of
EXPECT_TRUEwithstd::string::findis appropriate for substring matching.
798-831: LGTM! Good positive test case.This test complements the negative tests by verifying that unique names work correctly. The
std::setapproach for path uniqueness verification is clean and idiomatic.
833-866: LGTM! Validates the auto-generation fallback behavior.This test verifies the recommended workaround mentioned in the error message: omitting the
nameattribute to auto-generate unique paths using UIDs.
Prevent issue with duplicated instance names, reported here: BehaviorTree/Groot2#56
Summary by CodeRabbit
Bug Fixes
Documentation
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.