• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 24408864584

14 Apr 2026 03:49PM UTC coverage: 65.594% (-0.06%) from 65.649%
24408864584

push

github

web-flow
Change GroupRef from bare string to typed MCPGroupRef struct (#4809)

* Change GroupRef from bare string to typed MCPGroupRef struct

GroupRef was a bare string while every other cross-CRD reference
(ExternalAuthConfigRef, ToolConfigRef, AuthServerRef, EmbeddingServerRef)
uses a typed struct. This inconsistency prevented extending GroupRef
with additional fields (like namespace) without a breaking change.

Define MCPGroupRef struct with Name field and nil-safe GetName() helper.
Replace GroupRef string with *MCPGroupRef on MCPServerSpec,
MCPRemoteProxySpec, MCPServerEntrySpec, and add a new top-level GroupRef
field on VirtualMCPServerSpec that takes precedence over the deprecated
config.groupRef string path.

Internal types (vmcpserver.Config, StatusResponse, BackendReconciler,
config.Config) remain as strings since they are not CRD API types.

This is a breaking wire-format change (groupRef: "name" becomes
groupRef: {name: "name"}) that must happen before v1beta1.

Closes #4634

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review feedback on MCPGroupRef refactoring

- Add nil guard to MCPServerEntry validateGroupRef using GetName()
  instead of direct .Name access to prevent potential panic
- Add unit tests for MCPGroupRef.GetName() and
  VirtualMCPServer.ResolveGroupName() covering precedence logic
- Normalize nil-check pattern across all field index extractors to
  use GetName() == "" (handles both nil and empty name)
- Mark config.Config.Group as optional and deprecated since
  spec.groupRef is now the preferred path
- Improve Validate() error message to mention both spec.groupRef
  and config.groupRef paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update missed example and docs for MCPGroupRef wire format

- Fix vmcp_with_telemetry_ref.yaml (missed in initial pass)
- Update virtualmcpserver-api.md to document spec.groupRef as primary
  field and update all YAML examples to struct f... (continued)

71 of 113 new or added lines in 12 files covered. (62.83%)

53 existing lines in 9 files now uncovered.

57073 of 87010 relevant lines covered (65.59%)

62.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.38
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc