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 2021/07/29 13:50:58 UTC
[GitHub] [incubator-shenyu] en-o opened a new pull request #1830: refactor plugin-modify-response : Finishing method.
en-o opened a new pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830
// Describe your PR here; eg. Fixes #issueNo
no issueNo, When I looked at modify-response function today, I found that the author of this code had not finished finishing
<!--
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
-->
Make sure that:
- [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor/).
- [x] You submit test cases (unit or integration tests) that back your changes.
- [x] Your local test passed `mvn 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] codecov-commenter commented on pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#issuecomment-889172086
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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 [#1830](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1da56a6) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/4747666168b28d14c750f3850b272d5ed8c5bc8e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4747666) will **decrease** coverage by `0.28%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1830 +/- ##
============================================
- Coverage 62.43% 62.14% -0.29%
+ Complexity 2465 2457 -8
============================================
Files 488 488
Lines 10774 10774
Branches 1076 1076
============================================
- Hits 6727 6696 -31
- Misses 3520 3552 +32
+ Partials 527 526 -1
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...u/plugin/modify/response/ModifyResponsePlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vZGlmeS1yZXNwb25zZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9tb2RpZnkvcmVzcG9uc2UvTW9kaWZ5UmVzcG9uc2VQbHVnaW4uamF2YQ==) | `17.80% <0.00%> (ø)` | |
| [...enyu/client/tars/TarsServiceBeanPostProcessor.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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=) | `25.67% <0.00%> (-32.44%)` | :arrow_down: |
| [...ache/shenyu/plugin/grpc/cache/GrpcClientCache.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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==) | `66.66% <0.00%> (-27.78%)` | :arrow_down: |
| [...henyu/plugin/grpc/resolver/ShenyuNameResolver.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9yZXNvbHZlci9TaGVueXVOYW1lUmVzb2x2ZXIuamF2YQ==) | `56.84% <0.00%> (-6.32%)` | :arrow_down: |
| [...che/shenyu/sync/data/http/HttpSyncDataService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXN5bmMtZGF0YS1jZW50ZXIvc2hlbnl1LXN5bmMtZGF0YS1odHRwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvc3luYy9kYXRhL2h0dHAvSHR0cFN5bmNEYXRhU2VydmljZS5qYXZh) | `69.90% <0.00%> (-4.86%)` | :arrow_down: |
| [...henyu/plugin/httpclient/NettyHttpClientPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWh0dHBjbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vaHR0cGNsaWVudC9OZXR0eUh0dHBDbGllbnRQbHVnaW4uamF2YQ==) | `57.14% <0.00%> (-2.05%)` | :arrow_down: |
| [...elimiter/handler/RateLimiterPluginDataHandler.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLXJhdGVsaW1pdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL3JhdGVsaW1pdGVyL2hhbmRsZXIvUmF0ZUxpbWl0ZXJQbHVnaW5EYXRhSGFuZGxlci5qYXZh) | `69.69% <0.00%> (-1.52%)` | :arrow_down: |
| [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `59.64% <0.00%> (+9.64%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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/1830?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 [4747666...1da56a6](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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] en-o closed pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
en-o closed pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830
--
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 edited a comment on pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#issuecomment-889172086
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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 [#1830](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b0bc444) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/4747666168b28d14c750f3850b272d5ed8c5bc8e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4747666) will **increase** coverage by `0.12%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1830 +/- ##
============================================
+ Coverage 62.43% 62.56% +0.12%
- Complexity 2465 2468 +3
============================================
Files 488 488
Lines 10774 10770 -4
Branches 1076 1076
============================================
+ Hits 6727 6738 +11
+ Misses 3520 3505 -15
Partials 527 527
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...u/plugin/modify/response/ModifyResponsePlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vZGlmeS1yZXNwb25zZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9tb2RpZnkvcmVzcG9uc2UvTW9kaWZ5UmVzcG9uc2VQbHVnaW4uamF2YQ==) | `18.84% <0.00%> (+1.03%)` | :arrow_up: |
| [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `59.64% <0.00%> (+9.64%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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/1830?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 [4747666...b0bc444](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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] en-o commented on a change in pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
en-o commented on a change in pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#discussion_r679514552
##########
File path: shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
##########
@@ -175,14 +175,6 @@ public Boolean skip(final ServerWebExchange exchange) {
private String operation(final String jsonValue, final ModifyResponseRuleHandle handle) {
DocumentContext context = JsonPath.parse(jsonValue);
operation(context, handle);
- if (!CollectionUtils.isEmpty(handle.getReplaceBodyKeys())) {
- handle.getReplaceBodyKeys().forEach(info -> {
- context.renameKey(info.getPath(), info.getKey(), info.getValue());
- });
- }
- if (!CollectionUtils.isEmpty(handle.getRemoveBodyKeys())) {
- handle.getRemoveBodyKeys().forEach(context::delete);
- }
return context.jsonString();
}
Review comment:
Does that mean just like it used to be? Then I'll turn it off.
> 意思是就像原来那样吗?那我关了(是我看到这段觉得别扭所以给他整一起了)
--
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 edited a comment on pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#issuecomment-889172086
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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 [#1830](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b0bc444) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/4747666168b28d14c750f3850b272d5ed8c5bc8e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4747666) will **decrease** coverage by `0.14%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1830 +/- ##
============================================
- Coverage 62.43% 62.29% -0.15%
+ Complexity 2465 2459 -6
============================================
Files 488 488
Lines 10774 10770 -4
Branches 1076 1076
============================================
- Hits 6727 6709 -18
- Misses 3520 3538 +18
+ Partials 527 523 -4
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...u/plugin/modify/response/ModifyResponsePlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vZGlmeS1yZXNwb25zZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9tb2RpZnkvcmVzcG9uc2UvTW9kaWZ5UmVzcG9uc2VQbHVnaW4uamF2YQ==) | `18.84% <0.00%> (+1.03%)` | :arrow_up: |
| [...enyu/client/tars/TarsServiceBeanPostProcessor.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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=) | `25.67% <0.00%> (-32.44%)` | :arrow_down: |
| [...henyu/plugin/grpc/resolver/ShenyuNameResolver.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9yZXNvbHZlci9TaGVueXVOYW1lUmVzb2x2ZXIuamF2YQ==) | `61.05% <0.00%> (-2.11%)` | :arrow_down: |
| [...henyu/plugin/httpclient/NettyHttpClientPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWh0dHBjbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vaHR0cGNsaWVudC9OZXR0eUh0dHBDbGllbnRQbHVnaW4uamF2YQ==) | `57.14% <0.00%> (-2.05%)` | :arrow_down: |
| [...che/shenyu/sync/data/http/HttpSyncDataService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXN5bmMtZGF0YS1jZW50ZXIvc2hlbnl1LXN5bmMtZGF0YS1odHRwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvc3luYy9kYXRhL2h0dHAvSHR0cFN5bmNEYXRhU2VydmljZS5qYXZh) | `72.81% <0.00%> (-1.95%)` | :arrow_down: |
| [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `59.64% <0.00%> (+9.64%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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/1830?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 [4747666...b0bc444](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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] dengliming commented on a change in pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
dengliming commented on a change in pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#discussion_r679293981
##########
File path: shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
##########
@@ -175,14 +175,6 @@ public Boolean skip(final ServerWebExchange exchange) {
private String operation(final String jsonValue, final ModifyResponseRuleHandle handle) {
DocumentContext context = JsonPath.parse(jsonValue);
operation(context, handle);
- if (!CollectionUtils.isEmpty(handle.getReplaceBodyKeys())) {
- handle.getReplaceBodyKeys().forEach(info -> {
- context.renameKey(info.getPath(), info.getKey(), info.getValue());
- });
- }
- if (!CollectionUtils.isEmpty(handle.getRemoveBodyKeys())) {
- handle.getRemoveBodyKeys().forEach(context::delete);
- }
return context.jsonString();
}
Review comment:
IMO, You don't need to overload one more method `private void operation(final DocumentContext context, final ModifyResponseRuleHandle handle)`.
--
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 edited a comment on pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#issuecomment-889172086
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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 [#1830](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1da56a6) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/4747666168b28d14c750f3850b272d5ed8c5bc8e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4747666) will **not change** coverage.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1830 +/- ##
=========================================
Coverage 62.43% 62.43%
- Complexity 2465 2467 +2
=========================================
Files 488 488
Lines 10774 10774
Branches 1076 1076
=========================================
Hits 6727 6727
Misses 3520 3520
Partials 527 527
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...u/plugin/modify/response/ModifyResponsePlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vZGlmeS1yZXNwb25zZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9tb2RpZnkvcmVzcG9uc2UvTW9kaWZ5UmVzcG9uc2VQbHVnaW4uamF2YQ==) | `17.80% <0.00%> (ø)` | |
| [...enyu/client/tars/TarsServiceBeanPostProcessor.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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=) | `52.70% <0.00%> (-5.41%)` | :arrow_down: |
| [...henyu/plugin/grpc/resolver/ShenyuNameResolver.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9yZXNvbHZlci9TaGVueXVOYW1lUmVzb2x2ZXIuamF2YQ==) | `58.94% <0.00%> (-4.22%)` | :arrow_down: |
| [...che/shenyu/sync/data/http/HttpSyncDataService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXN5bmMtZGF0YS1jZW50ZXIvc2hlbnl1LXN5bmMtZGF0YS1odHRwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvc3luYy9kYXRhL2h0dHAvSHR0cFN5bmNEYXRhU2VydmljZS5qYXZh) | `71.84% <0.00%> (-2.92%)` | :arrow_down: |
| [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `59.64% <0.00%> (+9.64%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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/1830?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 [4747666...1da56a6](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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] codecov-commenter edited a comment on pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#issuecomment-889172086
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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 [#1830](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1da56a6) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/4747666168b28d14c750f3850b272d5ed8c5bc8e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4747666) will **increase** coverage by `0.03%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #1830 +/- ##
============================================
+ Coverage 62.43% 62.47% +0.03%
- Complexity 2465 2467 +2
============================================
Files 488 488
Lines 10774 10774
Branches 1076 1076
============================================
+ Hits 6727 6731 +4
+ Misses 3520 3516 -4
Partials 527 527
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...u/plugin/modify/response/ModifyResponsePlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vZGlmeS1yZXNwb25zZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9tb2RpZnkvcmVzcG9uc2UvTW9kaWZ5UmVzcG9uc2VQbHVnaW4uamF2YQ==) | `17.80% <0.00%> (ø)` | |
| [...enyu/client/tars/TarsServiceBeanPostProcessor.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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=) | `52.70% <0.00%> (-5.41%)` | :arrow_down: |
| [...che/shenyu/sync/data/http/HttpSyncDataService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LXN5bmMtZGF0YS1jZW50ZXIvc2hlbnl1LXN5bmMtZGF0YS1odHRwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvc3luYy9kYXRhL2h0dHAvSHR0cFN5bmNEYXRhU2VydmljZS5qYXZh) | `71.84% <0.00%> (-2.92%)` | :arrow_down: |
| [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/1830/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-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `59.64% <0.00%> (+9.64%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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/1830?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 [4747666...1da56a6](https://codecov.io/gh/apache/incubator-shenyu/pull/1830?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] dengliming commented on a change in pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
dengliming commented on a change in pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#discussion_r679258207
##########
File path: shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
##########
@@ -175,14 +175,6 @@ public Boolean skip(final ServerWebExchange exchange) {
private String operation(final String jsonValue, final ModifyResponseRuleHandle handle) {
DocumentContext context = JsonPath.parse(jsonValue);
operation(context, handle);
- if (!CollectionUtils.isEmpty(handle.getReplaceBodyKeys())) {
- handle.getReplaceBodyKeys().forEach(info -> {
- context.renameKey(info.getPath(), info.getKey(), info.getValue());
- });
- }
- if (!CollectionUtils.isEmpty(handle.getRemoveBodyKeys())) {
- handle.getRemoveBodyKeys().forEach(context::delete);
- }
return context.jsonString();
}
Review comment:
How about remove `private void operation(final DocumentContext context, final ModifyResponseRuleHandle handle)` and refactor like this?
```
private String operation(final String jsonValue, final ModifyResponseRuleHandle handle) {
DocumentContext context = JsonPath.parse(jsonValue);
if (!CollectionUtils.isEmpty(handle.getAddBodyKeys())) {
handle.getAddBodyKeys().forEach(info -> context.put(info.getPath(), info.getKey(), info.getValue()));
}
if (!CollectionUtils.isEmpty(handle.getReplaceBodyKeys())) {
handle.getReplaceBodyKeys().forEach(info -> context.renameKey(info.getPath(), info.getKey(), info.getValue()));
}
if (!CollectionUtils.isEmpty(handle.getRemoveBodyKeys())) {
handle.getRemoveBodyKeys().forEach(context::delete);
}
return context.jsonString();
}
```
--
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] en-o commented on a change in pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
en-o commented on a change in pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#discussion_r679282707
##########
File path: shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
##########
@@ -175,14 +175,6 @@ public Boolean skip(final ServerWebExchange exchange) {
private String operation(final String jsonValue, final ModifyResponseRuleHandle handle) {
DocumentContext context = JsonPath.parse(jsonValue);
operation(context, handle);
- if (!CollectionUtils.isEmpty(handle.getReplaceBodyKeys())) {
- handle.getReplaceBodyKeys().forEach(info -> {
- context.renameKey(info.getPath(), info.getKey(), info.getValue());
- });
- }
- if (!CollectionUtils.isEmpty(handle.getRemoveBodyKeys())) {
- handle.getRemoveBodyKeys().forEach(context::delete);
- }
return context.jsonString();
}
Review comment:
Idea prompted me. I thought the line was too long after I changed it, so I changed it back. 😅 (changed)
--
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] dengliming commented on a change in pull request #1830: refactor plugin-modify-response : Finishing method.
Posted by GitBox <gi...@apache.org>.
dengliming commented on a change in pull request #1830:
URL: https://github.com/apache/incubator-shenyu/pull/1830#discussion_r679293981
##########
File path: shenyu-plugin/shenyu-plugin-modify-response/src/main/java/org/apache/shenyu/plugin/modify/response/ModifyResponsePlugin.java
##########
@@ -175,14 +175,6 @@ public Boolean skip(final ServerWebExchange exchange) {
private String operation(final String jsonValue, final ModifyResponseRuleHandle handle) {
DocumentContext context = JsonPath.parse(jsonValue);
operation(context, handle);
- if (!CollectionUtils.isEmpty(handle.getReplaceBodyKeys())) {
- handle.getReplaceBodyKeys().forEach(info -> {
- context.renameKey(info.getPath(), info.getKey(), info.getValue());
- });
- }
- if (!CollectionUtils.isEmpty(handle.getRemoveBodyKeys())) {
- handle.getRemoveBodyKeys().forEach(context::delete);
- }
return context.jsonString();
}
Review comment:
IMO, You don't need to overload one more method e.g. `private void operation(final DocumentContext context, final ModifyResponseRuleHandle handle)`.
--
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