Skip to content
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

tag support multi level #12673

Merged
merged 3 commits into from
Aug 24, 2023
Merged

tag support multi level #12673

merged 3 commits into from
Aug 24, 2023

Conversation

carlvine500
Copy link
Contributor

@carlvine500 carlvine500 commented Jul 5, 2023

What is the purpose of the change

fix issue #12672

Brief changelog

tag with multi level will search tag as following:
requestTag=beta|team1|partner1
step0: if force=true , just search tag(beta|team1|partner1)
step1: search invokers with tag(beta|team1|partner1) , if result is empty , run step2
step2: search invokers with tag(beta|team1), if result is empty , run step3
step3: search invokers with tag(beta)


there are 10 deploy with tag=null and 10 deploy with dubbo.tag=beta, but my team just work with 8 deploy for a big feature-A , and my partners just work with 3 deploy for a small feature-A-1 :

my team want deploy 8 deploy with tag=beta|team1 , and share the deploy(tag=beta)
my partners want deploy 3 deploy with tag=beta|team1|partner1 , and share the deploy(tag=beta|team1)

Verifying this change

add some test case to search addresses with muti level tag

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

89.5% 89.5% Coverage
0.0% 0.0% Duplication

@AlbumenJ AlbumenJ changed the base branch from 3.2 to 3.3 July 13, 2023 12:32
Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

LGTM
@chickenlj PTAL

@carlvine500
Copy link
Contributor Author

carlvine500 commented Jul 14, 2023

@carlvine500 Please update the following documentation accordingly:

https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/#%E6%A0%87%E7%AD%BE%E8%B7%AF%E7%94%B1%E8%A7%84%E5%88%99

https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/tag-rule/

ok. this is the pull request #2775

String[] selectors = StringUtils.split(tagSelector, TAG_SEPERATOR);
for (int i = selectors.length; i > 0; i--) {
String selectorTmp = StringUtils.join(selectors, TAG_SEPERATOR, 0, i);
System.out.println(selectorTmp);
Copy link
Member

Choose a reason for hiding this comment

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

please remove System.out.println

Copy link
Contributor Author

Choose a reason for hiding this comment

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

please remove System.out.println

ok

@@ -96,7 +96,7 @@
<javassist_version>3.29.2-GA</javassist_version>
<bytebuddy.version>1.14.5</bytebuddy.version>
<netty_version>3.2.10.Final</netty_version>
<netty4_version>4.1.92.Final</netty4_version>
<netty4_version>4.1.94.Final</netty4_version>
Copy link
Member

Choose a reason for hiding this comment

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

Why change the version?

Copy link
Contributor Author

@carlvine500 carlvine500 Aug 22, 2023

Choose a reason for hiding this comment

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

Why change the version?

a issue upgrade it , #12653

4.1.92.Final has vulnerability , CVE-2023-34462. Severity: MEDIUM
refer : https://mvnrepository.com/artifact/io.netty/netty-handler

@carlvine500 carlvine500 requested a review from wxbty August 22, 2023 02:29
Copy link
Member

@wxbty wxbty left a comment

Choose a reason for hiding this comment

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

LGTM
btw, please resolve conflicts with the master

@carlvine500
Copy link
Contributor Author

carlvine500 commented Aug 22, 2023

LGTM btw, please resolve conflicts with the master

I have no permission to merge to (apache:3.3)apache:3.3 , but I have tried merge to my git :
https://github.com/carlvine500/dubbo/commits/3.3

@AlbumenJ
Copy link
Member

LGTM btw, please resolve conflicts with the master

I have no permission to merge to (apache:3.3)apache:3.3 , but I have tried merge to my git : https://github.com/carlvine500/dubbo/commits/3.3

Merge apache:3.3 into your branch

@carlvine500
Copy link
Contributor Author

@AlbumenJ failing test is not about this pull_request .

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

@chickenlj PTAL

@chickenlj chickenlj merged commit 679ce44 into apache:3.3 Aug 24, 2023
11 of 12 checks passed
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.

4 participants