Skip to content

fix: have EnterpriseOrganization check if the organization is present in the lookup#21

Merged
ktstrader merged 1 commit into
mainfrom
fix/BED-8783-organizations-collected-false
Jun 26, 2026
Merged

fix: have EnterpriseOrganization check if the organization is present in the lookup#21
ktstrader merged 1 commit into
mainfrom
fix/BED-8783-organizations-collected-false

Conversation

@ktstrader

@ktstrader ktstrader commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

The Enterprise stub and explicit Organization collection create a GH_Organization node with the same node_id.
The stub hardcoded collected=false, and since BloodHound merges same-id nodes with last-writer-wins (ingest order not guaranteed), it could overwrite an explicitly-collected org's collected=true. This fix derives collected from the lookup so both records agree, making the result order-independent.

Changes:

  • src/openhound_github/models/enterprise_organization.py: In as_node, replaced hardcoded collected=False with a lookup-derived value:
    collected = self._lookup.org_login_for_id(self.node_id) is not None
  • tests/test_enterprise_organization.py (new): Added unit tests covering collected=true (org in lookup), collected=false (absent), and per-node_id resolution in a multi-org enterprise.

Motivation and Context

Resolves: BED-8783

Tested with K-Nexus Github environment

… in the lookup and set 'collected' to that value, added test cases
@ktstrader ktstrader self-assigned this Jun 26, 2026
@ktstrader ktstrader merged commit 2d4305d into main Jun 26, 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.

2 participants