sofastack / sofa-boot

SOFABoot is a framework that enhances Spring Boot and fully compatible with it, provides readiness check, class isolation, etc.
https://www.sofastack.tech/sofa-boot/docs/Home
Apache License 2.0
4.97k stars 1.27k forks source link

Support sofareference required optional #1135

Closed crazysaltfish closed 1 year ago

crazysaltfish commented 1 year ago

Add a required property for SofaReference, including annotation/xml/api registration.

If required=false, the health check will still pass even if no corresponding service exists.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1135 (d326ca9) into master (b7f7ab2) will decrease coverage by 0.25%. The diff coverage is 45.83%.

:exclamation: Current head d326ca9 differs from pull request most recent head e03bcbb. Consider uploading reports for the commit e03bcbb to get more accurate results

@@             Coverage Diff              @@
##             master    #1135      +/-   ##
============================================
- Coverage     11.46%   11.22%   -0.25%     
  Complexity       41       41              
============================================
  Files           326      324       -2     
  Lines          9426     9596     +170     
  Branches       1290     1313      +23     
============================================
- Hits           1081     1077       -4     
- Misses         8184     8357     +173     
- Partials        161      162       +1     
Impacted Files Coverage Δ
.../sofa/runtime/api/client/param/ReferenceParam.java 0.00% <0.00%> (ø)
...fa/runtime/service/client/ReferenceClientImpl.java 9.43% <0.00%> (-0.19%) :arrow_down:
.../runtime/service/component/ReferenceComponent.java 30.37% <0.00%> (ø)
...e/spring/ReferenceAnnotationBeanPostProcessor.java 25.00% <0.00%> (-0.34%) :arrow_down:
...ntime/spring/parser/ReferenceDefinitionParser.java 42.85% <28.57%> (-7.15%) :arrow_down:
.../runtime/service/component/impl/ReferenceImpl.java 50.00% <75.00%> (+10.00%) :arrow_up:
...a/runtime/spring/factory/ReferenceFactoryBean.java 64.10% <85.71%> (+3.49%) :arrow_up:

... and 22 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.