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: make metadata report work without serviceDiscovery #948

Merged
merged 16 commits into from
Jan 23, 2021

Conversation

cvictory
Copy link
Contributor

@cvictory cvictory commented Dec 21, 2020

What this PR does:

The metadata should work without ServiceDiscovery. So I think should add some logic in service_config.go and reference_config.go

@codecov-io
Copy link

codecov-io commented Dec 21, 2020

Codecov Report

Merging #948 (9a980ff) into develop (0cb6edb) will decrease coverage by 0.12%.
The diff coverage is 10.86%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #948      +/-   ##
===========================================
- Coverage    59.66%   59.53%   -0.13%     
===========================================
  Files          261      261              
  Lines        12919    12952      +33     
===========================================
+ Hits          7708     7711       +3     
- Misses        4240     4268      +28     
- Partials       971      973       +2     
Impacted Files Coverage Δ
common/extension/metadata_service.go 0.00% <0.00%> (ø)
config/service_config.go 53.59% <0.00%> (-1.08%) ⬇️
filter/filter_impl/sentinel_filter.go 63.04% <ø> (ø)
metadata/report/delegate/delegate_report.go 27.34% <0.00%> (-0.66%) ⬇️
metadata/service/remote/service.go 32.95% <0.00%> (-6.78%) ⬇️
...try/servicediscovery/service_discovery_registry.go 11.56% <ø> (-0.21%) ⬇️
config/reference_config.go 78.84% <33.33%> (-1.36%) ⬇️
registry/nacos/registry.go 50.36% <57.14%> (-0.77%) ⬇️
...tocol/rest/server/server_impl/go_restful_server.go 48.78% <0.00%> (+4.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a666eb...9a980ff. Read the comment docs.

@AlexStocks AlexStocks force-pushed the develop branch 6 times, most recently from f002d8a to 8aba190 Compare December 27, 2020 05:13
Copy link
Contributor

@Patrick0308 Patrick0308 left a comment

Choose a reason for hiding this comment

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

err = s.metaDataService.PublishServiceDefinition(url)
if err != nil {
return perrors.WithMessage(err, "publish the service definition failed. ")
}

We don't need publish service definition in service_discovery_registry.

remoteMetadataService, err = creator()
return remoteMetadataService, err
}
logger.Info("could not find the metadata service creator for metadataType: remote")
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be warm?

BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{
ServiceInterface: interfaceName,
Version: url.GetParam(constant.VERSION_KEY, ""),
// Group: url.GetParam(constant.GROUP_KEY, constant.SERVICE_DISCOVERY_DEFAULT_GROUP),
Copy link
Contributor

Choose a reason for hiding this comment

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

if not use, pls remove it

@AlexStocks AlexStocks force-pushed the develop branch 4 times, most recently from 546dabf to 70eb671 Compare January 2, 2021 19:30
@AlexStocks AlexStocks force-pushed the develop branch 11 times, most recently from d12bf6a to e633a73 Compare January 9, 2021 09:35
@AlexStocks AlexStocks force-pushed the develop branch 2 times, most recently from 603f989 to 794ab77 Compare January 10, 2021 13:12
id := &identifier.MetadataIdentifier{
BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{
ServiceInterface: interfaceName,
Version: url.GetParam(constant.VERSION_KEY, ""),
// Group: url.GetParam(constant.GROUP_KEY, constant.SERVICE_DISCOVERY_DEFAULT_GROUP),
Group: url.GetParam(constant.GROUP_KEY, constant.DUBBO),
Side: url.GetParam(constant.SIDE_KEY, "provider"),
Side: url.GetParam(constant.SIDE_KEY, "consumer"),
Copy link
Contributor

@cityiron cityiron Jan 19, 2021

Choose a reason for hiding this comment

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

SIDE_KEY consumer and provider should refer from constant

@cityiron
Copy link
Contributor

This pr is resolve issue#939?

url.RangeParams(func(key, value string) bool {
params[key] = value
return true
})
id := &identifier.MetadataIdentifier{
BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{
ServiceInterface: interfaceName,
Version: url.GetParam(constant.VERSION_KEY, ""),
// Group: url.GetParam(constant.GROUP_KEY, constant.SERVICE_DISCOVERY_DEFAULT_GROUP),
Copy link
Contributor

Choose a reason for hiding this comment

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

pls remove it.

@AlexStocks AlexStocks force-pushed the develop branch 2 times, most recently from 25c3b98 to 9a666eb Compare January 23, 2021 11:12
@AlexStocks AlexStocks added this to the v1.5.6 milestone Jan 23, 2021
@@ -116,22 +116,40 @@ func (mts *MetadataService) UnsubscribeURL(url *common.URL) error {
func (mts *MetadataService) PublishServiceDefinition(url *common.URL) error {
Copy link
Member

Choose a reason for hiding this comment

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

The value of error always return nil.

@AlexStocks AlexStocks merged commit 6c989b9 into apache:develop Jan 23, 2021
AlexStocks added a commit that referenced this pull request Apr 14, 2021
Fix: make metadata report work without serviceDiscovery
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.

7 participants