Skip to content

Vmcp: Add but do not use app config to the CRD #3203

Merged
jerm-dro merged 15 commits intomainfrom
jerm/2026-01-06-add-vmcp-config-to-spec
Jan 7, 2026
Merged

Vmcp: Add but do not use app config to the CRD #3203
jerm-dro merged 15 commits intomainfrom
jerm/2026-01-06-add-vmcp-config-to-spec

Conversation

@jerm-dro
Copy link
Copy Markdown
Contributor

@jerm-dro jerm-dro commented Jan 6, 2026

Summary

This PR adds the vmcpconfig.Config to the VirtualMCPServerSpec, but does not use it. This sets up subsequent work to migrate the existing functionality (e.g. defaults, validation, discovery) built up around the other VirtualMCPServerSpec fields onto their equivalent fields in vmcpconfig.Config.

Supports #3125

Large PR Justification

This PR is large in lines-of-code, but is conceptually small. This PR contains the minimal changes to add config.Config to the VirtualMCPServerSpec.

All changes are motivated by errors from task operator-generate && task operator-manifests && task lint.

Changes

Migrate from any to a CRD-compatible json.Map or json.Any.

The CRD code generation does not support any types in the app config object. The simplest thing to do would be replace all uses with runtime.RawExtension. However, that makes the code that previously depended on map[string]any less typesafe and more verbose, since it must unmarshall the raw contents manually. Consequently, I introduced a pkg/json/any.go that is simpler to work with. Specifically, the json.Map is a typesafe and CRD-compatible map[string]any.

Many test files were updated to use this new type rather than map[string]any.

Use string rather than float for SamplingRate

This one is straightforward. Sampling rate was previously a float which is unsupported by kubebuilder. This also required regenerating the swagger docs.

Generate DeepCopy methods

Kubebuilder requires the config types have DeepCopy methods. Changes to the taskfile and existing config objects ensures this code is generated.

Next Steps

After this change, I will incrementally migrate the existing VirtualMCPServerSpec fields to use their Config equivalent. These migrations are not necessarily straightforward, so I will be attacking them one-by-one to ensure functionality is not lost or broken during the migration.

@github-actions github-actions bot added the size/XL Extra large PR: 1000+ lines changed label Jan 6, 2026
Copy link
Copy Markdown
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.

@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 6, 2026
@jerm-dro jerm-dro force-pushed the jerm/2026-01-06-add-vmcp-config-to-spec branch from e46aa5c to 7d66da8 Compare January 6, 2026 19:28
@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 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 22.15569% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.04%. Comparing base (1d707d8) to head (81a8d6c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/json/any.go 0.00% 96 Missing ⚠️
pkg/vmcp/server/workflow_converter.go 52.94% 4 Missing and 4 partials ⚠️
cmd/thv-operator/pkg/vmcpconfig/converter.go 50.00% 6 Missing and 1 partial ⚠️
pkg/vmcp/composer/output_constructor.go 60.00% 5 Missing and 1 partial ⚠️
pkg/telemetry/config.go 64.28% 4 Missing and 1 partial ⚠️
pkg/vmcp/composer/output_validator.go 0.00% 4 Missing and 1 partial ⚠️
pkg/vmcp/config/yaml_loader.go 60.00% 1 Missing and 1 partial ⚠️
pkg/vmcp/config/validator.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3203      +/-   ##
==========================================
- Coverage   57.24%   57.04%   -0.20%     
==========================================
  Files         347      348       +1     
  Lines       34485    34608     +123     
==========================================
+ Hits        19740    19743       +3     
- Misses      13104    13223     +119     
- Partials     1641     1642       +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.

@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 6, 2026
@jerm-dro jerm-dro requested a review from jhrozek January 6, 2026 20:37
@jerm-dro jerm-dro marked this pull request as ready for review January 6, 2026 20:37
@jerm-dro jerm-dro requested review from JAORMX and yrobla January 6, 2026 22:06
Copy link
Copy Markdown
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.

overall great, some nits inline around the required values and omitempty and questions around error handling.

Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
@jerm-dro jerm-dro force-pushed the jerm/2026-01-06-add-vmcp-config-to-spec branch from 1caf867 to f26f2c7 Compare January 7, 2026 15:57
@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 7, 2026
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
@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 7, 2026
@jerm-dro jerm-dro requested review from dmjb and jhrozek January 7, 2026 17:01
Copy link
Copy Markdown
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.

apologies for the delay, I saw the updated PR during the day and thought I'd acked it but forgot

@jerm-dro jerm-dro merged commit ab329ce into main Jan 7, 2026
37 checks passed
@jerm-dro jerm-dro deleted the jerm/2026-01-06-add-vmcp-config-to-spec branch January 7, 2026 22:31
jerm-dro added a commit that referenced this pull request Jan 8, 2026
Summary
Stacked on #3203

This migrates the group spec field to use the config data.

Supports #3125

Changes
Delete the legacy groupRef field on the spec.
Add kubebuilder annotations
Update documentation, examples, and tests to match new schema

---------

Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
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.

3 participants