BED-8973: uppercase objectid and name - #18
Conversation
"normalize" object IDs at the collector level. ref: BED-8973
Add unit coverage for uppercase object ID ref: BED-8973
Walkthrough
ChangesGUID Normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Establish a distinct OpenHound version that BloodHound Enterprise can use for version gating. ref: BED-8973
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_graph.py (1)
94-113: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAssert the matched edge endpoints.
The test verifies raw-name lookup and edge kind, but it does not verify
startorend. It can pass if the match points to the wrong node.Proposed test assertion
user = _make_user(lookup=lookup) + account = _make_account() # The node-level name is uppercased... assert user.as_node.properties.name == "ALICE" # ...but the internal lookup still matches on the raw (mixed-case) name. matched_edges = list(user._matched_name_edges) lookup.accounts_by_name.assert_called_once_with("alice") assert len(matched_edges) == 1 assert matched_edges[0].kind == ek.MATCHED_NAME + edge_start = cast(EdgePath, matched_edges[0].start) + edge_end = cast(EdgePath, matched_edges[0].end) + assert (edge_start.value, edge_end.value) == ( + user.as_node.id, + account.as_node.id, + )🤖 Prompt for 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. In `@tests/test_graph.py` around lines 94 - 113, Extend test_matched_name_edges_resolve_after_uppercasing_name to assert the matched edge’s start and end endpoints, confirming the edge originates from the expected user node and targets the account identified by the lookup result. Keep the existing raw-name lookup and MATCHED_NAME assertions unchanged.
🤖 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.
Nitpick comments:
In `@tests/test_graph.py`:
- Around line 94-113: Extend
test_matched_name_edges_resolve_after_uppercasing_name to assert the matched
edge’s start and end endpoints, confirming the edge originates from the expected
user node and targets the account identified by the lookup result. Keep the
existing raw-name lookup and MATCHED_NAME assertions unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e857fed-89de-447c-bcda-bdaa95dcf0bb
📒 Files selected for processing (2)
src/openhound_jamf/graph.pytests/test_graph.py
Uppercases
objectIdandnameat the collector level to maintain parity with existing objects in BHE when case-sensitive object IDs are implemented in BHE.Summary by CodeRabbit
Bug Fixes
Tests