You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/08 13:30:56 UTC

[GitHub] [incubator-shenyu] gaochuang98 opened a new pull request, #3503: #3407 add the logic of annotation on the splicing class for tars client

gaochuang98 opened a new pull request, #3503:
URL: https://github.com/apache/incubator-shenyu/pull/3503

   <!-- Describe your PR here; eg. Fixes #issueNo -->
   
   <!--
   Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [ ] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] You submit test cases (unit or integration tests) that back your changes.
   - [ ] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client
URL: https://github.com/apache/incubator-shenyu/pull/3503


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3503:
URL: https://github.com/apache/incubator-shenyu/pull/3503#discussion_r893611376


##########
shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java:
##########
@@ -91,7 +97,17 @@ private void handler(final Object serviceBean) {
             clazz = AopUtils.getTargetClass(serviceBean);
         }
         Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
-        String serviceName = clazz.getAnnotation(ShenyuTarsService.class).serviceName();
+        ShenyuTarsService shenyuTarsService = clazz.getAnnotation(ShenyuTarsService.class);
+        String serviceName = shenyuTarsService.serviceName();

Review Comment:
   missed `ShenyuTarsClient beanShenyuTarsClient = clazz.getAnnotation(ShenyuTarsClient.class);`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client
URL: https://github.com/apache/incubator-shenyu/pull/3503


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client
URL: https://github.com/apache/incubator-shenyu/pull/3503


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client
URL: https://github.com/apache/incubator-shenyu/pull/3503


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client
URL: https://github.com/apache/incubator-shenyu/pull/3503


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3503:
URL: https://github.com/apache/incubator-shenyu/pull/3503#discussion_r894552821


