Skip to content

VMCP: Delete rawConfig - #3155

Merged
jerm-dro merged 5 commits into
mainfrom
jerm/2025-12-23-delete-raw-config
Jan 5, 2026
Merged

jerm-dro merged 5 commits into
mainfrom
jerm/2025-12-23-delete-raw-config

Conversation

@jerm-dro

@jerm-dro jerm-dro commented Dec 23, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Deleted rawConfig and unmarshal directly to config.Config with strict mode.

Step 1 of #3125

Changes to pkg/vmcp/config/yaml_loader.go:

  1. Removed all raw types :

    • rawConfig, rawIncomingAuth, rawOutgoingAuth, rawBackendAuthStrategy
    • rawHeaderInjectionAuth, rawTokenExchangeAuth, rawAggregation
    • rawConflictResolutionConfig, rawWorkloadToolConfig, rawToolOverride
    • rawCompositeTool, rawWorkflowStep, rawStepErrorHandling
    • rawElicitationResponse, rawOutputConfig, rawOutputProperty
  2. Rewrote Load() to use strict unmarshalling:

    decoder := yaml.NewDecoder(bytes.NewReader(data))
    decoder.KnownFields(true) // Reject unknown fields
    if err := decoder.Decode(&cfg); err != nil { ... }
  3. Replaced transform* methods with process* post-processing:

    • processOutgoingAuth() - resolves environment variables
    • processBackendAuthStrategy() - validates and resolves env vars for auth strategies
    • processCompositeTool() - validates JSON Schema parameters
    • processWorkflowStep() - applies type inference and default timeouts

Changes to pkg/vmcp/config/config.go:

Added yaml: tags to all struct fields that were missing them (to support yaml.v3 strict mode):

  • CompositeToolConfig fields
  • WorkflowStepConfig fields
  • StepErrorHandling fields
  • ElicitationResponseConfig fields
  • AggregationConfig.ExcludeAllTools
  • WorkloadToolConfig.ExcludeAll

Test updates:

Updated test files to work with the new direct unmarshalling approach:

Result:

  • 596 → 225 lines in yaml_loader.go (~62% reduction)
  • Strict unmarshalling catches unknown fields at parse time
  • Config types are now the single source of truth for YAML parsing

Large PR Justification

This is deleting over 1000 lines of code in order to simplify our config. This change cannot be made smaller.

@github-actions github-actions Bot added the size/XL Extra large PR: 1000+ lines changed label Dec 23, 2025

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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.

@codecov

codecov Bot commented Dec 23, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.13%. Comparing base (c276d6b) to head (5011ca8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/thv-operator/pkg/vmcpconfig/converter.go 0.00% 1 Missing and 1 partial ⚠️
pkg/vmcp/config/yaml_loader.go 98.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3155      +/-   ##
==========================================
- Coverage   57.22%   57.13%   -0.10%     
==========================================
  Files         346      346              
  Lines       34452    34304     -148     
==========================================
- Hits        19716    19598     -118     
+ Misses      13099    13079      -20     
+ Partials     1637     1627      -10     

☔ 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 Dec 23, 2025
@jerm-dro
jerm-dro force-pushed the jerm/2025-12-23-delete-raw-config branch from 3f51062 to dae6fc0 Compare January 5, 2026 17:12
@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 5, 2026
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]>
@jerm-dro
jerm-dro force-pushed the jerm/2025-12-23-delete-raw-config branch from 3716b45 to e463056 Compare January 5, 2026 17:51
@jerm-dro
jerm-dro marked this pull request as ready for review January 5, 2026 17:52
@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 5, 2026
@jerm-dro
jerm-dro requested review from JAORMX, dmjb, jhrozek and yrobla January 5, 2026 17:52
@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 5, 2026

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inconsistencies in snake_case vs camelCase are being addressed separately.

@jerm-dro
jerm-dro merged commit 5fd5ef6 into main Jan 5, 2026
@jerm-dro
jerm-dro deleted the jerm/2025-12-23-delete-raw-config branch January 5, 2026 21:19
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.

2 participants