shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[type:refactor] refactor shenyu-client-grpc

Open totalo opened this issue 3 years ago • 4 comments

For #3932

Make sure that:

  • [x] You have read the contribution guidelines.
  • [x] You submit test cases (unit or integration tests) that back your changes.
  • [x] Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

totalo avatar Sep 13 '22 12:09 totalo

please check CI, https://github.com/apache/shenyu/actions/runs/3045035747/jobs/4906100161

loongs-zhang avatar Sep 14 '22 00:09 loongs-zhang

Codecov Report

Merging #3937 (4a4a467) into master (3995940) will decrease coverage by 0.17%. The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #3937      +/-   ##
============================================
- Coverage     70.35%   70.18%   -0.18%     
+ Complexity     6748     6679      -69     
============================================
  Files           922      923       +1     
  Lines         25318    25081     -237     
  Branches       2297     2264      -33     
============================================
- Hits          17813    17603     -210     
+ Misses         6136     6112      -24     
+ Partials       1369     1366       -3     
Impacted Files Coverage Δ
...ter/client/grpc/ShenyuGrpcClientConfiguration.java 100.00% <ø> (ø)
...admin/listener/nacos/NacosDataChangedListener.java 53.33% <0.00%> (-40.15%) :arrow_down:
.../apache/shenyu/plugin/sentinel/SentinelPlugin.java 63.15% <0.00%> (-16.85%) :arrow_down:
...gin/sentinel/fallback/SentinelFallbackHandler.java 85.71% <0.00%> (-14.29%) :arrow_down:
...min/listener/consul/ConsulDataChangedListener.java 85.71% <0.00%> (-11.48%) :arrow_down:
.../shenyu/plugin/context/path/ContextPathPlugin.java 84.37% <0.00%> (-9.38%) :arrow_down:
...stener/zookeeper/ZookeeperDataChangedListener.java 81.81% <0.00%> (-8.85%) :arrow_down:
...u/plugin/modify/response/ModifyResponsePlugin.java 10.16% <0.00%> (-8.48%) :arrow_down:
...che/shenyu/sync/data/http/HttpSyncDataService.java 85.71% <0.00%> (-4.09%) :arrow_down:
...enyu/client/tars/TarsServiceBeanEventListener.java 88.60% <0.00%> (-3.99%) :arrow_down:
... and 16 more

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

codecov-commenter avatar Sep 14 '22 02:09 codecov-commenter

企业微信截图_1800ce9c-275e-419b-abc6-6292c0a57ecf

loongs-zhang avatar Sep 14 '22 03:09 loongs-zhang

企业微信截图_1800ce9c-275e-419b-abc6-6292c0a57ecf

Thanks, I noticed, currently only testing as a draft.

totalo avatar Sep 14 '22 04:09 totalo

I ran the version you modified and the master branch version. There is a problem when hande with /**, please fix it. image below is from master branch, /grpc/helloService/access$000 looks like a bug, it seems you had fixed it. image

loongs-zhang avatar Sep 17 '22 13:09 loongs-zhang

hi,@dragon-zhang, I have fixed the issue with helloService/**. And for access$000 it is because there is a place in the inner class to call the method of the outer class through the this reference of the outer class. The access$000 method is a method automatically generated by the compiler because the onError method of the anonymous inner class in the helloEveryOne method accesses the Log object of the outer class. And only when the annotation is on the class Since there is no way to avoid business implementation, I think our solution may be as follows for correctness:

  1. Only configure the generation of non-static methods
  2. Generated only for public methods

I prefer 2, what you think?

totalo avatar Sep 18 '22 04:09 totalo

hi,@dragon-zhang, I have fixed the issue with helloService/**. And for access$000 it is because there is a place in the inner class to call the method of the outer class through the this reference of the outer class. The access$000 method is a method automatically generated by the compiler because the onError method of the anonymous inner class in the helloEveryOne method accesses the Log object of the outer class. And only when the annotation is on the class Since there is no way to avoid business implementation, I think our solution may be as follows for correctness:

  1. Only configure the generation of non-static methods
  2. Generated only for public methods

I prefer 2, what you think?

agree with you, just go ahead.

loongs-zhang avatar Sep 18 '22 09:09 loongs-zhang

hi,@dragon-zhang, I have fixed the issue with helloService/**. And for access$000 it is because there is a place in the inner class to call the method of the outer class through the this reference of the outer class. The access$000 method is a method automatically generated by the compiler because the onError method of the anonymous inner class in the helloEveryOne method accesses the Log object of the outer class. And only when the annotation is on the class Since there is no way to avoid business implementation, I think our solution may be as follows for correctness:

  1. Only configure the generation of non-static methods
  2. Generated only for public methods

I prefer 2, what you think?

agree with you, just go ahead.

Got it, You can review it, the current one is handled according to public.

totalo avatar Sep 18 '22 10:09 totalo

Thanks for your contribution !

loongs-zhang avatar Sep 19 '22 06:09 loongs-zhang