Skip to content

Conversation

@4t8dd
Copy link
Contributor

@4t8dd 4t8dd commented Dec 25, 2025

Implement StatusReporter interface and LoggingReporter to enable vMCP runtime to report operational status (phase, discovered backends, health conditions).

This commit provides:

  • Reporter interface with ReportStatus() and Start() methods
  • Status model: Phase, Conditions, DiscoveredBackends
  • LoggingReporter: Logs status updates for debugging (no persistence)
  • Integration into vMCP server lifecycle with shutdown function pattern

The interface is designed to support future implementations that persist status to different backends. This PR includes only the logging implementation for CLI mode.

Integration:

  • vMCP server calls reporter.Start() which returns shutdown function
  • CLI mode uses LoggingReporter with logging disabled by default
  • Status reporting is optional (nil reporter = disabled)

Related: #3147

@github-actions github-actions bot added the size/L Large PR: 600-999 lines changed label Dec 25, 2025
@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 92.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.74%. Comparing base (a7962a6) to head (8f1ce60).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/vmcp/app/commands.go 0.00% 2 Missing ⚠️
pkg/vmcp/server/server.go 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3159      +/-   ##
==========================================
- Coverage   64.79%   64.74%   -0.05%     
==========================================
  Files         381      382       +1     
  Lines       37149    37187      +38     
==========================================
+ Hits        24071    24078       +7     
- Misses      11191    11223      +32     
+ Partials     1887     1886       -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.

@4t8dd
Copy link
Contributor Author

4t8dd commented Jan 7, 2026

@JAORMX can you take some time to review this PR so that I can keep working this serials.

@JAORMX
Copy link
Collaborator

JAORMX commented Jan 16, 2026

Sorry for the delay in reviewing this!

@4t8dd
Copy link
Contributor Author

4t8dd commented Jan 18, 2026

Since you guys take your time to get this reviewed. I will try to resolve all these. But it would take some time provided it has been some time. Just let you know. Thanks.

@JAORMX
Copy link
Collaborator

JAORMX commented Jan 19, 2026

Hey @4t8dd,

I owe you an apology. You did everything right and we dropped the ball. Leaving your PR without review for 3 weeks while someone else started re-implementing the same thing isn't okay.

Your PR is the one we want to land. Happy to help with the merge conflicts if useful. We're tightening up our process so this doesn't happen again.

Thanks for sticking with it.

@4t8dd 4t8dd force-pushed the issue-3147-status-reporter branch from 743a193 to 89fd73f Compare January 20, 2026 08:59
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/L Large PR: 600-999 lines changed labels Jan 20, 2026
@yrobla yrobla requested a review from Copilot January 20, 2026 09:47
@4t8dd 4t8dd force-pushed the issue-3147-status-reporter branch from 89fd73f to 202016c Compare January 20, 2026 09:49
@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 20, 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

This PR implements a StatusReporter abstraction to enable the vMCP runtime to report operational status. The abstraction provides a foundation for the runtime to communicate its state (phase, discovered backends, health conditions) back to control planes, eliminating the need for duplicate backend discovery between the operator and runtime.

Changes:

  • Introduces StatusReporter interface with ReportStatus() and Start() methods returning shutdown functions
  • Adds Status model types (Phase, Conditions, DiscoveredBackends) and ToCRDStatus() mapping method
  • Implements LoggingReporter for CLI mode that logs status at Debug level
  • Integrates status reporter lifecycle into vMCP server with shutdown function pattern

Reviewed changes

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

