Skip to content

Report discovered auth config errors via conditions#3822

Merged
yrobla merged 3 commits intomainfrom
issue-2838
Feb 18, 2026
Merged

Report discovered auth config errors via conditions#3822
yrobla merged 3 commits intomainfrom
issue-2838

Conversation

@yrobla
Copy link
Contributor

@yrobla yrobla commented Feb 13, 2026

Enhance VirtualMCPServer controller to continue in degraded mode when discovered authentication configurations fail to convert, while exposing failures via Kubernetes status conditions for better observability.

Previously, when authentication configuration discovery failed (e.g., missing MCPExternalAuthConfig), errors were silently skipped with only log messages. Users had no visibility into these failures via kubectl or the Kubernetes API.

Closes: #2838

Large PR Justification

This is a complete and isolated PR, including complete tests. Cannot be split.

@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Feb 13, 2026
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Feb 13, 2026
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 81.62162% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.89%. Comparing base (e4d6d52) to head (217802b).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...perator/controllers/virtualmcpserver_vmcpconfig.go 64.40% 14 Missing and 7 partials ⚠️
...perator/controllers/virtualmcpserver_controller.go 89.81% 9 Missing and 2 partials ⚠️
...v-operator/pkg/virtualmcpserverstatus/collector.go 88.88% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3822      +/-   ##
==========================================
+ Coverage   66.80%   66.89%   +0.08%     
==========================================
  Files         444      444              
  Lines       44083    44226     +143     
==========================================
+ Hits        29451    29583     +132     
- Misses      12325    12335      +10     
- Partials     2307     2308       +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.

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 improves observability for discovered outgoing auth configuration failures in the VirtualMCPServer controller by collecting non-fatal conversion/discovery errors and surfacing them via Kubernetes status conditions, allowing reconciliation to proceed in a degraded mode.

Changes:

  • Add a SetAuthConfigCondition API on the VirtualMCPServer status manager to support dynamically-typed, per-backend auth config conditions.
  • Extend discovered ExternalAuthConfig handling to return non-fatal errors ([]AuthConfigError) instead of only logging/skipping.
  • Wire discovered auth conversion errors into status condition updates during ConfigMap generation, and update unit tests for the new method signatures.

Reviewed changes

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

Show a summary per file
File Description
cmd/thv-operator/pkg/virtualmcpserverstatus/types.go Extends StatusManager interface with SetAuthConfigCondition for granular conditions.
cmd/thv-operator/pkg/virtualmcpserverstatus/collector.go Implements SetAuthConfigCondition in the status collector.
cmd/thv-operator/pkg/virtualmcpserverstatus/mocks/mock_collector.go Updates gomock implementation to include SetAuthConfigCondition.
cmd/thv-operator/controllers/virtualmcpserver_vmcpconfig.go Passes a StatusManager into ConfigMap reconciliation and sets discovered-auth conditions.
cmd/thv-operator/controllers/virtualmcpserver_controller.go Returns discovered auth errors from discovery/build steps and adds condition-setting helper.
cmd/thv-operator/controllers/virtualmcpserver_vmcpconfig_test.go Adapts tests to new ensureVmcpConfigConfigMap signature; adds a no-op status manager helper.
cmd/thv-operator/controllers/virtualmcpserver_externalauth_test.go Updates tests for new buildOutgoingAuthConfig return values and asserts discovered errors.

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

@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/S Small PR: 100-299 lines changed labels Feb 13, 2026
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Feb 13, 2026
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Feb 13, 2026
@yrobla yrobla requested a review from Copilot February 13, 2026 15:52
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 7 out of 7 changed files in this pull request and generated 1 comment.


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

@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Feb 13, 2026
@yrobla yrobla self-assigned this Feb 13, 2026
@github-actions github-actions bot removed the size/M Medium PR: 300-599 lines changed label Feb 16, 2026
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 2 comments.


💡 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/L Large PR: 600-999 lines changed labels Feb 16, 2026
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 size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Feb 17, 2026
@github-actions github-actions bot removed the size/XL Extra large PR: 1000+ lines changed label Feb 17, 2026
@github-actions github-actions bot added the size/XL Extra large PR: 1000+ lines changed label Feb 17, 2026
@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 Feb 17, 2026
@github-actions github-actions bot dismissed their stale review February 17, 2026 10:54

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 Feb 17, 2026
@yrobla yrobla requested a review from Copilot February 17, 2026 11:26
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 9 out of 9 changed files in this pull request and generated 3 comments.


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

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 9 out of 9 changed files in this pull request and generated 6 comments.


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

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 9 out of 9 changed files in this pull request and generated 4 comments.


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

taskbot and others added 3 commits February 18, 2026 09:42
Enhance VirtualMCPServer controller to continue in degraded mode when
discovered authentication configurations fail to convert, while
exposing failures via Kubernetes status conditions for better
observability.

Previously, when authentication configuration discovery failed (e.g.,
missing MCPExternalAuthConfig), errors were silently skipped with only
log messages. Users had no visibility into these failures via kubectl
or the Kubernetes API.

Closes: #2838

Report discovered auth config errors via conditions

Enhance VirtualMCPServer controller to continue in degraded mode when
discovered authentication configurations fail to convert, while
exposing failures via Kubernetes status conditions for better
observability.

Previously, when authentication configuration discovery failed (e.g.,
missing MCPExternalAuthConfig), errors were silently skipped with only
log messages. Users had no visibility into these failures via kubectl
or the Kubernetes API.

Changes:
- Add AuthConfigError type to capture conversion failure context
- Modify discoverExternalAuthConfigs() to return error list instead of
  silently skipping
- Add SetAuthConfigCondition() to StatusManager for granular conditions
- Add setDiscoveredAuthConfigConditions() helper to set individual
  conditions per discovered auth error
- Update ensureVmcpConfigConfigMap() to accept statusManager and set
  conditions for auth failures
- Update all tests to pass statusManager parameter

The controller now sets DiscoveredAuthConfig-<backend-name> conditions
with status False when discovered auth configs fail, allowing users to
see issues in VirtualMCPServer status while the system continues
operating with available backends.

This addresses part of issue #2838. Future PRs will handle default and
backend-specific auth config errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.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.

Expose Conditions for Observability When Auth Config Conversion Fails

4 participants