[GitHub] coveralls edited a comment on issue #771: [SCB-679] Support Cross-Origin Resource Sharing (CORS)

2018-06-20 Thread GitBox
coveralls edited a comment on issue #771: [SCB-679] Support Cross-Origin 
Resource Sharing (CORS)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/771#issuecomment-398829982
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17607132/badge)](https://coveralls.io/builds/17607132)
   
   Coverage increased (+0.02%) to 87.238% when pulling 
**4b67f684d2fc0eec21e7837bbd1d5c9510ad8695 on yhs0092:support_cors** into 
**861e198e6880deafe1092097ae1f935f7c1b9de7 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] yhs0092 commented on issue #771: [SCB-679] Support Cross-Origin Resource Sharing (CORS)

2018-06-20 Thread GitBox
yhs0092 commented on issue #771: [SCB-679] Support Cross-Origin Resource 
Sharing (CORS)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/771#issuecomment-398977489
 
 
   Done. Please review.
   - add alias to default executor thread pool, let users can use 
"servicecomb.executor.groupThreadPool" to specify executor thread poll.
   - add warning log to remind users of schema compatibility problem.


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 #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
coveralls edited a comment on issue #210: [SCB-244] enable servicecomb and add 
demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#issuecomment-398707838
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17604855/badge)](https://coveralls.io/builds/17604855)
   
   Coverage decreased (-1.7%) to 93.194% when pulling 
**5a518191608d5e6aa6a3ec82a4e0e1bccc9716be on zhengyangyong:SCB-244** into 
**d24cb61e3e7aec486ab1d6a6cc25c32df8ad9be5 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996244
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaProviderHandler.java
 ##
 @@ -22,27 +22,35 @@
 
 import java.lang.invoke.MethodHandles;
 
+import org.apache.servicecomb.core.Handler;
+import org.apache.servicecomb.core.Invocation;
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
+import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import org.apache.servicecomb.core.Handler;
-import org.apache.servicecomb.core.Invocation;
-import org.apache.servicecomb.swagger.invocation.AsyncResponse;
+import com.google.common.annotations.VisibleForTesting;
 
 public class SagaProviderHandler implements Handler {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  private final OmegaContext omegaContext;
 
-  public SagaProviderHandler(@Autowired(required=false) OmegaContext 
omegaContext) {
-this.omegaContext = omegaContext;
-if (omegaContext == null) {
-  LOG.info("The OmegaContext is not injected, The SagaProviderHander is 
disabled.");
+  private OmegaContext omegaContext;
 
 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996251
 
 

 ##
 File path: saga-demo/saga-servicecomb-demo/pom.xml
 ##
 @@ -0,0 +1,158 @@
+
+
+
+http://maven.apache.org/POM/4.0.0;
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+saga-demo
+org.apache.servicecomb.saga.demo
+0.3.0-SNAPSHOT
+  
+  4.0.0
+
+  saga-servicecomb-demo
+  Saga::Demo::ServiceComb-Demo
+  pom
+
+
+  
+scb-car
+scb-hotel
+scb-booking
+  
+
+  
+UTF-8
+1.8
+1.8
+0.3.0-SNAPSHOT
+1.0.0-m2
 
 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996227
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandler.java
 ##
 @@ -22,30 +22,38 @@
 
 import java.lang.invoke.MethodHandles;
 
+import org.apache.servicecomb.core.Handler;
+import org.apache.servicecomb.core.Invocation;
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
+import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import org.apache.servicecomb.core.Handler;
-import org.apache.servicecomb.core.Invocation;
-import org.apache.servicecomb.swagger.invocation.AsyncResponse;
+import com.google.common.annotations.VisibleForTesting;
 
 public class SagaConsumerHandler implements Handler {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  private final OmegaContext omegaContext;
 
-  public SagaConsumerHandler(@Autowired(required=false) OmegaContext 
omegaContext) {
-this.omegaContext = omegaContext;
-if (omegaContext == null) {
-  LOG.info("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
+  private OmegaContext omegaContext;
+
+  public SagaConsumerHandler() {
+try {
+  omegaContext = BeanUtils.getBean("omegaContext");
+} catch (NullPointerException npe) {
+  LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
 
 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996221
 
 

 ##
 File path: omega/omega-transport/omega-transport-servicecomb/pom.xml
 ##
 @@ -28,6 +28,10 @@
 
   omega-transport-servicecomb
 
+  
+1.0.0-m2
 
 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996232
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandler.java
 ##
 @@ -54,6 +62,8 @@ public void handle(Invocation invocation, AsyncResponse 
asyncResponse) throws Ex
   omegaContext.globalTxId(),
   LOCAL_TX_ID_KEY,
   omegaContext.localTxId());
+} else {
+  LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
 
 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996240
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaProviderHandler.java
 ##
 @@ -54,6 +62,8 @@ public void handle(Invocation invocation, AsyncResponse 
asyncResponse) throws Ex
 omegaContext.setGlobalTxId(globalTxId);
 
omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY));
   }
+} else {
+  LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
 
 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] zhengyangyong commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196996246
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/test/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandlerTest.java
 ##
 @@ -45,11 +45,12 @@
   private final Invocation invocation = mock(Invocation.class);
   private final AsyncResponse asyncResponse = mock(AsyncResponse.class);
 
-  private final SagaConsumerHandler handler = new 
SagaConsumerHandler(omegaContext);
+  private final SagaConsumerHandler handler = new SagaConsumerHandler();
 
 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] yhs0092 commented on issue #771: [SCB-679] Support Cross-Origin Resource Sharing (CORS)

2018-06-20 Thread GitBox
yhs0092 commented on issue #771: [SCB-679] Support Cross-Origin Resource 
Sharing (CORS)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/771#issuecomment-398953789
 
 
   Wait for a sec, I need to add some fix in this pr.


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] wujimin commented on a change in pull request #772: [SCB-194] Spring default scan main class package

2018-06-20 Thread GitBox
wujimin commented on a change in pull request #772: [SCB-194] Spring default 
scan main class package
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/772#discussion_r196992995
 
 

 ##
 File path: 
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/BeanUtils.java
 ##
 @@ -33,10 +42,41 @@ public static void init() {
 init(DEFAULT_BEAN_RESOURCE);
   }
 
+
   public static void init(String... configLocations) {
+prepareServiceCombScanPackage();
+
 context = new ClassPathXmlApplicationContext(configLocations);
   }
 
+  public static void prepareServiceCombScanPackage() {
+Set scanPackags = new LinkedHashSet<>();
+// add exists settings
+String exists = System.getProperty(SCB_SCAN_PACKAGE);
+if (exists != null) {
+  for (String exist : exists.trim().split(",")) {
+if (!exist.isEmpty()) {
+  scanPackags.add(exist.trim());
+}
+  }
+}
+
+// ensure servicecomb package exist
+scanPackags.add(SCB_PACKAGE);
+
+// add main class package
+Class mainClass = JvmUtils.findMainClass();
 
 Review comment:
   yes
   but maybe invoke System.setProperty("scb-scan-package", "a.b.c") before 
BeanUtils.init is enough?


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] WillemJiang commented on a change in pull request #772: [SCB-194] Spring default scan main class package

2018-06-20 Thread GitBox
WillemJiang commented on a change in pull request #772: [SCB-194] Spring 
default scan main class package
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/772#discussion_r196987741
 
 

 ##
 File path: 
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/BeanUtils.java
 ##
 @@ -33,10 +42,41 @@ public static void init() {
 init(DEFAULT_BEAN_RESOURCE);
   }
 
+
   public static void init(String... configLocations) {
+prepareServiceCombScanPackage();
+
 context = new ClassPathXmlApplicationContext(configLocations);
   }
 
+  public static void prepareServiceCombScanPackage() {
+Set scanPackags = new LinkedHashSet<>();
+// add exists settings
+String exists = System.getProperty(SCB_SCAN_PACKAGE);
+if (exists != null) {
+  for (String exist : exists.trim().split(",")) {
+if (!exist.isEmpty()) {
+  scanPackags.add(exist.trim());
+}
+  }
+}
+
+// ensure servicecomb package exist
+scanPackags.add(SCB_PACKAGE);
+
+// add main class package
+Class mainClass = JvmUtils.findMainClass();
 
 Review comment:
   What if the main class is put into "a.b.c.main" and most the components are 
put into "a.b.c"?
   Can we define the scan path like the @SpringBootApplication basePackages 
provides in the Beans.init() 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 #772: [SCB-194] Spring default scan main class package

2018-06-20 Thread GitBox
coveralls commented on issue #772: [SCB-194] Spring default scan main class 
package
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/772#issuecomment-398831061
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17595349/badge)](https://coveralls.io/builds/17595349)
   
   Coverage increased (+0.008%) to 87.222% when pulling 
**ab8890b6b3c37250084181d26e68d9bab3cb7fde on 
wujimin:spring-default-scan-main-class-package** into 
**861e198e6880deafe1092097ae1f935f7c1b9de7 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 commented on issue #771: [SCB-679] Support Cross-Origin Resource Sharing (CORS)

2018-06-20 Thread GitBox
coveralls commented on issue #771: [SCB-679] Support Cross-Origin Resource 
Sharing (CORS)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/771#issuecomment-398829982
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17595202/badge)](https://coveralls.io/builds/17595202)
   
   Coverage increased (+0.04%) to 87.258% when pulling 
**c2cf1788ccdd028e46bd79ab8507ba95b495d4a3 on yhs0092:support_cors** into 
**861e198e6880deafe1092097ae1f935f7c1b9de7 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] wujimin opened a new pull request #772: [SCB-194] Spring default scan main class package

2018-06-20 Thread GitBox
wujimin opened a new pull request #772: [SCB-194] Spring default scan main 
class package
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/772
 
 
   available for oracle and open jdk, and maybe other jdks.


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] yhs0092 opened a new pull request #771: [SCB-679] Support Cross-Origin Resource Sharing (CORS)

2018-06-20 Thread GitBox
yhs0092 opened a new pull request #771: [SCB-679] Support Cross-Origin Resource 
Sharing (CORS)
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/771
 
 
   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).
   
   ---
   See details in [SCB-679](https://issues.apache.org/jira/browse/SCB-679)


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] WillemJiang commented on issue #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
WillemJiang commented on issue #210: [SCB-244] enable servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#issuecomment-398752047
 
 
   As the java-chassis 1.0.0-m2 is not released yet, you may need to use 
