[GitHub] stashslash opened a new issue #346: compensation method invoke before compensable method
stashslash opened a new issue #346: compensation method invoke before compensable method URL: https://github.com/apache/servicecomb-saga/issues/346 i test the `saga-spring-demo` if i modify the `HotelBookingService` add some sleep code, like: ``` @Compensable(compensationMethod = "cancel", timeout = 5) void order(HotelBooking booking) { if (booking.getAmount() > 2) { throw new IllegalArgumentException("can not order the rooms large than two"); } booking.confirm(); // sleep 10 sec, simulate slow db try { Thread.sleep(10 * 1000); } catch (InterruptedException e) { e.printStackTrace(); } bookings.put(booking.getId(), booking); } ``` then, i call the booking rest api, and got the booking result from hotel service and car service, the result looks like: - hotel service: `[{"name":"test","amount":2,"confirmed":true,"cancelled":false}]` - car service: `[{"name":"test","amount":2,"confirmed":false,"cancelled":true}]` it's looks like car service compensated success, but hotel service compensated failure. so, did i missing anything? 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 With regards, Apache Git Services
[servicecomb-website] 02/03: Merge branch 'master' into asf-site
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git commit 32842f3a52f83482a733ab5c9ac08f4232914619 Merge: ee7e15a fcb0e0d Author: Willem Jiang AuthorDate: Thu Nov 29 12:39:02 2018 +0800 Merge branch 'master' into asf-site _posts/cn/2018-04-26-distributed-transactions-saga.md | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)
[servicecomb-website] 03/03: Publish the website
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git commit 56d68ef51bc3b6984a740191d484bf03ef0c9684 Author: Willem Jiang AuthorDate: Thu Nov 29 14:15:33 2018 +0800 Publish the website --- .../distributed-transactions-saga-implementation/index.html| 10 +- content/feed.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/cn/docs/distributed-transactions-saga-implementation/index.html b/content/cn/docs/distributed-transactions-saga-implementation/index.html index 6ff99cb..e285652 100644 --- a/content/cn/docs/distributed-transactions-saga-implementation/index.html +++ b/content/cn/docs/distributed-transactions-saga-implementation/index.html @@ -398,7 +398,7 @@ -今天的议题围绕几个方面来展开,一个是微服务事务一致性的问题,然后讲一讲业界的SAGA解决方案,我们在ServiceComb里也提供了SAGA的实现。另外一件事情,我项目这边也在招新,欢迎广大感兴趣的同学一会儿加我微信。我们现在项目其实架子也都搭得不错了,就是等着大家跳到碗里面,一起来解决微服务事务一致性问题。 +今天的议题围绕几个方面来展开,一个是微服务事务一致性的问题,然后讲一讲业界的SAGA解决方案,我们在ServiceComb里也提供了SAGA的实现。另外一件事情,我项目这边也在招新,欢迎广大感兴趣的同学一会儿加我微信。我们现在项目其实架子也都搭得不错了,基本功能都实现了,就是等着大家跳到碗里面,一起来解决微服务事务一致性问题。 @@ -422,7 +422,7 @@ 由于隔离性互斥的要求,在事务执行过程中,所有的资源都是被锁定的,这种情况只适合执行时间确定的短事务。 但是为了保证分布式事务的一致性,大都是采用串行化的隔离级别来保证事务一致性,这样会降低系统的吞吐。 -但因为2PC的协议成本比较高,又有全局锁的问题,性能会比较差。 因此现在大家基本上不会采用这种强一致解决方案。 +但因为2PC的协议成本比较高,又有全局锁的问题,性能会比较差。 现在大家基本上不会采用这种强一致解决方案。 @@ -452,13 +452,13 @@ -Saga其实是30年前的一篇数据库论文里提到的一个概念。在论文中一个Saga事务是由多个本地事务所组成, 每个本地事务有相应的执行模块和补偿模块,当saga事务中的任意一个本地事务出错了, 可以通过调用相关的补充方法恢复之前的事务,达到事务的最终一致性。 +Saga其实是30年前的一篇数据库论文里提到的一个概念。在论文中一个Saga事务就是一个长期运行的事务,这个事务是由多个本地事务所组成, 每个本地事务有相应的执行模块和补偿模块,当saga事务中的任意一个本地事务出错了, 可以通过调用相关事务对应的补偿方法恢复,达到事务的最终一致性。 -Saga概念虽然提出来快30年了, 随着微服务的复杂,引出了分布式Saga问题近些年也逐步受到大家的关注。 +Saga概念虽然提出来快30年了, 随着微服务的出现,越来越多的人想解决分布式事务问题,Saga也逐步受到大家的关注。 -我们在实现Saga模型的时候,主要是参考了Caitie McCaffrey 在分布式Saga论文,以及Chris Richardson的研究。 大家可以通过下面的链接获取相关的信息。 +我们在实现Saga过程中,主要是参考了Caitie McCaffrey 在分布式Saga论文,以及Chris Richardson的研究。 大家可以通过下面的链接获取相关的信息。 diff --git a/content/feed.xml b/content/feed.xml index bf004c6..cd08120 100644 --- a/content/feed.xml +++ b/content/feed.xml @@ -1,4 +1,4 @@ -http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.4.3">Jekyll2018-11-28T21:16:48+08:00/Apache ServiceCombThe homepage of ServiceComb{name=nil, avatar=/assets [...] +http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.4.3">Jekyll2018-11-29T12:39:11+08:00/Apache ServiceCombThe homepage of ServiceComb{name=nil, avatar=/assets [...] blockquote p前几天收到了Apache ServiceComb PMC的邀请邮件,这意味着我成为了一名Apache ServiceComb项目的Committer。喜悦之余,我想留下一篇博客作为自己工作的一个阶段性总结,同时也希望这篇文章能够给其他想要加入到开源社区的同学一点参考。/p
[servicecomb-website] 01/03: Polish the blog of distributed transactions
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git commit fcb0e0d2dc50a172374a4a41bb0e98057e8938e2 Author: Willem Jiang AuthorDate: Thu Nov 29 12:38:20 2018 +0800 Polish the blog of distributed transactions --- _posts/cn/2018-04-26-distributed-transactions-saga.md | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_posts/cn/2018-04-26-distributed-transactions-saga.md b/_posts/cn/2018-04-26-distributed-transactions-saga.md index abde184..67da33a 100644 --- a/_posts/cn/2018-04-26-distributed-transactions-saga.md +++ b/_posts/cn/2018-04-26-distributed-transactions-saga.md @@ -21,7 +21,7 @@ redirect_from: ![]({{ site.url }}{{ site.baseurl }}/assets/images/saga/Saga.003.jpeg) -今天的议题围绕几个方面来展开,一个是微服务事务一致性的问题,然后讲一讲业界的SAGA解决方案,我们在ServiceComb里也提供了SAGA的实现。另外一件事情,我项目这边也在招新,欢迎广大感兴趣的同学一会儿加我微信。我们现在项目其实架子也都搭得不错了,就是等着大家跳到碗里面,一起来解决微服务事务一致性问题。 +今天的议题围绕几个方面来展开,一个是微服务事务一致性的问题,然后讲一讲业界的SAGA解决方案,我们在ServiceComb里也提供了SAGA的实现。另外一件事情,我项目这边也在招新,欢迎广大感兴趣的同学一会儿加我微信。我们现在项目其实架子也都搭得不错了,基本功能都实现了,就是等着大家跳到碗里面,一起来解决微服务事务一致性问题。 ![]({{ site.url }}{{ site.baseurl }}/assets/images/saga/Saga.004.jpeg) @@ -45,7 +45,7 @@ redirect_from: 由于隔离性互斥的要求,在事务执行过程中,所有的资源都是被锁定的,这种情况只适合执行时间确定的短事务。 但是为了保证分布式事务的一致性,大都是采用串行化的隔离级别来保证事务一致性,这样会降低系统的吞吐。 -但因为2PC的协议成本比较高,又有全局锁的问题,性能会比较差。 因此现在大家基本上不会采用这种强一致解决方案。 +但因为2PC的协议成本比较高,又有全局锁的问题,性能会比较差。 现在大家基本上不会采用这种强一致解决方案。 ![]({{ site.url }}{{ site.baseurl }}/assets/images/saga/Saga.008.jpeg) @@ -76,13 +76,13 @@ TCC名字的由来是其中包含了 try, confirm, cancel三个操作。 ![]({{ site.url }}{{ site.baseurl }}/assets/images/saga/Saga.012.jpeg) -Saga其实是30年前的一篇数据库论文里提到的一个概念。在论文中一个Saga事务是由多个本地事务所组成, 每个本地事务有相应的执行模块和补偿模块,当saga事务中的任意一个本地事务出错了, 可以通过调用相关的补充方法恢复之前的事务,达到事务的最终一致性。 +Saga其实是30年前的一篇数据库论文里提到的一个概念。在论文中一个Saga事务就是一个长期运行的事务,这个事务是由多个本地事务所组成, 每个本地事务有相应的执行模块和补偿模块,当saga事务中的任意一个本地事务出错了, 可以通过调用相关事务对应的补偿方法恢复,达到事务的最终一致性。 ![]({{ site.url }}{{ site.baseurl }}/assets/images/saga/Saga.013.jpeg) -Saga概念虽然提出来快30年了, 随着微服务的复杂,引出了分布式Saga问题近些年也逐步受到大家的关注。 +Saga概念虽然提出来快30年了, 随着微服务的出现,越来越多的人想解决分布式事务问题,Saga也逐步受到大家的关注。 -我们在实现Saga模型的时候,主要是参考了Caitie McCaffrey 在分布式Saga论文,以及Chris Richardson的研究。 大家可以通过下面的链接获取相关的信息。 +我们在实现Saga过程中,主要是参考了Caitie McCaffrey 在分布式Saga论文,以及Chris Richardson的研究。 大家可以通过下面的链接获取相关的信息。 ![]({{ site.url }}{{ site.baseurl }}/assets/images/saga/Saga.016.jpeg)
[servicecomb-website] branch asf-site updated (ee7e15a -> 56d68ef)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git. from ee7e15a Publish the website new fcb0e0d Polish the blog of distributed transactions new 32842f3 Merge branch 'master' into asf-site new 56d68ef Publish the website The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: _posts/cn/2018-04-26-distributed-transactions-saga.md | 10 +- .../distributed-transactions-saga-implementation/index.html| 10 +- content/feed.xml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-)
[GitHub] asifdxtreme commented on a change in pull request #502: WIP: SCB-1053 Batch microservices instances discovery API
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 With regards, Apache Git Services
[GitHub] coveralls commented on issue #1016: [SCB-1054]when download file, we should ignore consumer acceptType
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 With regards, Apache Git Services
[GitHub] coveralls edited a comment on issue #502: WIP: SCB-1053 Batch microservices instances discovery API
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 With regards, Apache Git Services
[GitHub] codecov-io edited a comment on issue #502: WIP: SCB-1053 Batch microservices instances discovery API
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=h1) Report > Merging [#502](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de?src=pr=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=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr=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=tree) | Coverage Δ | | |---|---|---| | [server/core/proto/types.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr=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=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=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=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=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=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=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=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=footer). Last update [6285f2b...d04027c](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr=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 With regards, Apache Git Services
[GitHub] coveralls commented on issue #502: WIP: SCB-1053 Batch microservices instances discovery API
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 With regards, Apache Git Services
[GitHub] codecov-io commented on issue #502: WIP: SCB-1053 Batch microservices instances discovery API
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=h1) Report > Merging [#502](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de?src=pr=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=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr=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=tree) | Coverage Δ | | |---|---|---| | [server/core/proto/types.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr=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=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=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvZGlzY292ZXJ5L2V0Y2QvcmVwby5nbw==) | `100% <100%> (ø)` | :arrow_up: | | [pkg/tlsutil/tlsutil.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/502/diff?src=pr=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=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=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=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=footer). Last update [6285f2b...d04027c](https://codecov.io/gh/apache/servicecomb-service-center/pull/502?src=pr=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 With regards, Apache Git Services
[GitHub] little-cui opened a new pull request #502: WIP: SCB-1053 Batch microservices instances discovery API
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 With regards, Apache Git Services
[GitHub] heyile closed pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType
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 9a3947c5f..414b4c1f0 100644 --- 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 @@ -32,6 +32,11
[GitHub] heyile opened a new pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType
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 With regards, Apache Git Services
[servicecomb-website] branch asf-site updated: Publish the website
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git The following commit(s) were added to refs/heads/asf-site by this push: new ee7e15a Publish the website ee7e15a is described below commit ee7e15a9ccf5358f528cf76a768dbe2c9438bdb3 Author: Willem Jiang AuthorDate: Wed Nov 28 21:32:23 2018 +0800 Publish the website --- content/cn/release/saga-downloads/index.html | 2 +- content/feed.xml | 2 +- content/release/saga-downloads/index.html| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/cn/release/saga-downloads/index.html b/content/cn/release/saga-downloads/index.html index c3f6a43..adef1e4 100644 --- a/content/cn/release/saga-downloads/index.html +++ b/content/cn/release/saga-downloads/index.html @@ -370,7 +370,7 @@ 发布包 - Apache ServiceComb (incubating) Saga 0.2.1 (LATEST) + Apache ServiceComb Saga 0.2.1 (LATEST) 源码 https://apache.org/dyn/closer.cgi/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-src.zip;>[src] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-src.zip.asc;>[asc] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-src.zip.sha512;>[sha512] 发布包 https://apache.org/dyn/closer.cgi/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-bin.zip;>[Binary] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-bin.zip.asc;>[asc] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-bin.zip.sha512;>[sha512] diff --git a/content/feed.xml b/content/feed.xml index 7fadc17..bf004c6 100644 --- a/content/feed.xml +++ b/content/feed.xml @@ -1,4 +1,4 @@ -http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.4.3">Jekyll2018-11-27T09:59:35+08:00/Apache ServiceCombThe homepage of ServiceComb{name=nil, avatar=/assets [...] +http://www.w3.org/2005/Atom; >https://jekyllrb.com/; version="3.4.3">Jekyll2018-11-28T21:16:48+08:00/Apache ServiceCombThe homepage of ServiceComb{name=nil, avatar=/assets [...] blockquote p前几天收到了Apache ServiceComb PMC的邀请邮件,这意味着我成为了一名Apache ServiceComb项目的Committer。喜悦之余,我想留下一篇博客作为自己工作的一个阶段性总结,同时也希望这篇文章能够给其他想要加入到开源社区的同学一点参考。/p diff --git a/content/release/saga-downloads/index.html b/content/release/saga-downloads/index.html index be7c966..e87cf59 100644 --- a/content/release/saga-downloads/index.html +++ b/content/release/saga-downloads/index.html @@ -369,7 +369,7 @@ Releases - Apache ServiceComb (incubating) Saga 0.2.1(LATEST) + Apache ServiceComb Saga 0.2.1(LATEST) Source https://apache.org/dyn/closer.cgi/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-src.zip;>[src] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-src.zip.asc;>[asc] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-src.zip.sha512;>[sha512] Distribution https://apache.org/dyn/closer.cgi/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-bin.zip;>[Binary] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-bin.zip.asc;>[asc] https://www.apache.org/dist/servicecomb/servicecomb-saga/0.2.1/apache-servicecomb-saga-distribution-0.2.1-bin.zip.sha512;>[sha512]
[servicecomb-website] branch master updated (f3d6844 -> ddcc419)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git. from f3d6844 Fixed the links of sha512 and asc files add ddcc419 Fixed the release page issue No new revisions were added by this update. Summary of changes: _release/cn/saga_downloads.md | 2 +- _release/saga_downloads.md| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
[servicecomb-website] 01/01: Merge branch 'master' into asf-site
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git commit 12109ea4a9656866491b86a888ee7f0e8e77caa9 Merge: 314deef ddcc419 Author: Willem Jiang AuthorDate: Wed Nov 28 21:16:38 2018 +0800 Merge branch 'master' into asf-site _release/cn/saga_downloads.md | 2 +- _release/saga_downloads.md| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
[servicecomb-website] branch asf-site updated (314deef -> 12109ea)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch asf-site in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git. from 314deef Publish the Website add f3d6844 Fixed the links of sha512 and asc files add ddcc419 Fixed the release page issue new 12109ea Merge branch 'master' into asf-site The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: _release/cn/saga_downloads.md | 2 +- _release/saga_downloads.md| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
[GitHub] heyile opened a new pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType
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 With regards, Apache Git Services
[GitHub] heyile closed pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType
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 9a3947c5f..414b4c1f0 100644 --- 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 @@ -32,6 +32,11
[GitHub] heyile opened a new pull request #1016: [SCB-1054]when download file, we should ignore consumer acceptType
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 With regards, Apache Git Services
[GitHub] coveralls commented on issue #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c…
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 With regards, Apache Git Services
[GitHub] coveralls edited a comment on issue #500: SCB-1050 Metrics cache is not clean
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 With regards, Apache Git Services
[GitHub] codecov-io commented on issue #500: SCB-1050 Metrics cache is not clean
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=h1) Report > Merging [#500](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/6a7379a35f939a2af837878d3aa61a8856c04ac4?src=pr=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=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr=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=tree) | Coverage Δ | | |---|---|---| | [server/metric/gatherer.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr=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=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=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=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=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=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=tree#diff-cGtnL2xvZy9sb2dfemFwLmdv) | | | | [pkg/log/log\_go19.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr=tree#diff-cGtnL2xvZy9sb2dfZ28xOS5nbw==) | `100% <0%> (ø)` | | | [server/govern/service.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/500/diff?src=pr=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=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=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=footer). Last update [6a7379a...6e4d20a](https://codecov.io/gh/apache/servicecomb-service-center/pull/500?src=pr=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 With regards, Apache Git Services
[servicecomb-service-center] branch master updated: SCB-1050 Metrics cache does not clean (#500)
This is an automated email from the ASF dual-hosted git repository. asifdxtreme pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git The following commit(s) were added to refs/heads/master by this push: new 6285f2b SCB-1050 Metrics cache does not clean (#500) 6285f2b is described below commit 6285f2bb9cb4b6ad7195dfaf931bfb0ba89561de Author: little-cui AuthorDate: Wed Nov 28 17:31:51 2018 +0800 SCB-1050 Metrics cache does not clean (#500) --- server/metric/calculator.go | 8 +++ server/metric/gatherer.go | 6 +- server/metric/metrics.go | 49 +-- server/metric/metrics_test.go | 10 - 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/server/metric/calculator.go b/server/metric/calculator.go index 7f0a890..fea89dd 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 52e2a59..48a1eed 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 738b813..4987d7c 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 { - mapper: util.NewConcurrentMap(0), + mapper: make(map[string]*Details), } } func NewDetails() *Details { return { - 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)
[GitHub] asifdxtreme closed pull request #500: SCB-1050 Metrics cache is not clean
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 { - mapper: util.NewConcurrentMap(0), + mapper: make(map[string]*Details), } } func NewDetails() *Details { return { - 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 *Details) put(labels []*dto.LabelPair, val float64) { + cm.mapper[cm.toKey(labels)] = val return } func (cm *Details) ForEach(f func(labels []*dto.LabelPair, v float64) (next bool)) { - cm.mapper.ForEach(func(item util.MapItem) (next bool) {
[GitHub] coveralls edited a comment on issue #496: SCB-1032 Support compress the response
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 With regards, Apache Git Services
[GitHub] asifdxtreme closed pull request #496: SCB-1032 Support compress the response
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 {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" + HEADER_HOST = "Host" HEADER_SERVER = "Server" HEADER_CONTENT_TYPE = "Content-Type" HEADER_CONTENT_ENCODING = "Content-Encoding" HEADER_ACCEPT = "Accept" HEADER_ACCEPT_ENCODING =
[servicecomb-service-center] branch master updated: SCB-1032 Support compress the response (#496)
This is an automated email from the ASF dual-hosted git repository. asifdxtreme pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git The following commit(s) were added to refs/heads/master by this push: new e2ae9db SCB-1032 Support compress the response (#496) e2ae9db is described below commit e2ae9db26bb2d5ae202fca83d1ddd8616768865f Author: little-cui AuthorDate: Wed Nov 28 17:30:41 2018 +0800 SCB-1032 Support compress the response (#496) * SCB-1032 Support compress the response * SCB-1032 Bug fixes * SCB-1053 Update the LICENSE --- glide.yaml | 3 ++ go.mod | 1 + pkg/client/sc/config.go| 1 + pkg/rest/client.go | 43 +++--- pkg/rest/common.go | 2 + pkg/rest/server.go | 13 ++- scripts/release/LICENSE| 1 + .../pkg/discovery/servicecenter/aggregate.go | 4 +- server/plugin/pkg/registry/common.go | 2 +- server/plugin/pkg/registry/config.go | 2 +- server/rest/server.go | 2 +- 11 files changed, 63 insertions(+), 11 deletions(-) diff --git a/glide.yaml b/glide.yaml index 16133dc..21b66d6 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 bf3d4b3..238ba93 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 128df5c..1a8e4bb 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 4a2d2f6..8250637 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 {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
[GitHub] 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
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 With regards, Apache Git Services
[GitHub] 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
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 With regards, Apache Git Services
[GitHub] 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
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 With regards, Apache Git Services
[GitHub] little-cui commented on issue #496: SCB-1032 Support compress the response
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] coveralls edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] weichao666 edited a comment on issue #1004: [SCB-925] Springmvc, when have defaultValue, required should be false, when param not exist, should check isRequired
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 With regards, Apache Git Services
[GitHub] heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c…
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 With regards, Apache Git Services
[GitHub] heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c…
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 With regards, Apache Git Services
[GitHub] heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c…
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 With regards, Apache Git Services
[GitHub] heyile commented on a change in pull request #1015: [SCB-1051]when interface set produces=text/plain;charset=utf-8. and c…
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 With regards, Apache Git Services
[GitHub] little-cui closed pull request #501: SCB-1052 Import zap logger without binding go version
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 With regards, Apache Git Services
[servicecomb-service-center] branch master updated: SCB-1052 Import zap logger without binding go version (#501)
This is an automated email from the ASF dual-hosted git repository. littlecui pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git The following commit(s) were added to refs/heads/master by this push: new 6a7379a SCB-1052 Import zap logger without binding go version (#501) 6a7379a is described below commit 6a7379a35f939a2af837878d3aa61a8856c04ac4 Author: little-cui AuthorDate: Wed Nov 28 16:09:22 2018 +0800 SCB-1052 Import zap logger without binding go version (#501) --- pkg/log/log.go | 2 +- pkg/log/{log_go19.go => log_zap.go} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/log/log.go b/pkg/log/log.go index e2539de..43d0cfa 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 101a419..f0c6abf 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