Skip to content

Replace ReferencingServers with ReferencingWorkloads on MCPExternalAuthConfig#4507

Merged
ChrisJBurns merged 1 commit intomainfrom
migrate-externalauthconfig-referencing-workloads
Apr 3, 2026
Merged

Replace ReferencingServers with ReferencingWorkloads on MCPExternalAuthConfig#4507
ChrisJBurns merged 1 commit intomainfrom
migrate-externalauthconfig-referencing-workloads

Conversation

@ChrisJBurns
Copy link
Copy Markdown
Collaborator

Summary

Migrates MCPExternalAuthConfig from ReferencingServers []string to ReferencingWorkloads []WorkloadReference, aligning it with the structured workload reference pattern established on MCPOIDCConfig in #4492. This enables the status field to distinguish between different workload kinds (MCPServer, VirtualMCPServer, MCPRemoteProxy) rather than assuming all referencing workloads are MCPServers.

Partial fix for #4491

Type of change

  • Enhancement to an existing feature

Changes

File Changes
mcpexternalauthconfig_types.go Replace ReferencingServers []string with ReferencingWorkloads []WorkloadReference, update printer column
mcpexternalauthconfig_controller.go Add findReferencingWorkloads(), update reconcile/deletion logic to use structured refs with DeletionBlocked condition
mcpexternalauthconfig_controller_test.go Update assertions to use WorkloadReference{Kind, Name} structs
mcpexternalauthconfig_controller_integration_test.go Update assertions to use WorkloadReference{Kind, Name} structs
Generated files Regenerated deepcopy, CRD YAML manifests

Test plan

  • Unit tests updated and passing (go test ./cmd/thv-operator/controllers/... -run MCPExternalAuthConfig)
  • Integration tests updated
  • CRD manifests regenerated via task gen

Special notes for reviewers

Follows the exact pattern from #4492 (MCPOIDCConfig migration). MCPToolConfig migration is in a separate PR. MCPTelemetryConfig will follow separately.

Generated with Claude Code

@github-actions github-actions bot added the size/M Medium PR: 300-599 lines changed label Apr 2, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 41.17647% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.07%. Comparing base (a78d9bf) to head (d7d12b9).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...or/controllers/mcpexternalauthconfig_controller.go 41.17% 37 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4507      +/-   ##
==========================================
+ Coverage   69.04%   69.07%   +0.02%     
==========================================
  Files         502      502              
  Lines       51909    51950      +41     
==========================================
+ Hits        35843    35886      +43     
+ Misses      13279    13277       -2     
  Partials     2787     2787              

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

@ChrisJBurns ChrisJBurns force-pushed the migrate-externalauthconfig-referencing-workloads branch from 754895e to ab435b3 Compare April 2, 2026 18:08
@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 Apr 2, 2026
…PExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in #4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes #4491

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChrisJBurns ChrisJBurns force-pushed the migrate-externalauthconfig-referencing-workloads branch from ab435b3 to d7d12b9 Compare April 2, 2026 18:18
@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 Apr 2, 2026
@ChrisJBurns ChrisJBurns added the breaks-compatibility A change that breaks compatibility with a previous release label Apr 2, 2026
@ChrisJBurns ChrisJBurns merged commit ea7e3ad into main Apr 3, 2026
70 of 71 checks passed
@ChrisJBurns ChrisJBurns deleted the migrate-externalauthconfig-referencing-workloads branch April 3, 2026 13:44
MatteoManzoni pushed a commit to DocPlanner/toolhive that referenced this pull request Apr 4, 2026
…thConfig (stacklok#4507)

Replace ReferencingServers with structured ReferencingWorkloads on MCPExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in stacklok#4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes stacklok#4491

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-compatibility A change that breaks compatibility with a previous release size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants