Skip to content

BED-9673: detect GitHub deployment metadata at startup - #57

Open
jaredcatkinson wants to merge 2 commits into
mainfrom
chore/BED-9673-detect-github-deployment-version
Open

BED-9673: detect GitHub deployment metadata at startup#57
jaredcatkinson wants to merge 2 commits into
mainfrom
chore/BED-9673-detect-github-deployment-version

Conversation

@jaredcatkinson

@jaredcatkinson jaredcatkinson commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • probe /meta during source startup to identify GHEC vs GHES and capture GHES version metadata
  • expose deployment type and GHES version on GH_Enterprise and GH_Organization root nodes
  • remove the unused securityContactEmail field from the enterprise GraphQL query and model

Testing

  • HOME=/private/tmp .venv/bin/python -m pytest
  • HOME=/private/tmp .venv/bin/python -m ruff check src/openhound_github/source.py src/openhound_github/graphql.py src/openhound_github/models/enterprise.py src/openhound_github/models/org.py src/openhound_github/resources/enterprise.py src/openhound_github/resources/organization.py tests/test_enterprise_resources.py tests/test_source_endpoints.py tests/test_source_org_canonicalization.py
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added GitHub deployment metadata, including deployment type and GHES version, to enterprise and organization records.
    • Added support for detecting and propagating GitHub Enterprise metadata from API responses and headers.
    • Enterprise and organization resource results now expose deployment details.
  • Bug Fixes

    • Removed the unsupported enterprise security contact email field from GitHub data requests.

jaredcatkinson and others added 2 commits September 5, 2026 06:04
@coderabbitai

coderabbitai Bot commented Sep 5, 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: Essentials

Run ID: c1bde36d-6159-42bc-be84-10f98531415c

📥 Commits

Reviewing files that changed from the base of the PR and between fd61122 and 7092f4d.

📒 Files selected for processing (9)
  • src/openhound_github/graphql.py
  • src/openhound_github/models/enterprise.py
  • src/openhound_github/models/org.py
  • src/openhound_github/resources/enterprise.py
  • src/openhound_github/resources/organization.py
  • src/openhound_github/source.py
  • tests/test_enterprise_resources.py
  • tests/test_source_endpoints.py
  • tests/test_source_org_canonicalization.py
💤 Files with no reviewable changes (1)
  • src/openhound_github/graphql.py

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

Changes

Deployment metadata propagation

Layer / File(s) Summary
Deployment metadata detection
src/openhound_github/source.py, tests/test_source_endpoints.py
The source queries /meta, parses deployment type and GHES version data, and propagates metadata to contexts. Tests cover GHES, GHEC, headers, fallback behavior, and the GraphQL query.
Resource initialization and metadata emission
src/openhound_github/source.py, src/openhound_github/resources/*, tests/test_enterprise_resources.py, tests/test_source_org_canonicalization.py
Application and token flows apply deployment metadata. Enterprise and organization resources emit the metadata in rows and node properties.
Model fields and GraphQL contract
src/openhound_github/models/enterprise.py, src/openhound_github/models/org.py, src/openhound_github/graphql.py
Enterprise and organization models expose deployment type and GHES version. Enterprise node mappings use the new fields, and the GraphQL query removes securityContactEmail.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7092f

Deployment metadata is consistently detected and emitted for enterprise and organization nodes, with no unresolved merge risk identified.

Sequence Diagram(s)

sequenceDiagram
  participant Source
  participant GitHubMetaAPI
  participant SourceContext
  participant EnterpriseResource
  participant OrganizationResource
  Source->>GitHubMetaAPI: Request /meta
  GitHubMetaAPI-->>Source: Deployment metadata
  Source->>SourceContext: Store metadata
  Source->>EnterpriseResource: Provide enterprise context
  Source->>OrganizationResource: Provide organization context
  EnterpriseResource-->>Source: Emit enterprise metadata
  OrganizationResource-->>Source: Emit organization metadata
Loading

Suggested reviewers: d3vzer0

Poem

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 8 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 and concisely describes the main change: detecting GitHub deployment metadata during startup.
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 chore/BED-9673-detect-github-deployment-version

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

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.

1 participant