[jira] [Commented] (SCB-1053) Batch microservices instances discovery API
[ https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702719#comment-16702719 ] ASF GitHub Bot commented on SCB-1053: - asifdxtreme commented on a change in pull request #502: WIP: SCB-1053 Batch microservices instances discovery API URL: https://github.com/apache/servicecomb-service-center/pull/502#discussion_r237351009 ## File path: server/core/swagger/v4.yaml ## @@ -1417,6 +1424,44 @@ paths: description: 内部错误 schema: type: string +post: Review comment: Any specific reasons for making it "post" method, as far as I see it's getting the discovery information and not updating/creating anything in backend, so in my opinion it can be a "get" method This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch microservices instances discovery API > --- > > Key: SCB-1053 > URL: https://issues.apache.org/jira/browse/SCB-1053 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (SCB-1055) Please delete old releases from mirroring system
[ https://issues.apache.org/jira/browse/SCB-1055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mohammad Asif Siddiqui reassigned SCB-1055: --- Assignee: Mohammad Asif Siddiqui > Please delete old releases from mirroring system > > > Key: SCB-1055 > URL: https://issues.apache.org/jira/browse/SCB-1055 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: Sebb >Assignee: Mohammad Asif Siddiqui >Priority: Major > > To reduce the load on the ASF mirrors, projects are required to delete old > releases [1] > Please can you remove all non-current releases from the dist/release area? > It's unfair to expect the 3rd party mirrors to carry old releases. > However you can still link to the archives for historic releases. > Please also update your release procedures (if relevant) > Thanks! > [1] http://www.apache.org/dev/release.html#when-to-archive -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702654#comment-16702654 ] ASF GitHub Bot commented on SCB-1054: - coveralls commented on issue #1016: [SCB-1054]when download file, we should ignore consumer acceptType URL: https://github.com/apache/servicecomb-java-chassis/pull/1016#issuecomment-442685627 [![Coverage Status](https://coveralls.io/builds/20350872/badge)](https://coveralls.io/builds/20350872) Coverage increased (+0.02%) to 86.792% when pulling **bab7da07af7753161ef25d117b72ed9abb8e755a on heyile:downloadAccept** into **47d4773f3db7444e07fa2bb5bf87ac0a0387855f on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when download file, we should ignore consumer acceptType > > > Key: SCB-1054 > URL: https://issues.apache.org/jira/browse/SCB-1054 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Critical > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1053) Batch microservices instances discovery API
[ https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702030#comment-16702030 ] ASF GitHub Bot commented on SCB-1053: - coveralls edited a comment on issue #502: WIP: SCB-1053 Batch microservices instances discovery API URL: https://github.com/apache/servicecomb-service-center/pull/502#issuecomment-442483399 [![Coverage Status](https://coveralls.io/builds/20338264/badge)](https://coveralls.io/builds/20338264) Coverage decreased (-0.006%) to 61.72% when pulling **d04027c1e8acaf5b0a18d6a8a55972b8d1d37b86 on little-cui:find** into **6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch microservices instances discovery API > --- > > Key: SCB-1053 > URL: https://issues.apache.org/jira/browse/SCB-1053 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1053) Batch microservices instances discovery API
[ https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702020#comment-16702020 ] ASF GitHub Bot commented on SCB-1053: - codecov-io edited a comment on issue #502: WIP: SCB-1053 Batch microservices instances discovery API URL: https://github.com/apache/servicecomb-service-center/pull/502#issuecomment-442483359 # [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=h1) Report > Merging [#502](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de?src=pr&el=desc) will **decrease** coverage by `<.01%`. > The diff coverage is `50%`. [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/graphs/tree.svg?width=650&token=GAaF7zrg8R&height=150&src=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=tree) ```diff @@Coverage Diff @@ ## master #502 +/- ## == - Coverage 59.21% 59.21% -0.01% == Files 166 166 Lines 1387813886 +8 == + Hits 8218 8222 +4 - Misses 5074 5078 +4 Partials 586 586 ``` | [Impacted Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [server/core/proto/types.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL2NvcmUvcHJvdG8vdHlwZXMuZ28=) | `0% <ø> (ø)` | :arrow_up: | | [server/plugin/pkg/discovery/servicecenter/repo.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvZGlzY292ZXJ5L3NlcnZpY2VjZW50ZXIvcmVwby5nbw==) | `20% <0%> (-13.34%)` | :arrow_down: | | [server/plugin/pkg/discovery/etcd/repo.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvZGlzY292ZXJ5L2V0Y2QvcmVwby5nbw==) | `100% <100%> (ø)` | :arrow_up: | | [server/plugin/pkg/registry/etcd/tracing.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvcmVnaXN0cnkvZXRjZC90cmFjaW5nLmdv) | `72.72% <0%> (-9.1%)` | :arrow_down: | | [server/service/notification/websocket.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2Uvbm90aWZpY2F0aW9uL3dlYnNvY2tldC5nbw==) | `83.87% <0%> (-0.65%)` | :arrow_down: | | [server/plugin/pkg/registry/etcd/etcd.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvcmVnaXN0cnkvZXRjZC9ldGNkLmdv) | `86.36% <0%> (+0.18%)` | :arrow_up: | | [server/govern/service.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv) | `72.93% <0%> (+0.33%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=footer). Last update [6285f2b...d04027c](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch microservices instances discovery API > --- > > Key: SCB-1053 > URL: https://issues.apache.org/jira/browse/SCB-1053 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1053) Batch microservices instances discovery API
[ https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702002#comment-16702002 ] ASF GitHub Bot commented on SCB-1053: - coveralls commented on issue #502: WIP: SCB-1053 Batch microservices instances discovery API URL: https://github.com/apache/servicecomb-service-center/pull/502#issuecomment-442483399 [![Coverage Status](https://coveralls.io/builds/20337917/badge)](https://coveralls.io/builds/20337917) Coverage decreased (-0.08%) to 61.649% when pulling **d04027c1e8acaf5b0a18d6a8a55972b8d1d37b86 on little-cui:find** into **6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch microservices instances discovery API > --- > > Key: SCB-1053 > URL: https://issues.apache.org/jira/browse/SCB-1053 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1053) Batch microservices instances discovery API
[ https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702001#comment-16702001 ] ASF GitHub Bot commented on SCB-1053: - codecov-io commented on issue #502: WIP: SCB-1053 Batch microservices instances discovery API URL: https://github.com/apache/servicecomb-service-center/pull/502#issuecomment-442483359 # [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=h1) Report > Merging [#502](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de?src=pr&el=desc) will **increase** coverage by `<.01%`. > The diff coverage is `50%`. [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/graphs/tree.svg?width=650&token=GAaF7zrg8R&height=150&src=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=tree) ```diff @@Coverage Diff @@ ## master #502 +/- ## == + Coverage 59.21% 59.21% +<.01% == Files 166 166 Lines 1387813886 +8 == + Hits 8218 8223 +5 - Misses 5074 5078 +4 + Partials 586 585 -1 ``` | [Impacted Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [server/core/proto/types.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL2NvcmUvcHJvdG8vdHlwZXMuZ28=) | `0% <ø> (ø)` | :arrow_up: | | [server/plugin/pkg/discovery/servicecenter/repo.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvZGlzY292ZXJ5L3NlcnZpY2VjZW50ZXIvcmVwby5nbw==) | `20% <0%> (-13.34%)` | :arrow_down: | | [server/plugin/pkg/discovery/etcd/repo.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvZGlzY292ZXJ5L2V0Y2QvcmVwby5nbw==) | `100% <100%> (ø)` | :arrow_up: | | [pkg/tlsutil/tlsutil.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-cGtnL3Rsc3V0aWwvdGxzdXRpbC5nbw==) | `73.58% <0%> (-0.95%)` | :arrow_down: | | [scctl/pkg/plugin/diagnose/compare\_holder.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2NjdGwvcGtnL3BsdWdpbi9kaWFnbm9zZS9jb21wYXJlX2hvbGRlci5nbw==) | `96.15% <0%> (+1.28%)` | :arrow_up: | | [server/service/util/heartbeat\_util.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9oZWFydGJlYXRfdXRpbC5nbw==) | `80% <0%> (+6.66%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=footer). Last update [6285f2b...d04027c](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch microservices instances discovery API > --- > > Key: SCB-1053 > URL: https://issues.apache.org/jira/browse/SCB-1053 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1053) Batch microservices instances discovery API
[ https://issues.apache.org/jira/browse/SCB-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701972#comment-16701972 ] ASF GitHub Bot commented on SCB-1053: - little-cui opened a new pull request #502: WIP: SCB-1053 Batch microservices instances discovery API URL: https://github.com/apache/servicecomb-service-center/pull/502 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch microservices instances discovery API > --- > > Key: SCB-1053 > URL: https://issues.apache.org/jira/browse/SCB-1053 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701949#comment-16701949 ] ASF GitHub Bot commented on SCB-1054: - heyile opened a new pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType URL: https://github.com/apache/servicecomb-java-chassis/pull/1016 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when download file, we should ignore consumer acceptType > > > Key: SCB-1054 > URL: https://issues.apache.org/jira/browse/SCB-1054 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Critical > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701948#comment-16701948 ] ASF GitHub Bot commented on SCB-1054: - heyile closed pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType URL: https://github.com/apache/servicecomb-java-chassis/pull/1016 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java index ee7c40137..d08d43fb6 100644 --- a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java +++ b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java @@ -39,6 +39,7 @@ import org.slf4j.LoggerFactory; import io.swagger.models.Operation; +import io.swagger.models.Response; import io.swagger.models.Swagger; import io.swagger.models.parameters.Parameter; import io.vertx.ext.web.impl.MimeTypesUtils; @@ -52,6 +53,9 @@ protected boolean formData; + // make sure if response is file + protected boolean downloadFile; + protected List paramList = new ArrayList<>(); // key为参数名 @@ -80,6 +84,7 @@ public void init(OperationMeta operationMeta) { this.produces = swagger.getProduces(); } +checkDownloadFile(operation); this.createProduceProcessors(); Method method = operationMeta.getMethod(); @@ -105,6 +110,16 @@ public void init(OperationMeta operationMeta) { setAbsolutePath(concatPath(swagger.getBasePath(), operationMeta.getOperationPath())); } + private void checkDownloadFile(Operation operation) { +try { + Response response = operation.getResponses().get("200"); + downloadFile = response.getSchema().getType().toLowerCase().equals("file"); +} catch (Exception e) { + // if throw NullPointer Exception, set false + downloadFile = false; +} + } + public boolean isFormData() { return formData; } @@ -217,9 +232,14 @@ public ProduceProcessor ensureFindProduceProcessor(String acceptType) { if (StringUtils.isEmpty(acceptType)) { return defaultProcessor; } - -List mimeTyps = MimeTypesUtils.getSortedAcceptableMimeTypes(acceptType.toLowerCase(Locale.US)); -for (String mime : mimeTyps) { +if (downloadFile) { + //do not check accept type, when the produces of provider is text/plain there will return text/plain processor + // when the produces of provider is application/json there will return application/json processor + //so do not care what accept type the consumer will set. + return this.produceProcessorMap.get(MediaType.WILDCARD); +} +List mimeTypes = MimeTypesUtils.getSortedAcceptableMimeTypes(acceptType.toLowerCase(Locale.US)); +for (String mime : mimeTypes) { ProduceProcessor processor = this.produceProcessorMap.get(mime); if (null != processor) { return processor; diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java index 34621d6e2..623e1171a 100644 --- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java +++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java @@ -171,6 +171,20 @@ public void testEnsureFindProduceProcessorAcceptFound() { operationMeta.ensureFindProduceProcessor("text/plain;q=0.7;charset=utf-8,application/json;q=0.8")); } + @Test + public void testEnsureFindProduceProcessorWithDownload() { +RestOperationMeta operationMeta = new RestOperationMeta(); +operationMeta.produces = Arrays.asList(MediaType.APPLICATION_JSON); +operationMeta.downloadFile = true; +operationMeta.createProduceProcessors(); + +Assert.assertSame(ProduceProcessorManager.JSON_PROCESSOR, +operationMeta.ensureFindProduceProcessor("text/plain")); + +operationMeta.downloadFile = false; +Assert.assertNull(operationMeta.ensureFindProduceProcessor("text/plain")); + } + @Test public void testEnsureFindProduceProcessorAcceptNotFound() { RestOperationMeta operationMeta = new RestOperationMeta(); diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDownload.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDownload.java index 9a3
[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701859#comment-16701859 ] ASF GitHub Bot commented on SCB-1054: - heyile closed pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType URL: https://github.com/apache/servicecomb-java-chassis/pull/1016 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java index ee7c40137..d08d43fb6 100644 --- a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java +++ b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/definition/RestOperationMeta.java @@ -39,6 +39,7 @@ import org.slf4j.LoggerFactory; import io.swagger.models.Operation; +import io.swagger.models.Response; import io.swagger.models.Swagger; import io.swagger.models.parameters.Parameter; import io.vertx.ext.web.impl.MimeTypesUtils; @@ -52,6 +53,9 @@ protected boolean formData; + // make sure if response is file + protected boolean downloadFile; + protected List paramList = new ArrayList<>(); // key为参数名 @@ -80,6 +84,7 @@ public void init(OperationMeta operationMeta) { this.produces = swagger.getProduces(); } +checkDownloadFile(operation); this.createProduceProcessors(); Method method = operationMeta.getMethod(); @@ -105,6 +110,16 @@ public void init(OperationMeta operationMeta) { setAbsolutePath(concatPath(swagger.getBasePath(), operationMeta.getOperationPath())); } + private void checkDownloadFile(Operation operation) { +try { + Response response = operation.getResponses().get("200"); + downloadFile = response.getSchema().getType().toLowerCase().equals("file"); +} catch (Exception e) { + // if throw NullPointer Exception, set false + downloadFile = false; +} + } + public boolean isFormData() { return formData; } @@ -217,9 +232,14 @@ public ProduceProcessor ensureFindProduceProcessor(String acceptType) { if (StringUtils.isEmpty(acceptType)) { return defaultProcessor; } - -List mimeTyps = MimeTypesUtils.getSortedAcceptableMimeTypes(acceptType.toLowerCase(Locale.US)); -for (String mime : mimeTyps) { +if (downloadFile) { + //do not check accept type, when the produces of provider is text/plain there will return text/plain processor + // when the produces of provider is application/json there will return application/json processor + //so do not care what accept type the consumer will set. + return this.produceProcessorMap.get(MediaType.WILDCARD); +} +List mimeTypes = MimeTypesUtils.getSortedAcceptableMimeTypes(acceptType.toLowerCase(Locale.US)); +for (String mime : mimeTypes) { ProduceProcessor processor = this.produceProcessorMap.get(mime); if (null != processor) { return processor; diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java index 34621d6e2..623e1171a 100644 --- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java +++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java @@ -171,6 +171,20 @@ public void testEnsureFindProduceProcessorAcceptFound() { operationMeta.ensureFindProduceProcessor("text/plain;q=0.7;charset=utf-8,application/json;q=0.8")); } + @Test + public void testEnsureFindProduceProcessorWithDownload() { +RestOperationMeta operationMeta = new RestOperationMeta(); +operationMeta.produces = Arrays.asList(MediaType.APPLICATION_JSON); +operationMeta.downloadFile = true; +operationMeta.createProduceProcessors(); + +Assert.assertSame(ProduceProcessorManager.JSON_PROCESSOR, +operationMeta.ensureFindProduceProcessor("text/plain")); + +operationMeta.downloadFile = false; +Assert.assertNull(operationMeta.ensureFindProduceProcessor("text/plain")); + } + @Test public void testEnsureFindProduceProcessorAcceptNotFound() { RestOperationMeta operationMeta = new RestOperationMeta(); diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDownload.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDownload.java index 9a3
[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701860#comment-16701860 ] ASF GitHub Bot commented on SCB-1054: - heyile opened a new pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType URL: https://github.com/apache/servicecomb-java-chassis/pull/1016 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when download file, we should ignore consumer acceptType > > > Key: SCB-1054 > URL: https://issues.apache.org/jira/browse/SCB-1054 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Critical > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701822#comment-16701822 ] ASF GitHub Bot commented on SCB-1054: - heyile opened a new pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType URL: https://github.com/apache/servicecomb-java-chassis/pull/1016 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when download file, we should ignore consumer acceptType > > > Key: SCB-1054 > URL: https://issues.apache.org/jira/browse/SCB-1054 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Critical > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1051) when interface set produces=text/plain;charset=utf-8. and consumers set accept = text/plain,will cause error
[ https://issues.apache.org/jira/browse/SCB-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701809#comment-16701809 ] ASF GitHub Bot commented on SCB-1051: - coveralls commented on issue #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c… URL: https://github.com/apache/servicecomb-java-chassis/pull/1015#issuecomment-442428828 [![Coverage Status](https://coveralls.io/builds/20334594/badge)](https://coveralls.io/builds/20334594) Coverage increased (+0.008%) to 86.782% when pulling **8740e6be79a1858b64f21d815746bdca73ece34b on heyile:producerCharset** into **47d4773f3db7444e07fa2bb5bf87ac0a0387855f on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when interface set produces=text/plain;charset=utf-8. and consumers set > accept = text/plain,will cause error > > > Key: SCB-1051 > URL: https://issues.apache.org/jira/browse/SCB-1051 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Java-Chassis >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Major > Attachments: screenshot-1.png > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (SCB-1055) Please delete old releases from mirroring system
[ https://issues.apache.org/jira/browse/SCB-1055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb updated SCB-1055: -- Description: To reduce the load on the ASF mirrors, projects are required to delete old releases [1] Please can you remove all non-current releases from the dist/release area? It's unfair to expect the 3rd party mirrors to carry old releases. However you can still link to the archives for historic releases. Please also update your release procedures (if relevant) Thanks! [1] http://www.apache.org/dev/release.html#when-to-archive Summary: Please delete old releases from mirroring system (was: Pl) > Please delete old releases from mirroring system > > > Key: SCB-1055 > URL: https://issues.apache.org/jira/browse/SCB-1055 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: Sebb >Priority: Major > > To reduce the load on the ASF mirrors, projects are required to delete old > releases [1] > Please can you remove all non-current releases from the dist/release area? > It's unfair to expect the 3rd party mirrors to carry old releases. > However you can still link to the archives for historic releases. > Please also update your release procedures (if relevant) > Thanks! > [1] http://www.apache.org/dev/release.html#when-to-archive -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (SCB-1055) Pl
Sebb created SCB-1055: - Summary: Pl Key: SCB-1055 URL: https://issues.apache.org/jira/browse/SCB-1055 Project: Apache ServiceComb Issue Type: Bug Reporter: Sebb -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1050) Metrics cache does not clean
[ https://issues.apache.org/jira/browse/SCB-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701606#comment-16701606 ] ASF GitHub Bot commented on SCB-1050: - codecov-io commented on issue #500: SCB-1050 Metrics cache is not clean URL: https://github.com/apache/servicecomb-service-center/pull/500#issuecomment-442381056 # [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=h1) Report > Merging [#500](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/6a7379a35f939a2af837878d3aa61a8856c04ac4?src=pr&el=desc) will **decrease** coverage by `0.04%`. > The diff coverage is `72%`. [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/graphs/tree.svg?width=650&token=GAaF7zrg8R&height=150&src=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=tree) ```diff @@Coverage Diff@@ ## master#500 +/- ## = - Coverage 59.25% 59.2% -0.05% = Files 166 166 Lines 13880 13878 -2 = - Hits 82248217 -7 - Misses 50725074 +2 - Partials 584 587 +3 ``` | [Impacted Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [server/metric/gatherer.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL21ldHJpYy9nYXRoZXJlci5nbw==) | `68.42% <100%> (+1.75%)` | :arrow_up: | | [server/metric/metrics.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL21ldHJpYy9tZXRyaWNzLmdv) | `84% <66.66%> (-8.6%)` | :arrow_down: | | [server/metric/calculator.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL21ldHJpYy9jYWxjdWxhdG9yLmdv) | `64% <75%> (ø)` | :arrow_up: | | [server/plugin/pkg/registry/etcd/tracing.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvcmVnaXN0cnkvZXRjZC90cmFjaW5nLmdv) | `72.72% <0%> (-9.1%)` | :arrow_down: | | [server/service/util/tag\_util.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC90YWdfdXRpbC5nbw==) | `61.53% <0%> (-3.85%)` | :arrow_down: | | [pkg/tlsutil/tlsutil.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-cGtnL3Rsc3V0aWwvdGxzdXRpbC5nbw==) | `73.58% <0%> (-0.95%)` | :arrow_down: | | [pkg/log/log\_zap.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-cGtnL2xvZy9sb2dfemFwLmdv) | | | | [pkg/log/log\_go19.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-cGtnL2xvZy9sb2dfZ28xOS5nbw==) | `100% <0%> (ø)` | | | [server/govern/service.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv) | `72.93% <0%> (+0.33%)` | :arrow_up: | | [server/service/notification/websocket.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2Uvbm90aWZpY2F0aW9uL3dlYnNvY2tldC5nbw==) | `84.51% <0%> (+0.64%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=footer). Last update [6a7379a...6e4d20a](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Metrics cache does not clean > > > Key: SCB-1050 > URL: https://issues.apache.org/jira/browse/SCB-1050 > Project: Apache ServiceComb > Issue Type: Bug > Components: Service-Center >Reporter:
[jira] [Commented] (SCB-1050) Metrics cache does not clean
[ https://issues.apache.org/jira/browse/SCB-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701605#comment-16701605 ] ASF GitHub Bot commented on SCB-1050: - coveralls edited a comment on issue #500: SCB-1050 Metrics cache is not clean URL: https://github.com/apache/servicecomb-service-center/pull/500#issuecomment-442092784 [![Coverage Status](https://coveralls.io/builds/20331752/badge)](https://coveralls.io/builds/20331752) Coverage increased (+0.1%) to 61.722% when pulling **6e4d20a82de5dbf6072e7f86f923b3c4a669beca on little-cui:bug** into **6a7379a35f939a2af837878d3aa61a8856c04ac4 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Metrics cache does not clean > > > Key: SCB-1050 > URL: https://issues.apache.org/jira/browse/SCB-1050 > Project: Apache ServiceComb > Issue Type: Bug > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1050) Metrics cache does not clean
[ https://issues.apache.org/jira/browse/SCB-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701599#comment-16701599 ] ASF GitHub Bot commented on SCB-1050: - asifdxtreme closed pull request #500: SCB-1050 Metrics cache is not clean URL: https://github.com/apache/servicecomb-service-center/pull/500 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/server/metric/calculator.go b/server/metric/calculator.go index 7f0a8909..fea89ddb 100644 --- a/server/metric/calculator.go +++ b/server/metric/calculator.go @@ -55,14 +55,14 @@ func (c *CommonCalculator) Calc(mf *dto.MetricFamily) *Details { func metricGaugeOf(details *Details, m []*dto.Metric) { for _, d := range m { details.Summary += d.GetGauge().GetValue() - details.Put(d.GetLabel(), d.GetGauge().GetValue()) + details.put(d.GetLabel(), d.GetGauge().GetValue()) } } func metricCounterOf(details *Details, m []*dto.Metric) { for _, d := range m { details.Summary += d.GetCounter().GetValue() - details.Put(d.GetLabel(), d.GetCounter().GetValue()) + details.put(d.GetLabel(), d.GetCounter().GetValue()) } } @@ -74,7 +74,7 @@ func metricSummaryOf(details *Details, m []*dto.Metric) { for _, d := range m { count += d.GetSummary().GetSampleCount() sum += d.GetSummary().GetSampleSum() - details.Put(d.GetLabel(), d.GetSummary().GetSampleSum()/float64(d.GetSummary().GetSampleCount())) + details.put(d.GetLabel(), d.GetSummary().GetSampleSum()/float64(d.GetSummary().GetSampleCount())) } if count == 0 { @@ -92,7 +92,7 @@ func metricHistogramOf(details *Details, m []*dto.Metric) { for _, d := range m { count += d.GetHistogram().GetSampleCount() sum += d.GetHistogram().GetSampleSum() - details.Put(d.GetLabel(), d.GetHistogram().GetSampleSum()/float64(d.GetHistogram().GetSampleCount())) + details.put(d.GetLabel(), d.GetHistogram().GetSampleSum()/float64(d.GetHistogram().GetSampleCount())) } if count == 0 { diff --git a/server/metric/gatherer.go b/server/metric/gatherer.go index 52e2a598..48a1eed1 100644 --- a/server/metric/gatherer.go +++ b/server/metric/gatherer.go @@ -26,6 +26,7 @@ import ( "time" ) +// Gatherer is the reader of sc metrics var Gatherer *MetricsGatherer func init() { @@ -83,13 +84,16 @@ func (mm *MetricsGatherer) Collect() error { return err } + records := NewMetrics() for _, mf := range mfs { name := mf.GetName() if _, ok := SysMetrics.Get(name); strings.Index(name, familyNamePrefix) == 0 || ok { if d := Calculate(mf); d != nil { - mm.Records.Put(strings.TrimPrefix(name, familyNamePrefix), d) + records.put(strings.TrimPrefix(name, familyNamePrefix), d) } } } + // clean the old cache here + mm.Records = records return nil } diff --git a/server/metric/metrics.go b/server/metric/metrics.go index 738b813c..4987d7cc 100644 --- a/server/metric/metrics.go +++ b/server/metric/metrics.go @@ -18,20 +18,19 @@ package metric import ( "github.com/apache/servicecomb-service-center/pkg/buffer" - "github.com/apache/servicecomb-service-center/pkg/util" dto "github.com/prometheus/client_model/go" "strings" ) func NewMetrics() *Metrics { return &Metrics{ - mapper: util.NewConcurrentMap(0), + mapper: make(map[string]*Details), } } func NewDetails() *Details { return &Details{ - mapper: util.NewConcurrentMap(0), + mapper: make(map[string]float64), buffer: buffer.NewPool(bufferSize), } } @@ -41,7 +40,7 @@ type Details struct { // Summary is the calculation results of the details Summary float64 - mapper *util.ConcurrentMap + mapper map[string]float64 buffer *buffer.Pool } @@ -71,52 +70,52 @@ func (cm *Details) toLabels(key string) (p []*dto.LabelPair) { } func (cm *Details) Get(labels []*dto.LabelPair) (val float64) { - if v, ok := cm.mapper.Get(cm.toKey(labels)); ok { - val = v.(float64) + if v, ok := cm.mapper[cm.toKey(labels)]; ok { + val = v } return } -func (cm *Details) Put(labels []*dto.LabelPair, val float64) { - cm.mapper.Put(cm.toKey(labels), val) +func (cm
[jira] [Commented] (SCB-1032) Support compress the response
[ https://issues.apache.org/jira/browse/SCB-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701598#comment-16701598 ] ASF GitHub Bot commented on SCB-1032: - coveralls edited a comment on issue #496: SCB-1032 Support compress the response URL: https://github.com/apache/servicecomb-service-center/pull/496#issuecomment-440688511 [![Coverage Status](https://coveralls.io/builds/20331757/badge)](https://coveralls.io/builds/20331757) Coverage decreased (-0.1%) to 61.513% when pulling **bd1dc98e9a26cd4400c0e3c26a845e13c5374653 on little-cui:gzip** into **6a7379a35f939a2af837878d3aa61a8856c04ac4 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Support compress the response > - > > Key: SCB-1032 > URL: https://issues.apache.org/jira/browse/SCB-1032 > Project: Apache ServiceComb > Issue Type: New Feature > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1032) Support compress the response
[ https://issues.apache.org/jira/browse/SCB-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701597#comment-16701597 ] ASF GitHub Bot commented on SCB-1032: - asifdxtreme closed pull request #496: SCB-1032 Support compress the response URL: https://github.com/apache/servicecomb-service-center/pull/496 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/glide.yaml b/glide.yaml index 16133dc5..21b66d67 100644 --- a/glide.yaml +++ b/glide.yaml @@ -289,6 +289,9 @@ import: - package: github.com/natefinch/lumberjack version: a96e63847dc3c67d17befa69c303767e2f84e54f repo: https://github.com/natefinch/lumberjack +- package: github.com/NYTimes/gziphandler + version: 253f1acb9d9f896d86c313a3dc994c0b114f0e12 + repo: https://github.com/NYTimes/gziphandler # k8s 1.10.4 deps - package: k8s.io/client-go diff --git a/go.mod b/go.mod index bf3d4b3f..238ba934 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ replace ( ) require ( + github.com/NYTimes/gziphandler v1.0.2-0.20180820182813-253f1acb9d9f github.com/Shopify/sarama v1.18.0 // indirect github.com/apache/thrift v0.0.0-20180125231006-3d556248a8b9 // indirect github.com/astaxie/beego v1.8.0 diff --git a/pkg/client/sc/config.go b/pkg/client/sc/config.go index 128df5c9..1a8e4bb9 100644 --- a/pkg/client/sc/config.go +++ b/pkg/client/sc/config.go @@ -43,5 +43,6 @@ func (cfg *Config) Merge() rest.URLClientOption { if cfg.RequestTimeout == 0 { cfg.RequestTimeout = defaultRequestTimeout } + cfg.Compressed = true return cfg.URLClientOption } diff --git a/pkg/rest/client.go b/pkg/rest/client.go index 4a2d2f61..82506378 100644 --- a/pkg/rest/client.go +++ b/pkg/rest/client.go @@ -17,12 +17,15 @@ package rest import ( "bytes" + "compress/gzip" "crypto/tls" "errors" "fmt" "github.com/apache/servicecomb-service-center/pkg/tlsutil" "github.com/apache/servicecomb-service-center/pkg/util" "golang.org/x/net/context" + "io" + "io/ioutil" "net/http" "net/url" "os" @@ -57,6 +60,24 @@ type URLClientOption struct { ConnsPerHost int } +type gzipBodyReader struct { + *gzip.Reader + Body io.ReadCloser +} + +func (w *gzipBodyReader) Close() error { + w.Reader.Close() + return w.Body.Close() +} + +func NewGZipBodyReader(body io.ReadCloser) (io.ReadCloser, error) { + reader, err := gzip.NewReader(body) + if err != nil { + return nil, err + } + return &gzipBodyReader{reader, body}, nil +} + type URLClient struct { *http.Client @@ -76,18 +97,18 @@ func (client *URLClient) HttpDoWithContext(ctx context.Context, method string, r headers = make(http.Header) } - if _, ok := headers["Host"]; !ok { + if _, ok := headers[HEADER_HOST]; !ok { parsedURL, err := url.Parse(rawURL) if err != nil { return nil, err } - headers.Set("Host", parsedURL.Host) + headers.Set(HEADER_HOST, parsedURL.Host) } - if _, ok := headers["Accept"]; !ok { - headers.Set("Accept", "*/*") + if _, ok := headers[HEADER_ACCEPT]; !ok { + headers.Set(HEADER_ACCEPT, ACCEPT_ANY) } - if _, ok := headers["Accept-Encoding"]; !ok && client.Cfg.Compressed { - headers.Set("Accept-Encoding", "deflate, gzip") + if _, ok := headers[HEADER_ACCEPT_ENCODING]; !ok && client.Cfg.Compressed { + headers.Set(HEADER_ACCEPT_ENCODING, "deflate, gzip") } req, err := http.NewRequest(method, rawURL, bytes.NewBuffer(body)) @@ -101,6 +122,16 @@ func (client *URLClient) HttpDoWithContext(ctx context.Context, method string, r if err != nil { return nil, err } + switch resp.Header.Get(HEADER_CONTENT_ENCODING) { + case "gzip": + reader, err := NewGZipBodyReader(resp.Body) + if err != nil { + io.Copy(ioutil.Discard, resp.Body) + resp.Body.Close() + return nil, err + } + resp.Body = reader + } if os.Getenv("DEBUG_MODE") == "1" { fmt.Println("--- BEGIN ---") diff --git a/pkg/rest/common.go b/pkg/rest/common.go index 71858388..1d99ffc7 100644 --- a/pkg/rest/common.go +++ b/pkg/rest/common.go @@ -36,12 +36,14 @@ const ( HEADER_RESPONSE_STATUS = "X-Response-Status" HEADER_ALLOW= "Allow" +
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701596#comment-16701596 ] ASF GitHub Bot commented on SCB-925: weichao666 commented on a change in pull request #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#discussion_r237001406 ## File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/param/TestCookieProcessor.java ## @@ -67,8 +71,12 @@ public void testGetValueNoCookies() throws Exception { }; CookieProcessor processor = createProcessor("c1", String.class); -Object value = processor.getValue(request); -Assert.assertNull(value); +try { + processor.getValue(request); Review comment: done, make the old test case result not change,and add some new test case This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701593#comment-16701593 ] ASF GitHub Bot commented on SCB-925: weichao666 commented on a change in pull request #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#discussion_r237000982 ## File path: common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/param/QueryProcessorCreator.java ## @@ -68,10 +75,7 @@ public Object getValue(HttpServletRequest request) throws Exception { } } if (value == null) { - Object defaultValue = getDefaultValue(); - if (!ignoreDefaultValue && defaultValue != null) { Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701592#comment-16701592 ] ASF GitHub Bot commented on SCB-925: weichao666 commented on a change in pull request #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#discussion_r237000900 ## File path: common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/param/CookieProcessorCreator.java ## @@ -35,33 +38,37 @@ public static final String PARAMTYPE = "cookie"; public static class CookieProcessor extends AbstractParamProcessor { -public CookieProcessor(String paramPath, JavaType targetType, Object defaultValue) { - super(paramPath, targetType, defaultValue); +public CookieProcessor(String paramPath, JavaType targetType, Object defaultValue, boolean required) { + super(paramPath, targetType, defaultValue, required); } @Override public Object getValue(HttpServletRequest request) throws Exception { Cookie[] cookies = request.getCookies(); - if (cookies == null) { -return null; + Object value = null; + if (cookies == null || cookies.length == 0) { +value = checkRequiredAndDefaultValue(); +return convertValue(value, targetType); } - String value = null; for (Cookie cookie : cookies) { if (paramPath.equals(cookie.getName())) { value = cookie.getValue(); Review comment: done This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1032) Support compress the response
[ https://issues.apache.org/jira/browse/SCB-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701572#comment-16701572 ] ASF GitHub Bot commented on SCB-1032: - little-cui commented on issue #496: SCB-1032 Support compress the response URL: https://github.com/apache/servicecomb-service-center/pull/496#issuecomment-442374745 @asifdxtreme DONE! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Support compress the response > - > > Key: SCB-1032 > URL: https://issues.apache.org/jira/browse/SCB-1032 > Project: Apache ServiceComb > Issue Type: New Feature > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701553#comment-16701553 ] ASF GitHub Bot commented on SCB-925: coveralls edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441166462 [![Coverage Status](https://coveralls.io/builds/20331171/badge)](https://coveralls.io/builds/20331171) Coverage decreased (-0.03%) to 86.747% when pulling **a60b6c35aa2b12296f15536b8c7a2c6a41c94785 on weichao666:defaultvaluenew** into **47d4773f3db7444e07fa2bb5bf87ac0a0387855f on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701546#comment-16701546 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: 1. 生成契约 1. swagger annotation,用户写什么,就生成什么 2. jaxrs,用户写什么,就生成什么 3. springmvc,按springmvc标准 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2. 运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: 1. 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false 2. 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: 1. 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701556#comment-16701556 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: - 生成契约 swagger annotation,用户写什么,就生成什么 jaxrs,用户写什么,就生成什么 对于springmvc,按照springmvc标准, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false - 运行时 当相应的param未传输时,如果required为true,则报错 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: - 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false - 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: - 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false - 运行时 当相应的param未传输时,如果required为true,则报错 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701557#comment-16701557 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: - 生成契约 swagger annotation,用户写什么,就生成什么 jaxrs,用户写什么,就生成什么 对于springmvc,按照springmvc标准, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false - 运行时 当相应的param未传输时,如果required为true,则报错 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: - 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false - 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: - 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false - 运行时 当相应的param未传输时,如果required为true,则报错 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701554#comment-16701554 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: - 生成契约 swagger annotation,用户写什么,就生成什么 jaxrs,用户写什么,就生成什么 springmvc,按springmvc标准 如果没写defaultValue,required写什么,就生成什么 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false - 运行时 当相应的param未传输时,如果required为true,则报错 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: - 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false - 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: - 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false - 运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701548#comment-16701548 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: 生成契约 swagger annotation,用户写什么,就生成什么 jaxrs,用户写什么,就生成什么 springmvc,按springmvc标准 如果没写defaultValue,required写什么,就生成什么 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 运行时 当相应的param未传输时,如果required为true,则报错 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: 1. 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false 2. 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: 1. 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701547#comment-16701547 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: 生成契约 1. swagger annotation,用户写什么,就生成什么 2. jaxrs,用户写什么,就生成什么 3. springmvc,按springmvc标准 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: 1. 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false 2. 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: 1. 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701542#comment-16701542 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: 1. 生成契约 1. swagger annotation,用户写什么,就生成什么 2. jaxrs,用户写什么,就生成什么 3. springmvc,按springmvc标准 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2. 运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: 1. 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false 2. 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: 1. 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701544#comment-16701544 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: 1. 生成契约 1. swagger annotation,用户写什么,就生成什么 2. jaxrs,用户写什么,就生成什么 3. springmvc,按springmvc标准 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2. 运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: 1. 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false 2. 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: 1. 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-925) Springmvc, when have defaultValue, required should be false
[ https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701539#comment-16701539 ] ASF GitHub Bot commented on SCB-925: weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired URL: https://github.com/apache/servicecomb-java-chassis/pull/1004#issuecomment-441191265 swagger annotation: ApiImplicitParam 因为swagger的读取逻辑并没有在required、defaultValue之间产生干扰关系 所以,使用下面规则处理: 1. 生成契约 1. swagger annotation,用户写什么,就生成什么 2. jaxrs,用户写什么,就生成什么 3. springmvc,按springmvc标准 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 本次改动涉及变更: 修改前效果: 1. 生成契约: 对于springmvc开发方式,不管写没写defaultValue,required在契约中都是true,除非手动设为false 2. 运行时: 当相应的param未传输时,按照defaultValue处理 修改后效果对比: 1. 生成契约: 对于springmvc开发方式, 1. 如果没写defaultValue,required写什么,就生成什么 2. 如果写了defaultValue,则无论用户是怎么写的,required在契约中都是false 2.运行时 1. 当相应的param未传输时,如果required为true,则报错 2. 当相应的param未传输时,如果required为false,则按defaultValue处理 Generating schema: Springmvc, if do not write defaultValue, required's value is what user write if have written defaultValue,No matter how the user writes,required is false running: When param is not transmitted,if required is true, report error When param is not transmitted , if required is false, handle it with defaultValue This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Springmvc, when have defaultValue, required should be false > --- > > Key: SCB-925 > URL: https://issues.apache.org/jira/browse/SCB-925 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Reporter: WeiChao >Assignee: WeiChao >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (SCB-1054) when download file, we should ignore consumer acceptType
[ https://issues.apache.org/jira/browse/SCB-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] 何一乐 reassigned SCB-1054: Assignee: 何一乐 > when download file, we should ignore consumer acceptType > > > Key: SCB-1054 > URL: https://issues.apache.org/jira/browse/SCB-1054 > Project: Apache ServiceComb > Issue Type: Bug >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Critical > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (SCB-1054) when download file, we should ignore consumer acceptType
何一乐 created SCB-1054: Summary: when download file, we should ignore consumer acceptType Key: SCB-1054 URL: https://issues.apache.org/jira/browse/SCB-1054 Project: Apache ServiceComb Issue Type: Bug Reporter: 何一乐 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1051) when interface set produces=text/plain;charset=utf-8. and consumers set accept = text/plain,will cause error
[ https://issues.apache.org/jira/browse/SCB-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701525#comment-16701525 ] ASF GitHub Bot commented on SCB-1051: - heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c… URL: https://github.com/apache/servicecomb-java-chassis/pull/1015#discussion_r236980511 ## File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java ## @@ -147,6 +147,18 @@ public void testCreateProduceProcessorsTextAndWildcard() { MediaType.APPLICATION_JSON + "," + MediaType.APPLICATION_XML + "," + MediaType.WILDCARD)); } + @Test + public void testCreateProduceProcessorsWithSemicolon() { Review comment: ok. l see This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when interface set produces=text/plain;charset=utf-8. and consumers set > accept = text/plain,will cause error > > > Key: SCB-1051 > URL: https://issues.apache.org/jira/browse/SCB-1051 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Java-Chassis >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Major > Attachments: screenshot-1.png > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1051) when interface set produces=text/plain;charset=utf-8. and consumers set accept = text/plain,will cause error
[ https://issues.apache.org/jira/browse/SCB-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701521#comment-16701521 ] ASF GitHub Bot commented on SCB-1051: - heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c… URL: https://github.com/apache/servicecomb-java-chassis/pull/1015#discussion_r236980603 ## File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java ## @@ -147,6 +147,18 @@ public void testCreateProduceProcessorsTextAndWildcard() { MediaType.APPLICATION_JSON + "," + MediaType.APPLICATION_XML + "," + MediaType.WILDCARD)); } + @Test + public void testCreateProduceProcessorsWithSemicolon() { Review comment: ok, I see This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when interface set produces=text/plain;charset=utf-8. and consumers set > accept = text/plain,will cause error > > > Key: SCB-1051 > URL: https://issues.apache.org/jira/browse/SCB-1051 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Java-Chassis >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Major > Attachments: screenshot-1.png > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1051) when interface set produces=text/plain;charset=utf-8. and consumers set accept = text/plain,will cause error
[ https://issues.apache.org/jira/browse/SCB-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701524#comment-16701524 ] ASF GitHub Bot commented on SCB-1051: - heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c… URL: https://github.com/apache/servicecomb-java-chassis/pull/1015#discussion_r236980603 ## File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java ## @@ -147,6 +147,18 @@ public void testCreateProduceProcessorsTextAndWildcard() { MediaType.APPLICATION_JSON + "," + MediaType.APPLICATION_XML + "," + MediaType.WILDCARD)); } + @Test + public void testCreateProduceProcessorsWithSemicolon() { Review comment: ok, I see This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when interface set produces=text/plain;charset=utf-8. and consumers set > accept = text/plain,will cause error > > > Key: SCB-1051 > URL: https://issues.apache.org/jira/browse/SCB-1051 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Java-Chassis >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Major > Attachments: screenshot-1.png > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1051) when interface set produces=text/plain;charset=utf-8. and consumers set accept = text/plain,will cause error
[ https://issues.apache.org/jira/browse/SCB-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701520#comment-16701520 ] ASF GitHub Bot commented on SCB-1051: - heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c… URL: https://github.com/apache/servicecomb-java-chassis/pull/1015#discussion_r236980511 ## File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/TestRestOperationMeta.java ## @@ -147,6 +147,18 @@ public void testCreateProduceProcessorsTextAndWildcard() { MediaType.APPLICATION_JSON + "," + MediaType.APPLICATION_XML + "," + MediaType.WILDCARD)); } + @Test + public void testCreateProduceProcessorsWithSemicolon() { Review comment: ok. let me see This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > when interface set produces=text/plain;charset=utf-8. and consumers set > accept = text/plain,will cause error > > > Key: SCB-1051 > URL: https://issues.apache.org/jira/browse/SCB-1051 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Java-Chassis >Reporter: 何一乐 >Assignee: 何一乐 >Priority: Major > Attachments: screenshot-1.png > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-1052) import zap logger without binding go version
[ https://issues.apache.org/jira/browse/SCB-1052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701507#comment-16701507 ] ASF GitHub Bot commented on SCB-1052: - little-cui closed pull request #501: SCB-1052 Import zap logger without binding go version URL: https://github.com/apache/servicecomb-service-center/pull/501 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pkg/log/log.go b/pkg/log/log.go index e2539de9..43d0cfa8 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !go1.9 +// +build nozap package log diff --git a/pkg/log/log_go19.go b/pkg/log/log_zap.go similarity index 98% rename from pkg/log/log_go19.go rename to pkg/log/log_zap.go index 101a419c..f0c6abf9 100644 --- a/pkg/log/log_go19.go +++ b/pkg/log/log_zap.go @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build go1.9 +// +build !nozap package log This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > import zap logger without binding go version > > > Key: SCB-1052 > URL: https://issues.apache.org/jira/browse/SCB-1052 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (SCB-1052) import zap logger without binding go version
[ https://issues.apache.org/jira/browse/SCB-1052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] little-cui resolved SCB-1052. - Resolution: Fixed > import zap logger without binding go version > > > Key: SCB-1052 > URL: https://issues.apache.org/jira/browse/SCB-1052 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (SCB-1050) Metrics cache does not clean
[ https://issues.apache.org/jira/browse/SCB-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] little-cui resolved SCB-1050. - Resolution: Fixed > Metrics cache does not clean > > > Key: SCB-1050 > URL: https://issues.apache.org/jira/browse/SCB-1050 > Project: Apache ServiceComb > Issue Type: Bug > Components: Service-Center >Reporter: little-cui >Assignee: little-cui >Priority: Major > Fix For: service-center-1.2.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)