apache / dubbo-admin

The ops and reference implementation for Apache Dubbo
https://dubbo.apache.org
Apache License 2.0
3.99k stars 2.17k forks source link

fix monitor #1151

Closed sjmshsh closed 1 year ago

sjmshsh commented 1 year ago

Solved a potential bug. When the searched index does not exist (the abnormality that has not occurred can not be found), there will be a null pointer error. Here is the judgment of whether the data is queried. And supplement and optimize the code related to http_sd.

chickenlj commented 1 year ago

Please fix the following unit test:

ok      github.com/apache/dubbo-admin/pkg/admin/model/util  0.007s  coverage: 46.6% of statements
# github.com/apache/dubbo-admin/pkg/admin/services [github.com/apache/dubbo-admin/pkg/admin/services.test]
Error: pkg/admin/services/prometheus_service_impl_test.go:153:12: assignment mismatch: 1 variable but prometheusService.PromDiscovery returns 2 values
sonarcloud[bot] commented 1 year ago

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 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

codecov-commenter commented 1 year ago

Codecov Report

Merging #1151 (d18e443) into refactor-with-go (de6f94b) will decrease coverage by 0.07%. The diff coverage is 13.33%.

@@                 Coverage Diff                  @@
##           refactor-with-go    #1151      +/-   ##
====================================================
- Coverage             49.72%   49.65%   -0.07%     
====================================================
  Files                    99       99              
  Lines                  5082     5087       +5     
  Branches                 41       41              
====================================================
- Hits                   2527     2526       -1     
- Misses                 2296     2302       +6     
  Partials                259      259              
Impacted Files Coverage Δ
pkg/admin/services/prometheus_service_impl.go 11.59% <13.33%> (-1.19%) :arrow_down:

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more