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

Fix the problem of multiple namespaces in MetadataReport #13971

Merged
merged 18 commits into from
May 8, 2024

Conversation

finefuture
Copy link
Contributor

What is the purpose of the change

Key missing namespace information:
image

Brief changelog

Verifying this change

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.

@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.25%. Comparing base (f03823e) to head (0d21a45).
Report is 1 commits behind head on 3.2.

❗ Current head 0d21a45 differs from pull request most recent head ecaadbd. Consider uploading reports for the commit ecaadbd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              3.2   #13971      +/-   ##
==========================================
- Coverage   70.41%   70.25%   -0.17%     
==========================================
  Files        1607     1607              
  Lines       70094    70101       +7     
  Branches    10102    10105       +3     
==========================================
- Hits        49360    49251     -109     
- Misses      16088    16216     +128     
+ Partials     4646     4634      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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
Copy link
Contributor

chickenlj commented Mar 28, 2024

I think it would be better to just change the way how REGISTRY_CLUSTER_KEY is generated.

For now, REGISTRY_CLUSTER_KEY is the same as id (controlled by @Parameter(key = REGISTRY_CLUSTER_KEY)). If we want it to include namespace in REGISTRY_CLUSTER_KEY, we can change the code to make sure that namespace is included in REGISTRY_CLUSTER_KEY the first time the registry url is generated.

Then the only place we need to change except for the REGISTRY_CLUSTER_KEY generating process (to include both id and namespace) is how to map the MetadataReport instance with the REGISTRY_CLUSTER_KEY(also to have namespace included) https://github.com/apache/dubbo/pull/13971/files#diff-1e44977c9c4b360c444eb20fbc5599acc73533c783c897954e068e88ab339278R117.

@finefuture
Copy link
Contributor Author

I think it would be better to just change the way how REGISTRY_CLUSTER_KEY is generated.

For now, REGISTRY_CLUSTER_KEY is the same as id (controlled by @Parameter(key = REGISTRY_CLUSTER_KEY)). If we want it to include namespace in REGISTRY_CLUSTER_KEY, we can change the code to make sure that namespace is included in REGISTRY_CLUSTER_KEY the first time the registry url is generated.

Then the only place we need to change except for the REGISTRY_CLUSTER_KEY generating process (to include both id and namespace) is how to map the MetadataReport instance with the REGISTRY_CLUSTER_KEY(also to have namespace included) https://github.com/apache/dubbo/pull/13971/files#diff-1e44977c9c4b360c444eb20fbc5599acc73533c783c897954e068e88ab339278R117.

Ok, I will try it.

@finefuture
Copy link
Contributor Author

@chickenlj PTAL

return URL.valueOf(url.toServiceString())
.addParameter(NAMESPACE_KEY, namespace)
.toString();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you describe the difference between the new url and the old url?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about making it a public util method to make calling it in other places easier? like here https://github.com/apache/dubbo/pull/13971/files#diff-17a0f234d88728ebc6f37959d84276704ca16846cd10cd0743616a8689949eabR33

Copy link
Contributor Author

@finefuture finefuture Apr 7, 2024

Choose a reason for hiding this comment

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

Add a new method for extra parameters.
image

@finefuture
Copy link
Contributor Author

@chickenlj Does DynamicConfiguration need to support multiple namespaces?
image

@chickenlj
Copy link
Contributor

Sorry for the late response, I am working on this pull request now.

Copy link
Contributor

@chickenlj chickenlj 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
Copy link
Contributor

@finefuture thanks for the patience and contribution, we do appreciate it.

Copy link

sonarcloud bot commented May 8, 2024

@AlbumenJ AlbumenJ merged commit dfd135e into apache:3.2 May 8, 2024
19 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.

None yet

4 participants