Skip to content

BED-9520: Make source_kind optional and remove it from the OG metadata - #75

Merged
d3vzer0 merged 3 commits into
mainfrom
BED-9520-source-kind
Aug 31, 2026
Merged

BED-9520: Make source_kind optional and remove it from the OG metadata#75
d3vzer0 merged 3 commits into
mainfrom
BED-9520-source-kind

Conversation

@d3vzer0

@d3vzer0 d3vzer0 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

When a source_kind is present in the OpenGraph (metadata) output, edges directing to existing BloodHound nodes will overwrite the target node’s base kind. Ie. if the Github collector creates an edge to an Azure/AD node, the Azure/AD node will automatically inherit Github’s source_kind.

Motivation

Resolves: BED-9520

Changes

This change makes source_kind optional, and when defined, the source_kind is appended it to each node during conversion instead of adding it to the metadata. This still allows developers to add a base kind while fixing the overwriting issue.

Summary by CodeRabbit

  • New Features

    • Source classification is now optional when creating and converting OpenGraph data.
    • When provided, source classifications are automatically added to emitted graph nodes.
  • Changes

    • Simplified OpenGraph and BloodHound Enterprise output by removing redundant source metadata from generated files and ingestion payloads.
    • Existing workflows continue to operate without requiring a source classification.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d1f598b-1b73-40a1-8dcf-fe5a0b6c226c

📥 Commits

Reviewing files that changed from the base of the PR and between 0ded420 and f548a79.

📒 Files selected for processing (10)
  • src/openhound/core/app.py
  • src/openhound/core/app.pyi
  • src/openhound/core/convert.py
  • src/openhound/destinations/bloodhound_enterprise/destination.py
  • src/openhound/destinations/opengraph/destination.py
  • src/openhound/sources/opengraph/source.py
  • tests/test_opengraph_batching.py
  • tests/test_opengraph_destination.py
  • tests/test_opengraph_destination_retry.py
  • tests/test_opengraph_dlt_integration.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

source_kind is now optional and flows through graph generation. The value is appended to emitted node kinds. OpenGraph and BloodHound Enterprise destinations no longer write source-kind metadata. Tests cover node tagging and destination payload changes.

Changes

Source kind flow

Layer / File(s) Summary
Graph source propagation
src/openhound/core/app.py, src/openhound/core/app.pyi, src/openhound/core/convert.py, src/openhound/sources/opengraph/source.py, tests/test_opengraph_batching.py
Public APIs accept an optional source_kind. Converter forwards it to opengraph, which appends it to node kinds when absent.
Destination payload cleanup
src/openhound/destinations/*/destination.py, tests/test_opengraph_destination.py, tests/test_opengraph_destination_retry.py, tests/test_opengraph_dlt_integration.py
Destinations no longer accept or emit source_kind metadata. Tests remove the obsolete argument and verify the updated payload.

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

Merge Risk: ⚪ Minimal · up to f548a

The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Poem

I hop through graphs where new kinds grow,
Source tags join nodes in tidy rows.
Old metadata fades from sight,
Destinations stay clean and light.
Tests watch each change take flight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: making source_kind optional and removing it from OpenGraph metadata.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch BED-9520-source-kind

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

@d3vzer0
d3vzer0 merged commit 15c8e7d into main Aug 31, 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