-
Notifications
You must be signed in to change notification settings - Fork 171
Add StatusReporter abstraction for vMCP runtime status reporting #3250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Implement platform-agnostic StatusReporter interface to enable vMCP runtime to report operational status. This is the foundation for eliminating duplicate backend discovery work between the operator and vMCP runtime. Closes: #3147
There was a problem hiding this 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 introduces a platform-agnostic StatusReporter abstraction that enables the vMCP runtime to report operational status. The implementation provides a foundation for eliminating duplicate backend discovery work between the operator and vMCP runtime by allowing the runtime to directly communicate its state.
Changes:
- Added StatusReporter interface and RuntimeStatus types with comprehensive status model
- Implemented NoOpReporter for CLI/local development environments
- Integrated StatusReporter into vMCP server with lifecycle management
- Provided comprehensive documentation and test coverage
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/vmcp/status/types.go | Defines RuntimeStatus data model with Phase, Condition, and DiscoveredBackend types following Kubernetes conventions |
| pkg/vmcp/status/reporter.go | Declares platform-agnostic Reporter interface with Report, Start, and Stop methods |
| pkg/vmcp/status/noop_reporter.go | Implements no-operation reporter for CLI/local development environments |
| pkg/vmcp/status/noop_reporter_test.go | Provides comprehensive test coverage including edge cases and concurrency tests |
| pkg/vmcp/status/README.md | Documents architecture, design principles, usage patterns, and future implementations |
| pkg/vmcp/server/server.go | Integrates StatusReporter field and lifecycle management in Start/Stop methods |
| cmd/vmcp/app/commands.go | Initializes NoOpReporter for CLI mode in server configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3250 +/- ##
==========================================
- Coverage 56.97% 56.96% -0.02%
==========================================
Files 351 352 +1
Lines 34962 34978 +16
==========================================
+ Hits 19919 19924 +5
- Misses 13387 13396 +9
- Partials 1656 1658 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jhrozek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good implementation of the StatusReporter abstraction. The interface design and NoOpReporter implementation look solid. A few observations and questions below.
| @@ -0,0 +1,299 @@ | |||
| # Status Reporting Package | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Observation: ToolHive typically doesn't include package-level README.md files. Most packages use doc.go for package documentation instead.
Looking at pkg/, this is one of only two READMEs (the other being in testdata). Consider whether this 299-line README could be trimmed down to essential usage info in doc.go comments, or if there's a strong reason to keep it as a README.
Not blocking, just flagging for consistency with the rest of the codebase.
| // Start status reporter if configured | ||
| // TODO: Implement periodic status reporting with statusFunc | ||
| // For now, reporter is initialized but not started (will be implemented when needed) | ||
| if s.statusReporter != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about lifecycle: The reporter's Start() method is not called here (just a debug log), but Stop() IS called during shutdown (line 655).
This asymmetric lifecycle works fine for NoOpReporter, but could be confusing when implementing a real reporter like K8sReporter - someone might forget to add the Start() call.
Is there a plan to complete this integration, or is it intentionally deferred? If deferred, consider adding a reference to a follow-up issue in the TODO comment.
| } | ||
|
|
||
| // Start status reporter if configured | ||
| // TODO: Implement periodic status reporting with statusFunc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about statusFunc: When periodic status reporting is implemented, will the statusFunc callback share logic with buildStatusResponse() (used by the /status HTTP endpoint)?
Asking to ensure consistency - both sources of status should report the same data to avoid confusion during debugging.
Implement platform-agnostic StatusReporter interface to enable vMCP runtime to report operational status. This is the foundation for eliminating duplicate backend discovery work between the operator and vMCP runtime.
Closes: #3147