Skip to content

feat: Refactor mcpServer.matchList config generation logic #2207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

CH3CHO
Copy link
Collaborator

@CH3CHO CH3CHO commented May 9, 2025

Ⅰ. Describe what this PR did

  1. Introduce interfaces of McpServerProvider and McpRouteProviderAware and utilize them for config collection.
  2. Support discovering mcp-sse type of MCP Servers from Nacos 3.x.
  3. Support configuring MatchRules using annotations on Ingress resources.
    • higress.io/mcp-server
    • higress.io/mcp-server-match-rule-domains
    • higress.io/mcp-server-match-rule-type
    • higress.io/mcp-server-match-rule-value
    • higress.io/mcp-server-upstream-type
    • higress.io/mcp-server-enable-path-rewrite
    • higress.io/mcp-server-path-rewrite-prefix
    • Sample:
      image

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2025

Codecov Report

Attention: Patch coverage is 61.94030% with 51 lines in your changes missing coverage. Please review.

Project coverage is 46.06%. Comparing base (ef31e09) to head (d1fffa2).
Report is 501 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ingress/kube/configmap/mcp_server.go 32.43% 24 Missing and 1 partial ⚠️
pkg/ingress/config/ingress_config.go 5.26% 18 Missing ⚠️
pkg/ingress/kube/configmap/controller.go 0.00% 4 Missing ⚠️
pkg/ingress/kube/annotations/mcpserver.go 93.75% 2 Missing and 1 partial ⚠️
pkg/ingress/kube/annotations/annotations.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2207       +/-   ##
===========================================
+ Coverage   35.91%   46.06%   +10.15%     
===========================================
  Files          69       81       +12     
  Lines       11576    13010     +1434     
===========================================
+ Hits         4157     5993     +1836     
+ Misses       7104     6671      -433     
- Partials      315      346       +31     
Files with missing lines Coverage Δ
pkg/ingress/kube/configmap/global.go 27.35% <ø> (ø)
pkg/ingress/kube/configmap/gzip.go 45.29% <ø> (ø)
pkg/ingress/kube/configmap/tracing.go 2.17% <ø> (-0.35%) ⬇️
pkg/ingress/kube/mcpserver/provider.go 100.00% <100.00%> (ø)
pkg/ingress/kube/annotations/annotations.go 30.69% <0.00%> (-0.94%) ⬇️
pkg/ingress/kube/annotations/mcpserver.go 93.75% <93.75%> (ø)
pkg/ingress/kube/configmap/controller.go 0.00% <0.00%> (ø)
pkg/ingress/config/ingress_config.go 12.63% <5.26%> (-1.25%) ⬇️
pkg/ingress/kube/configmap/mcp_server.go 87.36% <32.43%> (ø)

... and 71 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CH3CHO CH3CHO requested a review from rinfx as a code owner May 10, 2025 05:54
CH3CHO added 3 commits May 10, 2025 16:56
1. Introduce interfaces of McpServerProvider and McpRouteProviderAware and utilize them for config collection.
2. Support configuring MatchRules using annotations on Ingress resources.
@CH3CHO CH3CHO force-pushed the feat/mcp-annotations branch from e73dbab to e0fb28b Compare May 10, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants