Skip to content

BED- 8759 - Include installed collector versions in logs - #74

Merged
ktstrader merged 1 commit into
mainfrom
chore/BED-8759-add-extension-version-to-logs
Aug 28, 2026
Merged

BED- 8759 - Include installed collector versions in logs #74
ktstrader merged 1 commit into
mainfrom
chore/BED-8759-add-extension-version-to-logs

Conversation

@ktstrader

@ktstrader ktstrader commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Add collector and OpenHound version context to collection start and completion
logs.

Motivation

Resolved: https://specterops.atlassian.net/browse/BED-8759

Changes

  • Record the extension entry point's installed distribution version.
  • Add collector_extension, collector_extension_version,
    openhound_version, and job_id to collection lifecycle logs.
  • Fall back to extension.yaml when distribution metadata is unavailable.
  • Add scheduler coverage for the new fields.

Why use the installed package version?

extension.yaml can diverge from the release installed in a deployment. For
example, openhound-github installed as 0.6.4 while its metadata reported
0.1.0. Distribution metadata identifies the package that actually performed
the collection.

Testing

  • python -m pytest tests/test_bhe_job_scheduling.py -q — 33 passed
  • Built the Enterprise image and verified GitHub logs 0.6.4.

Summary by CodeRabbit

  • Enhancements
    • Collector lifecycle logs now include the collector name and version, OpenHound version, and job ID.
    • Startup and completion messages are emitted with more accurate collector context.
  • Bug Fixes
    • Improved handling of collector version information when extensions are loaded.
  • Tests
    • Added coverage to verify metadata appears consistently in collection logs.

@ktstrader ktstrader self-assigned this Aug 27, 2026
@coderabbitai

coderabbitai Bot commented Aug 27, 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

Run ID: 76340860-fd46-4eac-bb5a-ff08a3bee6ef

📥 Commits

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

📒 Files selected for processing (4)
  • src/openhound/core/app.py
  • src/openhound/core/manager.py
  • src/openhound/scheduler/service.py
  • tests/test_bhe_job_scheduling.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

OpenHound now stores extension distribution versions. Collector subprocess logs now use structured metadata for collector identity, extension version, OpenHound version, and job ID. Tests verify both lifecycle log records.

Changes

Extension Version Logging

Layer / File(s) Summary
Propagate extension distribution versions
src/openhound/core/app.py, src/openhound/core/manager.py
OpenHound initializes optional package_version metadata. Valid entry-point extensions receive their installed distribution version when available.
Emit structured collector lifecycle logs
src/openhound/scheduler/service.py, tests/test_bhe_job_scheduling.py
Collector discovery occurs before startup logging. Startup and completion records include collector identity, both versions, and job ID. Tests verify the emitted metadata.

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

Merge Risk: ⚪ Minimal · up to f15b0

This PR adds installed collector and OpenHound version context to collection lifecycle logs without any identified merge-blocking risk; it is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ExtensionManager
  participant OpenHound
  participant CollectorSubprocess
  participant Logger
  ExtensionManager->>OpenHound: assign extension distribution version
  CollectorSubprocess->>ExtensionManager: discover collector
  CollectorSubprocess->>Logger: emit structured startup metadata
  CollectorSubprocess->>Logger: emit structured completion metadata
Loading

Suggested reviewers: d3vzer0

Poem

A rabbit checks the version trail

Collector logs> hop without fail
OpenHound marks each passing sign
Job IDs sparkle, neat and fine
Two records close the logging line

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 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 describes the main change: adding installed collector version information to logs. It is concise and directly related to the pull request, although it does not mention the added Open…
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.
Full details: Title check

Explanation

The title clearly describes the main change: adding installed collector version information to logs. It is concise and directly related to the pull request, although it does not mention the added OpenHound version context.

  • 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-8759-add-extension-version-to-logs

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

@ktstrader
ktstrader merged commit 1de3b18 into main Aug 28, 2026
2 checks passed
@ktstrader
ktstrader deleted the chore/BED-8759-add-extension-version-to-logs branch August 28, 2026 17:55
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