Skip to content

BED-8973: uppercase objectid and name - #18

Merged
StranDutton merged 5 commits into
mainfrom
feature/bed8973-uppercase-objectid
Aug 7, 2026
Merged

BED-8973: uppercase objectid and name#18
StranDutton merged 5 commits into
mainfrom
feature/bed8973-uppercase-objectid

Conversation

@codemonkey2841

@codemonkey2841 codemonkey2841 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Uppercases objectId and name at 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

    • JAMF node identifiers and names are now consistently uppercase.
    • Improved consistency between graph edge endpoints and their referenced node identifiers.
    • Preserved display names and raw-name matching while normalizing graph names.
  • Tests

    • Added coverage for graph identity behavior, node and name formatting, edge consistency, and account lookups.

"normalize" object IDs at the collector level.

ref: BED-8973
Add unit coverage for uppercase object ID

ref: BED-8973
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

JAMFNodeProperties now uppercases node names, and JAMFNode.guid now returns uppercase GUIDs. Graph tests cover node identity, display names, administrative edges, and raw-name matching.

Changes

GUID Normalization

Layer / File(s) Summary
Normalize graph identity values
src/openhound_jamf/graph.py
JAMFNodeProperties uppercases node names during initialization. JAMFNode.guid uppercases generated GUIDs.
Validate graph identity and matching
tests/test_graph.py
Fixtures and tests verify GUID behavior, uppercase node IDs and names, unchanged display names, consistent administrative edge endpoints, and raw-name matching.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit found GUIDs in a row,
And made their letters uppercase glow.
Names align across each edge,
Tests stand firm along the hedge.
Hop, hop—the graph is clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: uppercasing object IDs and names in the JAMF collector.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bed8973-uppercase-objectid

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Establish a distinct OpenHound version that BloodHound Enterprise can use for version gating.

ref: BED-8973
@codemonkey2841
codemonkey2841 marked this pull request as ready for review August 4, 2026 16:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/test_graph.py (1)

94-113: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Assert the matched edge endpoints.

The test verifies raw-name lookup and edge kind, but it does not verify start or end. 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

📥 Commits

Reviewing files that changed from the base of the PR and between a50aae7 and d72856b.

📒 Files selected for processing (2)
  • src/openhound_jamf/graph.py
  • tests/test_graph.py

Comment thread src/openhound_jamf/graph.py
@StranDutton StranDutton self-assigned this Aug 6, 2026
@StranDutton StranDutton changed the title BED-8973: uppercase objectid BED-8973: uppercase objectid and name Aug 6, 2026
@StranDutton
StranDutton merged commit a12a571 into main Aug 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants