Skip to content

Conversation

@shedfreewu
Copy link
Contributor

@shedfreewu shedfreewu commented Feb 4, 2026

fix: fix service match in tsf router.

  • 服务名、上游 ns + 服务名、其他标签,在规则转换时,都当做 source。
    • 多个服务名时,规则转换时不拆分
    • 保留 tsf 上游服务名匹配的 operator,放在路由规则 source 的 metadata 中
    • 服务名的匹配使用 RuleUtils.matchStringValue
    • source 的 metadata 会用于标签匹配,会逐个进行operator 放在 metadata 后,还需要添加一个 RuleUtils.MATCH_ALL 用于跳过后续判断
    Clipboard_Screenshot_1770186504
  • 在规则元数据中添加 TSF_SOURCES_MATCH_MODE
  • 有该标记时,需要匹配所有 source,包括 service
Clipboard_Screenshot_1770294144

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 14.63415% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.15%. Comparing base (1010137) to head (0298e70).

Files with missing lines Patch % Lines
...tencent/polaris/api/plugin/route/RoutingUtils.java 0.00% 30 Missing ⚠️
...t/polaris/plugins/router/rule/RuleBasedRouter.java 54.54% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #689      +/-   ##
============================================
- Coverage     20.16%   20.15%   -0.02%     
  Complexity      981      981              
============================================
  Files           378      378              
  Lines         15767    15786      +19     
  Branches       2030     2038       +8     
============================================
+ Hits           3179     3181       +2     
- Misses        12198    12214      +16     
- Partials        390      391       +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.

@shedfreewu shedfreewu reopened this Feb 5, 2026
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