Repository navigation
vMCP: camelCase the config - #3195
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3195 +/- ##
==========================================
- Coverage 57.10% 57.09% -0.01%
==========================================
Files 346 346
Lines 34304 34304
==========================================
- Hits 19588 19587 -1
Misses 13096 13096
- Partials 1620 1621 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jeremy Drouillard <[email protected]>
Signed-off-by: Jeremy Drouillard <[email protected]>
Signed-off-by: Jeremy Drouillard <[email protected]>
Signed-off-by: Jeremy Drouillard <[email protected]>
Signed-off-by: Jeremy Drouillard <[email protected]>
Signed-off-by: Jeremy Drouillard <[email protected]>
Signed-off-by: Jeremy Drouillard <[email protected]>
f222548 to
37cb863
Compare
Signed-off-by: Jeremy Drouillard <[email protected]>
|
The camelCase migration looks good but I noticed it's not complete - there are still some mismatches between the CRDs and CLI that will break config conversion.
Strategy types: The constants in Test: To fix this completely you'd need to update:
That'll ripple through ~40 test files that use these strings directly, plus docs and examples. Do you want to include these fixes in this PR or handle them separately? |
What validation are you referring to? I don't think there will be validation errors with your example. I only modified the validator error strings when they reference the field names. I did not change assertions about the values. I was planning on updating the values in a follow-up PR, because I found mixing the keys and values into the same PR was also confusing. edit: I do see there are some issues with the kubebuilder enums not matching the casing on the config side. That will continue to work, because this PR doesn't delete the conversion code. Before deleting the conversion code, we'll have to make these values the same. |
The camelCase config migration (PR #3195) accidentally changed the accepted enum value from "best_effort" to "bestEffort" in the validator, but the CRD still defines the enum as "best_effort". This made it impossible to enable best-effort partial failure mode — the CRD blocks "bestEffort" at admission and the validator blocks "best_effort" at runtime. Fixes #4856 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The camelCase config migration (PR #3195) accidentally changed the accepted enum value from "best_effort" to "bestEffort" in the validator, but the CRD still defines the enum as "best_effort". This made it impossible to enable best-effort partial failure mode — the CRD blocks "bestEffort" at admission and the validator blocks "best_effort" at runtime. Fixes #4856 Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Summary
This PR standardizes all configuration struct field tags to use camelCase naming, making the configuration format consistent and Kubernetes-friendly. This is part of the ongoing effort to simplify the VirtualMCPServer configuration architecture (#3125).
Changes
Configuration Structs
pkg/vmcp/config/config.go: Updated alljsonandyamltags to use camelCase (e.g.,groupRef,incomingAuth,conflictResolution,compositeTools)pkg/vmcp/auth/types/types.go: Updated field tags to camelCase while keeping strategy type values as snake_case (header_injection,token_exchange)pkg/telemetry/config.go: Added missingyamltags (previously only hadjsontags)pkg/audit/config.go: Updated field tags to camelCase (eventTypes,excludeEventTypes,includeRequestData, etc.)Testing
pkg/vmcp/config/config_test.go: AddedTestConfigFieldTagsAreCamelCasethat recursively validates all Config fields have yaml tags with proper camelCase namingDocumentation
cmd/vmcp/README.md: Updated all YAML examples to camelCaseexamples/vmcp-config.yaml: Updated complete example configdocs/middleware.md: Updated audit configuration examples and tableKey Design Decisions
Keys are camelCase, values remain snake_case: Field names like
incomingAuth,tokenExchangeuse camelCase, but strategy type values like"header_injection"and"token_exchange"remain snake_case. Changing the values is riskier and should be its own change.Consistent json/yaml tags: All fields now have matching
jsonandyamltags to ensure consistent serialization regardless of format.Automated validation: The new
TestConfigFieldTagsAreCamelCasetest prevents future regressions by checking all exported fields in the Config struct tree.Related Issues