Skip to content

Integrate status reporting into vMCP runtime#3457

Merged
yrobla merged 2 commits intomainfrom
issue-3149-v2
Jan 28, 2026
Merged

Integrate status reporting into vMCP runtime#3457
yrobla merged 2 commits intomainfrom
issue-3149-v2

Conversation

@yrobla
Copy link
Contributor

@yrobla yrobla commented Jan 27, 2026

Wire up periodic status reporting to enable vMCP runtime to report operational status to the control plane (Kubernetes API or CLI logging).

Changes:

  • Add BuildStatus() method to health.Monitor that converts health state to vmcp.Status format with phase determination, backend details, and Kubernetes-style conditions
  • Create periodicStatusReporting() in server package that runs in background goroutine, pulling health data every 30 seconds and sending to configured reporter
  • Integrate status reporting lifecycle into server.Start() and Stop() with proper shutdown handling
  • Update commands.go to use factory pattern (vmcpstatus.NewReporter) instead of hardcoded LoggingReporter, enabling auto-detection of K8s vs CLI mode via environment variables
  • Add comprehensive tests for status building logic (phase determination, condition generation, message formatting)

Phase determination logic:

  • Ready: All backends healthy (or no backends yet - cold start)
  • Degraded: Some backends healthy, some degraded/unhealthy
  • Failed: No healthy backends
  • Pending: Waiting for backends to be discovered

The implementation respects the separation between health monitoring (data gathering) and status reporting (persistence), with K8sReporter handling Kubernetes-specific fields like ObservedGeneration.

Related-to: #3149

Large PR Justification

This is an atomic PR, covering the integration of status into vmcp. It includes complete testing.
It cannot be split as it's an isolated functionality.

@yrobla yrobla requested a review from Copilot January 27, 2026 10:35
@github-actions github-actions bot added the size/M Medium PR: 300-599 lines changed label Jan 27, 2026
@yrobla yrobla self-assigned this Jan 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Integrates periodic runtime status reporting so vMCP can publish operational status (phase/conditions/backends) via a pluggable reporter (Kubernetes status updates or CLI logging).

Changes:

  • Added health.Monitor.BuildStatus() to convert health state into vmcp.Status (phase, conditions, discovered backends).
  • Introduced a background status reporting loop in the server that reports every 30s (and once on startup).
  • Updated the CLI to create the status reporter via vmcpstatus.NewReporter() (auto-detect K8s vs CLI).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/vmcp/server/status_reporting.go Adds periodic status reporting goroutine and a helper to build/report status.
pkg/vmcp/server/server.go Starts periodic status reporting during server startup when a reporter is configured.
pkg/vmcp/health/monitor.go Adds BuildStatus() plus helpers to generate conditions and backend messages.
pkg/vmcp/health/status_builder_test.go Adds unit tests for conditions/message formatting and phase logic.
cmd/vmcp/app/commands.go Switches to reporter factory for environment-based reporter selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added size/L Large PR: 600-999 lines changed and removed size/M Medium PR: 300-599 lines changed labels Jan 27, 2026
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 85.56701% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.95%. Comparing base (d1ae4f0) to head (7da281b).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/health/monitor.go 90.59% 11 Missing ⚠️
pkg/vmcp/server/status_reporting.go 85.71% 2 Missing and 3 partials ⚠️
pkg/vmcp/status/k8s_reporter.go 70.58% 5 Missing ⚠️
cmd/vmcp/app/commands.go 0.00% 3 Missing ⚠️
pkg/vmcp/server/server.go 66.66% 3 Missing ⚠️
pkg/vmcp/status/factory.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3457      +/-   ##
==========================================
+ Coverage   64.91%   64.95%   +0.03%     
==========================================
  Files         393      396       +3     
  Lines       38404    38577     +173     
==========================================
+ Hits        24930    25057     +127     
- Misses      11528    11575      +47     
+ Partials     1946     1945       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yrobla yrobla requested a review from Copilot January 27, 2026 10:58
@github-actions github-actions bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Jan 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Base automatically changed from issue-3149-v1 to main January 27, 2026 11:07
Wire up periodic status reporting to enable vMCP runtime to report
operational status to the control plane (Kubernetes API or CLI logging).

Changes:
  - Add BuildStatus() method to health.Monitor that converts health state
    to vmcp.Status format with phase determination, backend details, and
    Kubernetes-style conditions
  - Create periodicStatusReporting() in server package that runs in
    background goroutine, pulling health data every 30 seconds and
    sending to configured reporter
  - Integrate status reporting lifecycle into server.Start() and Stop()
    with proper shutdown handling
  - Update commands.go to use factory pattern (vmcpstatus.NewReporter)
    instead of hardcoded LoggingReporter, enabling auto-detection of
    K8s vs CLI mode via environment variables
  - Add comprehensive tests for status building logic (phase determination,
    condition generation, message formatting)

Phase determination logic:
  - Ready: All backends healthy (or no backends yet - cold start)
  - Degraded: Some backends healthy, some degraded/unhealthy
  - Failed: No healthy backends
  - Pending: Waiting for backends to be discovered

The implementation respects the separation between health monitoring
(data gathering) and status reporting (persistence), with K8sReporter
handling Kubernetes-specific fields like ObservedGeneration.

Related-to: #3149
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/L Large PR: 600-999 lines changed labels Jan 27, 2026
@yrobla yrobla requested a review from Copilot January 27, 2026 11:39
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Large PR Detected

This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.

How to unblock this PR:

Add a section to your PR description with the following format:

## Large PR Justification

[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformation

Alternative:

Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.

See our Contributing Guidelines for more details.


This review will be automatically dismissed once you add the justification section.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Jan 27, 2026
@github-actions github-actions bot dismissed their stale review January 27, 2026 15:05

Large PR justification has been provided. Thank you!

@github-actions
Copy link
Contributor

✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review.

Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

a small suggestion, but looks good!

Copy link
Contributor

@jerm-dro jerm-dro left a comment

Choose a reason for hiding this comment

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

All comments non-blocking, feel free to merge.

@yrobla
Copy link
Contributor Author

yrobla commented Jan 28, 2026

ok implementing in follow ups

@yrobla yrobla merged commit 38565be into main Jan 28, 2026
39 checks passed
@yrobla yrobla deleted the issue-3149-v2 branch January 28, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra large PR: 1000+ lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants