Skip to content

Conversation

@yrobla
Copy link
Contributor

@yrobla yrobla commented Nov 27, 2025

when using the discovered mode on vmcp, we discovered that it was not working for several problems. Add a fix and add proper testing to validate

Large PR Justification

This is a complete fix of the feature, including unit tests. The fixes are atomic and need to come together to solve the issue

@yrobla yrobla requested review from Copilot and jhrozek November 27, 2025 16:33
Copy link
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 the size/XL Extra large PR: 1000+ lines changed label Nov 27, 2025
@yrobla yrobla requested review from JAORMX and amirejaz November 27, 2025 16:34
@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 43.90244% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.44%. Comparing base (c73c5ef) to head (7cf6767).

Files with missing lines Patch % Lines
...perator/controllers/virtualmcpserver_vmcpconfig.go 42.46% 35 Missing and 7 partials ⚠️
pkg/vmcp/client/client.go 55.55% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2769      +/-   ##
==========================================
- Coverage   56.48%   56.44%   -0.05%     
==========================================
  Files         319      319              
  Lines       30943    31022      +79     
==========================================
+ Hits        17479    17510      +31     
- Misses      11960    12000      +40     
- Partials     1504     1512       +8     

☔ 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.

Copilot finished reviewing on behalf of yrobla November 27, 2025 16:37
Copy link
Contributor

Copilot AI left a 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 fixes token exchange for discovery mode in the Virtual MCP (vmcp) system by addressing configuration format issues and adding comprehensive end-to-end testing with mock servers deployed as Kubernetes resources.

Key Changes:

  • Fixes vmcp configuration YAML format conversion to use a flat token_cache.config structure instead of separate memory/redis sections, aligning with the YAML loader's expected format
  • Adds discovery logic for incoming OIDC configuration from backend MCPServers, enabling vMCP to authenticate to backends that require OIDC
  • Implements comprehensive E2E tests with mock HTTP, OAuth token exchange, and OIDC servers deployed as Kubernetes pods to validate authentication flows

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/e2e/thv-operator/virtualmcp/virtualmcp_auth_discovery_test.go Replaces simple httptest mock with Kubernetes-deployed mock servers (HTTP, OAuth, OIDC) for realistic E2E testing of auth discovery and token exchange flows
test/e2e/thv-operator/virtualmcp/helpers.go Adds GetPodLogs helper function to retrieve logs from specific pods for debugging test failures
test/e2e/oidc_mock.go Implements proper JWKS endpoint with RSA public key export and adds client_credentials grant type support
pkg/vmcp/workloads/k8s.go Adds discoverIncomingOIDCConfig method to discover and populate OIDC configuration from backend MCPServers, enabling vMCP→backend authentication
pkg/vmcp/types.go Adds IncomingOIDCConfig field to Backend and BackendTarget types for storing discovered OIDC configuration
pkg/vmcp/registry.go Propagates IncomingOIDCConfig field when converting Backend to BackendTarget
cmd/thv-operator/controllers/virtualmcpserver_vmcpconfig.go Implements convertToCLIFormat to transform Go config structs into vmcp CLI-compatible YAML format with flat token_cache.config structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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 Nov 28, 2025
@github-actions github-actions bot dismissed their stale review November 28, 2025 08:45

Large PR justification has been provided. Thank you!

@github-actions
Copy link
Contributor

✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review.

@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from 7c3263b to 68da4c9 Compare November 28, 2025 10:11
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from 68da4c9 to b3ff79c Compare November 28, 2025 10:13
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from b3ff79c to 28615db Compare November 28, 2025 10:36
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from 28615db to bfe83b2 Compare November 28, 2025 10:39
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from bfe83b2 to 5c6563b Compare November 28, 2025 11:32
@github-actions github-actions bot removed the size/XL Extra large PR: 1000+ lines changed label Nov 28, 2025
@github-actions github-actions bot added the size/XL Extra large PR: 1000+ lines changed label Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from 5c6563b to 03e0d32 Compare November 28, 2025 11:34
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch 2 times, most recently from 18a756b to d0c5bf0 Compare November 28, 2025 15:40
when using the discovered mode on vmcp, we discovered that it was
not working for several problems. Add a fix and add proper testing
to validate
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from d0c5bf0 to 47b3af7 Compare November 28, 2025 15:42
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from 47b3af7 to a27d766 Compare November 28, 2025 15:46
@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 Nov 28, 2025
@yrobla yrobla requested review from Copilot and jhrozek November 28, 2025 15:48
Copilot finished reviewing on behalf of yrobla November 28, 2025 15:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yrobla yrobla force-pushed the fix/auth_discovery_test branch from a27d766 to c7327cd Compare November 28, 2025 16:02
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from c7327cd to 76eec1d Compare November 28, 2025 16:03
@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 Nov 28, 2025
@yrobla yrobla force-pushed the fix/auth_discovery_test branch from 76eec1d to 7cf6767 Compare November 28, 2025 16: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 Nov 28, 2025
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.

4 participants