##########
shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java:
##########
@@ -96,18 +96,8 @@ private void handler(final Object serviceBean) {
         if (AopUtils.isAopProxy(serviceBean)) {
             clazz = AopUtils.getTargetClass(serviceBean);
         }
+        String serviceName = clazz.getAnnotation(ShenyuTarsService.class).serviceName();
         Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
-        ShenyuTarsService shenyuTarsService = clazz.getAnnotation(ShenyuTarsService.class);
-        String serviceName = shenyuTarsService.serviceName();
-        if (serviceName.contains("*")) {
-            for (Method method : methods) {
-                ShenyuTarsClient shenyuTarsClient = method.getAnnotation(ShenyuTarsClient.class);
-                if (Objects.nonNull(shenyuTarsClient)) {
-                    publisher.publishEvent(buildMetaDataDTO(serviceName, shenyuTarsClient, method, buildRpcExtJson(method)));

Review Comment:
   Just need to simplify code, not remove these code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] codecov-commenter commented on pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3503:
URL: https://github.com/apache/incubator-shenyu/pull/3503#issuecomment-1150578552

   # [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3503](https://codecov.io/gh/apache/incubator-shenyu/pull/3503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (54deca5) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/b869882d5517f87b8906efc45edf37f7cfc1fcc3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b869882) will **decrease** coverage by `0.36%`.
   > The diff coverage is `76.66%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3503      +/-   ##
   ============================================
   - Coverage     62.81%   62.45%   -0.37%     
   + Complexity     5556     5529      -27     
   ============================================
     Files           840      841       +1     
     Lines         23273    23301      +28     
     Branches       2115     2118       +3     
   ============================================
   - Hits          14620    14552      -68     
   - Misses         7305     7392      +87     
   - Partials       1348     1357       +9     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/3503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...enyu/client/tars/TarsServiceBeanPostProcessor.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNsaWVudC9zaGVueXUtY2xpZW50LXRhcnMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9jbGllbnQvdGFycy9UYXJzU2VydmljZUJlYW5Qb3N0UHJvY2Vzc29yLmphdmE=) | `81.57% <76.66%> (-7.31%)` | :arrow_down: |
   | [...plugin/logging/rocketmq/LoggingRocketMQPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvTG9nZ2luZ1JvY2tldE1RUGx1Z2luLmphdmE=) | `22.72% <0.00%> (-72.73%)` | :arrow_down: |
   | [...ache/shenyu/plugin/grpc/cache/GrpcClientCache.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9jYWNoZS9HcnBjQ2xpZW50Q2FjaGUuamF2YQ==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...controller/ShenyuClientHttpRegistryController.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vY29udHJvbGxlci9TaGVueXVDbGllbnRIdHRwUmVnaXN0cnlDb250cm9sbGVyLmphdmE=) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
   | [...ogging/rocketmq/body/LoggingServerHttpRequest.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvYm9keS9Mb2dnaW5nU2VydmVySHR0cFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [...rter/sync/data/http/HttpSyncDataConfiguration.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXNwcmluZy1ib290LXN0YXJ0ZXIvc2hlbnl1LXNwcmluZy1ib290LXN0YXJ0ZXItc3luYy1kYXRhLWNlbnRlci9zaGVueXUtc3ByaW5nLWJvb3Qtc3RhcnRlci1zeW5jLWRhdGEtaHR0cC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3NwcmluZ2Jvb3Qvc3RhcnRlci9zeW5jL2RhdGEvaHR0cC9IdHRwU3luY0RhdGFDb25maWd1cmF0aW9uLmphdmE=) | `81.25% <0.00%> (-18.75%)` | :arrow_down: |
   | [...yu/sync/data/http/refresh/AbstractDataRefresh.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXN5bmMtZGF0YS1jZW50ZXIvc2hlbnl1LXN5bmMtZGF0YS1odHRwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvc3luYy9kYXRhL2h0dHAvcmVmcmVzaC9BYnN0cmFjdERhdGFSZWZyZXNoLmphdmE=) | `68.96% <0.00%> (-14.37%)` | :arrow_down: |
   | [...ruptor/RegisterClientServerDisruptorPublisher.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vZGlzcnVwdG9yL1JlZ2lzdGVyQ2xpZW50U2VydmVyRGlzcnVwdG9yUHVibGlzaGVyLmphdmE=) | `52.94% <0.00%> (-11.77%)` | :arrow_down: |
   | [...a/org/apache/shenyu/common/utils/VersionUtils.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi91dGlscy9WZXJzaW9uVXRpbHMuamF2YQ==) | `67.85% <0.00%> (-10.72%)` | :arrow_down: |
   | [.../apache/shenyu/admin/model/dto/BatchCommonDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0JhdGNoQ29tbW9uRFRPLmphdmE=) | `50.00% <0.00%> (-7.15%)` | :arrow_down: |
   | ... and [50 more](https://codecov.io/gh/apache/incubator-shenyu/pull/3503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b869882...54deca5](https://codecov.io/gh/apache/incubator-shenyu/pull/3503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3503:
URL: https://github.com/apache/incubator-shenyu/pull/3503#discussion_r893613225


##########
shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java:
##########
@@ -91,7 +97,17 @@ private void handler(final Object serviceBean) {
             clazz = AopUtils.getTargetClass(serviceBean);
         }
         Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
-        String serviceName = clazz.getAnnotation(ShenyuTarsService.class).serviceName();
+        ShenyuTarsService shenyuTarsService = clazz.getAnnotation(ShenyuTarsService.class);
+        String serviceName = shenyuTarsService.serviceName();
+        if (serviceName.contains("*")) {
+            for (Method method : methods) {

Review Comment:
   better change to
   ```java
               if (Objects.nonNull(beanShenyuTarsClient)) {
                   for (Method method : methods) {
                       publisher.publishEvent(buildMetaDataDTO(serviceName, shenyuTarsClient, method, buildRpcExtJson(method)));
                   }
               }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client

Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3503: #3407 add the logic of annotation on the splicing class for tars client
URL: https://github.com/apache/incubator-shenyu/pull/3503


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org