1.0.0-m1 to get the CI passed.


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] WillemJiang commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
WillemJiang commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196775681
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaProviderHandler.java
 ##
 @@ -54,6 +62,8 @@ public void handle(Invocation invocation, AsyncResponse 
asyncResponse) throws Ex
 omegaContext.setGlobalTxId(globalTxId);
 
omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY));
   }
+} else {
+  LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
 
 Review comment:
   The warning need to be updated.


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] WillemJiang commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
WillemJiang commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196776960
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/test/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandlerTest.java
 ##
 @@ -45,11 +45,12 @@
   private final Invocation invocation = mock(Invocation.class);
   private final AsyncResponse asyncResponse = mock(AsyncResponse.class);
 
-  private final SagaConsumerHandler handler = new 
SagaConsumerHandler(omegaContext);
+  private final SagaConsumerHandler handler = new SagaConsumerHandler();
 
 Review comment:
   Please keep the old code.


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] WillemJiang commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
WillemJiang commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196776346
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaProviderHandler.java
 ##
 @@ -22,27 +22,35 @@
 
 import java.lang.invoke.MethodHandles;
 
+import org.apache.servicecomb.core.Handler;
+import org.apache.servicecomb.core.Invocation;
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
+import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import org.apache.servicecomb.core.Handler;
-import org.apache.servicecomb.core.Invocation;
-import org.apache.servicecomb.swagger.invocation.AsyncResponse;
+import com.google.common.annotations.VisibleForTesting;
 
 public class SagaProviderHandler implements Handler {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  private final OmegaContext omegaContext;
 
-  public SagaProviderHandler(@Autowired(required=false) OmegaContext 
omegaContext) {
-this.omegaContext = omegaContext;
-if (omegaContext == null) {
-  LOG.info("The OmegaContext is not injected, The SagaProviderHander is 
disabled.");
+  private OmegaContext omegaContext;
 
 Review comment:
   It's better to use the final object to avoid the change from outside.
   We could add a new construction method which set the omegaContext to be null.


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] WillemJiang commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
WillemJiang commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196775234
 
 

 ##
 File path: 
omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandler.java
 ##
 @@ -22,30 +22,38 @@
 
 import java.lang.invoke.MethodHandles;
 
+import org.apache.servicecomb.core.Handler;
+import org.apache.servicecomb.core.Invocation;
+import org.apache.servicecomb.foundation.common.utils.BeanUtils;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
+import org.apache.servicecomb.swagger.invocation.AsyncResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import org.apache.servicecomb.core.Handler;
-import org.apache.servicecomb.core.Invocation;
-import org.apache.servicecomb.swagger.invocation.AsyncResponse;
+import com.google.common.annotations.VisibleForTesting;
 
 public class SagaConsumerHandler implements Handler {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  private final OmegaContext omegaContext;
 
-  public SagaConsumerHandler(@Autowired(required=false) OmegaContext 
omegaContext) {
-this.omegaContext = omegaContext;
-if (omegaContext == null) {
-  LOG.info("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
+  private OmegaContext omegaContext;
+
+  public SagaConsumerHandler() {
+try {
+  omegaContext = BeanUtils.getBean("omegaContext");
+} catch (NullPointerException npe) {
+  LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is 
disabled.");
 
 Review comment:
   The warning message need to updated. 
   SagaConsumerHandler is not disabled, it's just cannot inject transaction ID.


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] WillemJiang commented on a change in pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
WillemJiang commented on a change in pull request #210: [SCB-244] enable 
servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#discussion_r196778778
 
 

 ##
 File path: saga-demo/saga-servicecomb-demo/pom.xml
 ##
 @@ -0,0 +1,158 @@
+
+
+
+http://maven.apache.org/POM/4.0.0;
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+saga-demo
+org.apache.servicecomb.saga.demo
+0.3.0-SNAPSHOT
+  
+  4.0.0
+
+  saga-servicecomb-demo
+  Saga::Demo::ServiceComb-Demo
+  pom
+
+
+  
+scb-car
+scb-hotel
+scb-booking
+  
+
+  
+UTF-8
+1.8
+1.8
+0.3.0-SNAPSHOT
+1.0.0-m2
 
 Review comment:
   we should inherited the version from root pom.xml


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] zhengyangyong commented on issue #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong commented on issue #210: [SCB-244] enable servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#issuecomment-398710208
 
 
   This pr need java chassis 1.0.0-m2


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 #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
coveralls commented on issue #210: [SCB-244] enable servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#issuecomment-398707838
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17588840/badge)](https://coveralls.io/builds/17588840)
   
   Coverage decreased (-0.8%) to 94.161% when pulling 
**be0e7d029a2b98d5a9b902d4b77710cf53acad6e on zhengyangyong:SCB-244** into 
**d24cb61e3e7aec486ab1d6a6cc25c32df8ad9be5 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 commented on issue #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
coveralls commented on issue #210: [SCB-244] enable servicecomb and add demo
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/210#issuecomment-398707836
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17588840/badge)](https://coveralls.io/builds/17588840)
   
   Coverage decreased (-0.8%) to 94.161% when pulling 
**be0e7d029a2b98d5a9b902d4b77710cf53acad6e on zhengyangyong:SCB-244** into 
**d24cb61e3e7aec486ab1d6a6cc25c32df8ad9be5 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] zhengyangyong opened a new pull request #210: [SCB-244] enable servicecomb and add demo

2018-06-20 Thread GitBox
zhengyangyong opened a new pull request #210: [SCB-244] enable servicecomb and 
add demo
URL: https://github.com/apache/incubator-servicecomb-saga/pull/210
 
 
   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


[incubator-servicecomb-java-chassis] branch master updated: [SCB-506]服务治理相关的事件需要上报 (#678)

2018-06-20 Thread liubao
This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
 new 861e198  [SCB-506]服务治理相关的事件需要上报 (#678)
861e198 is described below

commit 861e198e6880deafe1092097ae1f935f7c1b9de7
Author: xuyiyun0929 <32084552+xuyiyun0...@users.noreply.github.com>
AuthorDate: Wed Jun 20 16:44:38 2018 +0800

[SCB-506]服务治理相关的事件需要上报 (#678)

* [SCB-506]服务治理相关的需要事件上报

* [SCB-506] Use ConcurrentHashMap instead of HashMap

* [SCB-506] Use ConcurrentHashMap instead of HashMap

* [SCB-506] Get CircutBreakerEvent via HystrixEventNotifier

* [SCB-506] Optimize for suggestions

* [SCB-506] Optimize for suggestions

* [SCB-506] Customize HystrixCommandGroupKey to avoid always split string.

* [SCB-506] Customize HystrixCommandGroupKey to avoid always split string.

* [SCB-506] Repair OOM problem and add a OOM test case

* [SCB-506] check getCommandGroup() if instance of CustomizeCommandGroupKey
---
 .../foundation/common/event/AlarmEvent.java|  29 ++
 .../apache/servicecomb/bizkeeper/CommandKey.java   |   4 +-
 .../bizkeeper/CustomizeCommandGroupKey.java|  58 +++
 .../bizkeeper/event/CircutBreakerEvent.java| 113 +
 .../event/CircutBreakerEventNotifier.java  |  61 +++
 .../src/main/resources/hystrix-plugins.properties  |   1 +
 .../bizkeeper/TestBizkeeperCommand.java|   8 --
 .../bizkeeper/TestCustomCommandGroupKey.java   |  44 
 .../event/TestCircutBreakerEventNotifier.java  |  79 ++
 .../loadbalance/event/IsolationServerEvent.java|  87 
 .../filter/IsolationServerListFilter.java  |  23 -
 .../filter/TestIsolationServerListFilter.java  |  72 +++--
 12 files changed, 516 insertions(+), 63 deletions(-)

diff --git 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java
similarity index 52%
copy from 
handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
copy to 
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java
index a4e0aa4..1f100c1 100644
--- 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java
@@ -14,29 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package org.apache.servicecomb.foundation.common.event;
 
-package org.apache.servicecomb.bizkeeper;
+public class AlarmEvent {
 
-import org.apache.servicecomb.core.Invocation;
+  Type type;
 
-import com.netflix.hystrix.HystrixCommandGroupKey;
-import com.netflix.hystrix.HystrixCommandKey;
-
-/**
- * 创建对应的Key值
- *
- */
-public final class CommandKey {
-  private CommandKey() {
+  public AlarmEvent(Type type) {
+this.type = type;
   }
 
-  public static HystrixCommandGroupKey toHystrixCommandGroupKey(String type, 
Invocation invocation) {
-return HystrixCommandGroupKey.Factory
-.asKey(type + "." + 
invocation.getOperationMeta().getMicroserviceQualifiedName());
+  public Type getType() {
+return this.type;
   }
 
-  public static HystrixCommandKey toHystrixCommandKey(String type, Invocation 
invocation) {
-return HystrixCommandKey.Factory
-.asKey(type + "." + 
invocation.getOperationMeta().getMicroserviceQualifiedName());
-  }
+  public enum Type {
+OPEN,
+CLOSE
+  };
 }
diff --git 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
 
b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
index a4e0aa4..22a2cfc 100644
--- 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
+++ 
b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
@@ -31,8 +31,8 @@ public final class CommandKey {
   }
 
   public static HystrixCommandGroupKey toHystrixCommandGroupKey(String type, 
Invocation invocation) {
-return HystrixCommandGroupKey.Factory
-.asKey(type + "." + 
invocation.getOperationMeta().getMicroserviceQualifiedName());
+return CustomizeCommandGroupKey.asKey(type + "." + 
invocation.getOperationMeta().getMicroserviceQualifiedName(),
+invocation);
   }
 
   public static HystrixCommandKey toHystrixCommandKey(String type, Invocation 
invocation) {
diff --git 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java
 

[GitHub] liubao68 closed pull request #678: [SCB-506]服务治理相关的需要事件上报

2018-06-20 Thread GitBox
liubao68 closed pull request #678: [SCB-506]服务治理相关的需要事件上报
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/678
 
 
   

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/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java
new file mode 100644
index 0..1f100c148
--- /dev/null
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/AlarmEvent.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.foundation.common.event;
+
+public class AlarmEvent {
+
+  Type type;
+
+  public AlarmEvent(Type type) {
+this.type = type;
+  }
+
+  public Type getType() {
+return this.type;
+  }
+
+  public enum Type {
+OPEN,
+CLOSE
+  };
+}
diff --git 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
 
b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
index a4e0aa428..22a2cfcdc 100644
--- 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
+++ 
b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CommandKey.java
@@ -31,8 +31,8 @@ private CommandKey() {
   }
 
   public static HystrixCommandGroupKey toHystrixCommandGroupKey(String type, 
Invocation invocation) {
-return HystrixCommandGroupKey.Factory
-.asKey(type + "." + 
invocation.getOperationMeta().getMicroserviceQualifiedName());
+return CustomizeCommandGroupKey.asKey(type + "." + 
invocation.getOperationMeta().getMicroserviceQualifiedName(),
+invocation);
   }
 
   public static HystrixCommandKey toHystrixCommandKey(String type, Invocation 
invocation) {
diff --git 
a/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java
 
b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java
new file mode 100644
index 0..c80e926f1
--- /dev/null
+++ 
b/handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/CustomizeCommandGroupKey.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.bizkeeper;
+
+import org.apache.servicecomb.core.Invocation;
+
+import com.netflix.hystrix.HystrixCommandGroupKey;
+import com.netflix.hystrix.HystrixKey;
+import com.netflix.hystrix.util.InternMap;
+
+/**
+ * 
ͨ��CommandGroupKey��ĿЯ��Invocation���־�̬��Ϣ��CircutBreakerEvent��ȡ��
+ */
+public class CustomizeCommandGroupKey extends HystrixKey.HystrixKeyDefault 
implements HystrixCommandGroupKey {
+
+  private Invocation instance;
+
+  public CustomizeCommandGroupKey(String key) {
+super(key);
+  }
+
+  private static final InternMap intern = 
new InternMap(
+  new InternMap.ValueConstructor() {
+@Override
+public CustomizeCommandGroupKey create(String key) {
+  return new CustomizeCommandGroupKey(key);
+}
+  });
+
+  public static HystrixCommandGroupKey asKey(String key, 

[GitHub] little-cui closed pull request #375: SCB-678 Optimize govern api

2018-06-20 Thread GitBox
little-cui closed pull request #375: SCB-678 Optimize govern api
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/375
 
 
   

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/govern/service.go b/server/govern/service.go
index c96dab01..e0c695f6 100644
--- a/server/govern/service.go
+++ b/server/govern/service.go
@@ -41,6 +41,8 @@ type ServiceDetailOpt struct {
 }
 
 func (governService *GovernService) GetServicesInfo(ctx context.Context, in 
*pb.GetServicesInfoRequest) (*pb.GetServicesInfoResponse, error) {
+   util.SetContext(ctx, serviceUtil.CTX_CACHEONLY, "1")
+
optionMap := make(map[string]struct{}, len(in.Options))
for _, opt := range in.Options {
optionMap[opt] = struct{}{}
@@ -117,6 +119,8 @@ func (governService *GovernService) GetServicesInfo(ctx 
context.Context, in *pb.
 }
 
 func (governService *GovernService) GetServiceDetail(ctx context.Context, in 
*pb.GetServiceRequest) (*pb.GetServiceDetailResponse, error) {
+   util.SetContext(ctx, serviceUtil.CTX_CACHEONLY, "1")
+
domainProject := util.ParseDomainProject(ctx)
options := []string{"tags", "rules", "instances", "schemas", 
"dependencies"}
 
@@ -241,11 +245,9 @@ func getServiceAllVersions(ctx context.Context, serviceKey 
*pb.MicroServiceKey)
 func getSchemaInfoUtil(ctx context.Context, domainProject string, serviceId 
string) ([]*pb.Schema, error) {
key := apt.GenerateServiceSchemaKey(domainProject, serviceId, "")
 
-   opts := append(serviceUtil.FromContext(ctx),
+   resp, err := backend.Store().Schema().Search(ctx,
registry.WithStrKey(key),
registry.WithPrefix())
-
-   resp, err := backend.Store().Schema().Search(ctx, opts...)
if err != nil {
util.Logger().Errorf(err, "Get schema failed")
return make([]*pb.Schema, 0), err


 


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 #375: SCB-678 Optimize govern api

2018-06-20 Thread GitBox
codecov-io commented on issue #375: SCB-678 Optimize govern api
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/375#issuecomment-398668411
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/375?src=pr=h1)
 Report
   > Merging 
[#375](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/375?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/8e614a9f11c98383e44fdd0c72c629b182f50f2f?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/375/graphs/tree.svg?src=pr=GAaF7zrg8R=650=150)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/375?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #375   +/-   ##
   ===
 Coverage   69.94%   69.94%   
   ===
 Files  25   25   
 Lines3746 3746   
   ===
 Hits 2620 2620   
 Misses938  938   
 Partials  188  188
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/375?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/incubator-servicecomb-service-center/pull/375?src=pr=footer).
 Last update 
[8e614a9...a865255](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/375?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


[incubator-servicecomb-service-center] branch master updated: Optimize govern api (#375)

2018-06-20 Thread littlecui
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/incubator-servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
 new 75c5ba2  Optimize govern api (#375)
75c5ba2 is described below

commit 75c5ba2e034ae553ce94319b5633805cb1ea5cce
Author: little-cui 
AuthorDate: Wed Jun 20 16:30:36 2018 +0800

Optimize govern api (#375)
---
 server/govern/service.go | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/server/govern/service.go b/server/govern/service.go
index c96dab0..e0c695f 100644
--- a/server/govern/service.go
+++ b/server/govern/service.go
@@ -41,6 +41,8 @@ type ServiceDetailOpt struct {
 }
 
 func (governService *GovernService) GetServicesInfo(ctx context.Context, in 
*pb.GetServicesInfoRequest) (*pb.GetServicesInfoResponse, error) {
+   util.SetContext(ctx, serviceUtil.CTX_CACHEONLY, "1")
+
optionMap := make(map[string]struct{}, len(in.Options))
for _, opt := range in.Options {
optionMap[opt] = struct{}{}
@@ -117,6 +119,8 @@ func (governService *GovernService) GetServicesInfo(ctx 
context.Context, in *pb.
 }
 
 func (governService *GovernService) GetServiceDetail(ctx context.Context, in 
*pb.GetServiceRequest) (*pb.GetServiceDetailResponse, error) {
+   util.SetContext(ctx, serviceUtil.CTX_CACHEONLY, "1")
+
domainProject := util.ParseDomainProject(ctx)
options := []string{"tags", "rules", "instances", "schemas", 
"dependencies"}
 
@@ -241,11 +245,9 @@ func getServiceAllVersions(ctx context.Context, serviceKey 
*pb.MicroServiceKey)
 func getSchemaInfoUtil(ctx context.Context, domainProject string, serviceId 
string) ([]*pb.Schema, error) {
key := apt.GenerateServiceSchemaKey(domainProject, serviceId, "")
 
-   opts := append(serviceUtil.FromContext(ctx),
+   resp, err := backend.Store().Schema().Search(ctx,
registry.WithStrKey(key),
registry.WithPrefix())
-
-   resp, err := backend.Store().Schema().Search(ctx, opts...)
if err != nil {
util.Logger().Errorf(err, "Get schema failed")
return make([]*pb.Schema, 0), err



[GitHub] coveralls commented on issue #375: SCB-678 Optimize govern api

2018-06-20 Thread GitBox
coveralls commented on issue #375: SCB-678 Optimize govern api
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/375#issuecomment-398668480
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17586964/badge)](https://coveralls.io/builds/17586964)
   
   Coverage increased (+0.06%) to 73.347% when pulling 
**a86525516ecf59af954d207a7ea727a2e9232265 on little-cui:master** into 
**8e614a9f11c98383e44fdd0c72c629b182f50f2f 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] little-cui opened a new pull request #375: Optimize govern api

2018-06-20 Thread GitBox
little-cui opened a new pull request #375: Optimize govern api
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/375
 
 
   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


[incubator-servicecomb-website] 01/02: Merge branch 'master' into asf-site

2018-06-20 Thread ningjiang
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/incubator-servicecomb-website.git

commit bfe839537a016bafb0a1e5e47b50f481e74d7f98
Merge: d4e8552 5f16dc9
Author: Willem Jiang 
AuthorDate: Wed Jun 20 15:41:37 2018 +0800

Merge branch 'master' into asf-site

 _users/cn/service-configurations.md | 8 +---
 _users/service-configurations.md| 8 +---
 2 files changed, 10 insertions(+), 6 deletions(-)



[incubator-servicecomb-website] branch master updated: Fix web page wrong format

2018-06-20 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git


The following commit(s) were added to refs/heads/master by this push:
 new 5f16dc9  Fix web page wrong format
5f16dc9 is described below

commit 5f16dc9a603e4d98c876b29362a14cbe5b1ebb46
Author: MabinGo 
AuthorDate: Wed Jun 20 14:19:43 2018 +0800

Fix web page wrong format

Signed-off-by: MabinGo 
---
 _users/cn/service-configurations.md | 8 +---
 _users/service-configurations.md| 8 +---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/_users/cn/service-configurations.md 
b/_users/cn/service-configurations.md
index d65ca9c..6da4fea 100755
--- a/_users/cn/service-configurations.md
+++ b/_users/cn/service-configurations.md
@@ -88,7 +88,8 @@ servicecomb:
 
   
限流策略配置在microservice.yaml文件中,相关配置项见表2。要开启服务提供者端的限流策略,还需要在处理链中配置服务端限流handler,并添加pom依赖。
 
-* microservice.yaml配置示例如下:
+  microservice.yaml配置示例如下:
+
 ```yaml
 servicecomb:
   handler:
@@ -97,8 +98,9 @@ servicecomb:
 default: qps-flowcontrol-provider
 ```
 
-* 添加handler-flowcontrol-qps的pom依赖:
-```yaml
+  添加handler-flowcontrol-qps的pom依赖:
+
+```xml
 
 org.apache.servicecomb
 handler-flowcontrol-qps
diff --git a/_users/service-configurations.md b/_users/service-configurations.md
index f870e3e..6fb4552 100755
--- a/_users/service-configurations.md
+++ b/_users/service-configurations.md
@@ -87,7 +87,8 @@ Users at the provider end can use the rate limiting policy to 
limit the maximum
 
   Rate limiting policies are configured in the microservice.yaml file. For 
related configuration items, see Table 2. To enable the rate limiting policy at 
the provider end, you also need to configure the rate limiting handler on the 
server in the processing chain and add dependencies in the pom.xml file. 
 
-* An example of microservice.yaml file configuration is as follows,
+  An example of microservice.yaml file configuration is as follows,
+
 ```yaml
 servicecomb:
   handler:
@@ -96,8 +97,9 @@ servicecomb:
 default: qps-flowcontrol-provider
 ```
 
-* Add dependencies of handler-flowcontrol-qps in the pom.xml file,
-```yaml
+  Add dependencies of handler-flowcontrol-qps in the pom.xml file,
+
+```xml
 
 org.apache.servicecomb
 handler-flowcontrol-qps



[GitHub] WillemJiang closed pull request #105: Fix web page wrong format

2018-06-20 Thread GitBox
WillemJiang closed pull request #105: Fix web page wrong format
URL: https://github.com/apache/incubator-servicecomb-website/pull/105
 
 
   

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/_users/cn/service-configurations.md 
b/_users/cn/service-configurations.md
index d65ca9ca..6da4feaa 100755
--- a/_users/cn/service-configurations.md
+++ b/_users/cn/service-configurations.md
@@ -88,7 +88,8 @@ servicecomb:
 
   
限流策略配置在microservice.yaml文件中,相关配置项见表2。要开启服务提供者端的限流策略,还需要在处理链中配置服务端限流handler,并添加pom依赖。
 
-* microservice.yaml配置示例如下:
+  microservice.yaml配置示例如下:
+
 ```yaml
 servicecomb:
   handler:
@@ -97,8 +98,9 @@ servicecomb:
 default: qps-flowcontrol-provider
 ```
 
-* 添加handler-flowcontrol-qps的pom依赖:
-```yaml
+  添加handler-flowcontrol-qps的pom依赖:
+
+```xml
 
 org.apache.servicecomb
 handler-flowcontrol-qps
diff --git a/_users/service-configurations.md b/_users/service-configurations.md
index f870e3e4..6fb45522 100755
--- a/_users/service-configurations.md
+++ b/_users/service-configurations.md
@@ -87,7 +87,8 @@ Users at the provider end can use the rate limiting policy to 
limit the maximum
 
   Rate limiting policies are configured in the microservice.yaml file. For 
related configuration items, see Table 2. To enable the rate limiting policy at 
the provider end, you also need to configure the rate limiting handler on the 
server in the processing chain and add dependencies in the pom.xml file. 
 
-* An example of microservice.yaml file configuration is as follows,
+  An example of microservice.yaml file configuration is as follows,
+
 ```yaml
 servicecomb:
   handler:
@@ -96,8 +97,9 @@ servicecomb:
 default: qps-flowcontrol-provider
 ```
 
-* Add dependencies of handler-flowcontrol-qps in the pom.xml file,
-```yaml
+  Add dependencies of handler-flowcontrol-qps in the pom.xml file,
+
+```xml
 
 org.apache.servicecomb
 handler-flowcontrol-qps


 


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