Show a summary per file
File Description
pkg/vmcp/types.go Adds Status model, Phase constants, Condition constants, DiscoveredBackend type with DeepCopy methods, and ToCRDStatus() conversion method
pkg/vmcp/status/reporter.go Defines StatusReporter interface with ReportStatus and Start methods
pkg/vmcp/status/logging_reporter.go Implements LoggingReporter for CLI mode with debug-level logging
pkg/vmcp/status/logging_reporter_test.go Tests for LoggingReporter covering basic functionality and nil status handling
pkg/vmcp/status/doc.go Package documentation for status reporting abstraction
pkg/vmcp/server/server.go Integrates StatusReporter into server lifecycle with shutdownFuncs pattern
pkg/vmcp/server/server_test.go Adds tests for reporter lifecycle integration and stub reporter for testing
cmd/vmcp/app/commands.go Creates LoggingReporter instance for CLI mode
cmd/thv-operator/api/v1alpha1/virtualmcpserver_types.go Aliases DiscoveredBackend to canonical pkg/vmcp definition
cmd/thv-operator/controllers/virtualmcpserver_controller.go Uses ToCRDStatus() method to simplify status mapping
cmd/thv-operator/controllers/virtualmcpserver_discover_backends_test.go Updates test assertions to use BackendStatus constants
cmd/thv-operator/api/v1alpha1/zz_generated.deepcopy.go Removes autogenerated DeepCopy methods (now in pkg/vmcp/types.go)
docs/arch/10-virtual-mcp-architecture.md Documents status reporting design and integration

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

Copy link
Contributor

@yrobla yrobla left a comment

Choose a reason for hiding this comment

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

please review copilot's comments + some of my pending comments

@4t8dd
Copy link
Contributor Author

4t8dd commented Jan 20, 2026

wait.
"Unauthenticated" is a reason why a backend is unavailable, not a status itself:

  • Status: ready, degraded, unavailable, unknown (describes current state)
  • Reason: unauthenticated, connection refused, timeout, etc. (describes why)
    I prefer not to add it as a status case here.

@4t8dd 4t8dd force-pushed the issue-3147-status-reporter branch from 202016c to 934a00f Compare January 20, 2026 13:59
@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 20, 2026
@4t8dd
Copy link
Contributor Author

4t8dd commented Jan 20, 2026

@JAORMX no problem. I also want to make this before my holiday soon.

@4t8dd 4t8dd force-pushed the issue-3147-status-reporter branch from 934a00f to 4805e90 Compare January 20, 2026 14:09
@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 20, 2026
@4t8dd 4t8dd force-pushed the issue-3147-status-reporter branch 2 times, most recently from efc52bb to ff8721f Compare January 22, 2026 23:54
@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 22, 2026
Implement StatusReporter interface and LoggingReporter to enable vMCP runtime
to report operational status (phase, discovered backends, health conditions).

This commit provides:
- Reporter interface with ReportStatus() and Start() methods
- Status model: Phase, Conditions, DiscoveredBackends
- LoggingReporter: Logs status updates for debugging (no persistence)
- Integration into vMCP server lifecycle with shutdown function pattern

The interface is designed to support future implementations that persist status
to different backends. This PR includes only the logging implementation for CLI
mode.

Integration:
- vMCP server calls reporter.Start() which returns shutdown function
- CLI mode uses LoggingReporter with logging disabled by default
- Status reporting is optional (nil reporter = disabled)

Related: stacklok#3147
Signed-off-by: 4t8dd <wanger.xyz@gmail.com>
@4t8dd 4t8dd force-pushed the issue-3147-status-reporter branch from ff8721f to 8f1ce60 Compare January 23, 2026 00:05
@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 23, 2026
@yrobla
Copy link
Contributor

yrobla commented Jan 23, 2026

@4t8dd thanks for your hard work and patience there, merging!

@yrobla yrobla merged commit e22900f into stacklok:main Jan 23, 2026
35 checks passed
@4t8dd 4t8dd deleted the issue-3147-status-reporter branch January 23, 2026 09:03
therealnb pushed a commit that referenced this pull request Jan 23, 2026
Implement StatusReporter interface and LoggingReporter to enable vMCP runtime
to report operational status (phase, discovered backends, health conditions).

This commit provides:
- Reporter interface with ReportStatus() and Start() methods
- Status model: Phase, Conditions, DiscoveredBackends
- LoggingReporter: Logs status updates for debugging (no persistence)
- Integration into vMCP server lifecycle with shutdown function pattern

The interface is designed to support future implementations that persist status
to different backends. This PR includes only the logging implementation for CLI
mode.

Integration:
- vMCP server calls reporter.Start() which returns shutdown function
- CLI mode uses LoggingReporter with logging disabled by default
- Status reporting is optional (nil reporter = disabled)

Related: #3147

Signed-off-by: 4t8dd <wanger.xyz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large PR: 600-999 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants