[GitHub] WillemJiang opened a new pull request #474: [SCB-146] Upgrade Zipkin-brave to 4.13.1

2017-12-29 Thread GitBox
WillemJiang opened a new pull request #474: [SCB-146] Upgrade Zipkin-brave to 
4.13.1
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/474
 
 
   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] WillemJiang closed pull request #20: SCB-142 translate developers pages

2017-12-29 Thread GitBox
WillemJiang closed pull request #20: SCB-142 translate developers pages
URL: https://github.com/apache/incubator-servicecomb-website/pull/20
 
 
   

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/_developers/setup-develop-environment.md 
b/_developers/setup-develop-environment.md
index 70ada48..6e3a330 100644
--- a/_developers/setup-develop-environment.md
+++ b/_developers/setup-develop-environment.md
@@ -1,63 +1,70 @@
 ---
-title: "??"
+title: "Setup Developing Environment"
 lang: en
 ref: setup-develop-environment
 permalink: /developers/setup-develop-environment/
-excerpt: "??"
+excerpt: "setup developing environment"
 last_modified_at: 2017-06-24T18:48:43+08:00
 ---
 
-## ??
-?
-* 
**Git**[Git](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git){:target="_blank"}
-* **JDK 
1.8**[JDK](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html){:target="_blank"}
-* **Maven 
3.x**[Maven](https://maven.apache.org/install.html){:target="_blank"}
-* **Docker**[Docker 
](https://docs.docker.com/engine/installation/){:target="_blank"}
-* **Service Center**, ???[Service 
Center](/users/setup-environment/#??service-center)
-* **IntelliJ Idea 
IDE**(?IDE??eclipse)[IntelliJ](https://www.jetbrains.com/help/idea/installing-and-launching.html){:target="_blank"}
+## Install required tools
+Before you start, make sure you have the following tools installed:
+* **Git**?please refer to [Install 
Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git){:target="_blank"}
+* **JDK 1.8**?please refer to [Install 
JDK](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html){:target="_blank"}
+* **Maven 3.x**?please refer to [Install 
Maven](https://maven.apache.org/install.html){:target="_blank"}
+* **Docker**?please refer to [Install 
Docker](https://docs.docker.com/engine/installation/){:target="_blank"}
+* **Service Center**, please refer to [Install Service 
Center](/users/setup-environment/#??service-center)
+* **IntelliJ Idea IDE**(optional, you can use any IDE you like, e.g. eclipse), 
please refer to[Install 
IntelliJ](https://www.jetbrains.com/help/idea/installing-and-launching.html){:target="_blank"}
 
-## Git??
-1. ??Github???ServiceComb???Github???Github??? 
[https://github.com/join?source=header-home](https://github.com/join?source=header-home)
 ?Github?? 
[https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home](https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home)
 ???
-2. ??Git?Git
+## Setup git
+1. Get a Github account. The ServiceComb projects is hosted on Github, so you 
will need a Github account. You can goto 
[https://github.com/join?source=header-home](https://github.com/join?source=header-home)
 for signup. Skip this if you already own an Github account. You can login on 
[https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home](https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home)
 after you finished the signup.
+
+2. Configure Git. Configure personal information and setup git for push 
without username/password.
+   Configure personal information:
 
```bash
git config --global user.name 
git config --global user.email 
```
 
-   
?\?\?Github???[Git?](https://stackoverflow.com/a/8588786){:target="_blank"}?
-3.  
[ServiceComb-Java-Chassis](https://github.com/apache/incubator-servicecomb-java-chassis.git)
 ???
+   Substitute \?\ with your name and 
email. Refer[Git push without username and 
password](https://stackoverflow.com/a/8588786){:target="_blank"}to setup 
pushing without username/password.
+
+3. Get the source code. For example, to get 
[ServiceComb-Java-Chassis](https://github.com/apache/incubator-servicecomb-java-chassis.git),
 execute the following command:
 
```bash
git clone https://github.com/apache/incubator-servicecomb-java-chassis.git
```
-   
-## IDE 
-Java???IDEEclipse, IntelliJ IDEA?STS??IntelliJ 
IDEA?IntelliJ 
IDEA???[???](https://www.jetbrains.com/help/idea/installing-and-launching.html#d325787e291)?IntelliJ
 
IDEA[?](https://www.jetbrains.com/help/idea/keyboard-shortcuts-you-cannot-miss.html)?
+   
+## Configure IDE
+There are many Java IDEs around, like Eclipse, IntelliJ IDEA and STS, etc. We 
suggest to use IntelliJ IDEA, it's community edition is good enough for daily 
usage. After 

[GitHub] little-cui closed pull request #235: SCB-143 Add new rate limiter

2017-12-29 Thread GitBox
little-cui closed pull request #235: SCB-143 Add new rate limiter
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/235
 
 
   

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/httplimiter/httpratelimiter.go 
b/pkg/httplimiter/httpratelimiter.go
new file mode 100644
index 000..9128d5b
--- /dev/null
+++ b/pkg/httplimiter/httpratelimiter.go
@@ -0,0 +1,228 @@
+/*
+ * 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 httplimiter
+
+import (
+   "net/http"
+   "strconv"
+   "strings"
+   "time"
+   "github.com/apache/incubator-servicecomb-service-center/pkg/ratelimiter"
+   "fmt"
+   "sync"
+)
+
+type HTTPErrorMessage struct {
+   Messagestring
+   StatusCode int
+}
+
+func (httpErrorMessage *HTTPErrorMessage) Error() string {
+   return fmt.Sprintf("%v: %v", httpErrorMessage.StatusCode, 
httpErrorMessage.Message)
+}
+
+
+type HttpLimiter struct {
+   HttpMessagestring
+   ContentTypestring
+   StatusCode int
+   RequestLimit   int64
+   TTLtime.Duration
+   IPLookups  []string
+   Methods[]string
+   Headersmap[string][]string
+   BasicAuthUsers []string
+   leakyBuckets   map[string]*ratelimiter.LeakyBucket
+   sync.RWMutex
+}
+
+
+
+func LimitBySegments(limiter *HttpLimiter, keys []string) *HTTPErrorMessage {
+   if limiter.LimitExceeded(strings.Join(keys, "|")) {
+   return {Message: limiter.HttpMessage, 
StatusCode: limiter.StatusCode}
+   }
+
+   return nil
+}
+
+func LimitByRequest(httpLimiter *HttpLimiter, r *http.Request) 
*HTTPErrorMessage {
+   sliceKeys := BuildSegments(httpLimiter, r)
+
+   for _, keys := range sliceKeys {
+   httpError := LimitBySegments(httpLimiter, keys)
+   if httpError != nil {
+   return httpError
+   }
+   }
+
+   return nil
+}
+
+func BuildSegments(httpLimiter *HttpLimiter, r *http.Request) [][]string {
+   remoteIP := getRemoteIP(httpLimiter.IPLookups, r)
+   urlPath := r.URL.Path
+   sliceKeys := make([][]string, 0)
+
+   if remoteIP == "" {
+   return sliceKeys
+   }
+
+   if httpLimiter.Methods != nil && httpLimiter.Headers != nil && 
httpLimiter.BasicAuthUsers != nil {
+   if checkExistence(httpLimiter.Methods, r.Method) {
+   for headerKey, headerValues := range 
httpLimiter.Headers {
+   if (headerValues == nil || len(headerValues) <= 
0) && r.Header.Get(headerKey) != "" {
+   username, _, ok := r.BasicAuth()
+   if ok && 
checkExistence(httpLimiter.BasicAuthUsers, username) {
+   sliceKeys = append(sliceKeys, 
[]string{remoteIP, urlPath, r.Method, headerKey, username})
+   }
+
+   } else if len(headerValues) > 0 && 
r.Header.Get(headerKey) != "" {
+   for _, headerValue := range 
headerValues {
+   username, _, ok := r.BasicAuth()
+   if ok && 
checkExistence(httpLimiter.BasicAuthUsers, username) {
+   sliceKeys = 
append(sliceKeys, []string{remoteIP, urlPath, r.Method, headerKey, headerValue, 
username})
+   }
+   }
+   }
+   }
+   }
+
+   } else if httpLimiter.Methods != nil && httpLimiter.Headers != nil {
+   if checkExistence(httpLimiter.Methods, r.Method) {
+   for headerKey, headerValues := range 
httpLimiter.Headers {
+   if (headerValues == nil || len(headerValues) <= 
0) && 

[GitHub] yangbor opened a new pull request #20: translate developers pages

2017-12-29 Thread GitBox
yangbor opened a new pull request #20: translate developers pages
URL: https://github.com/apache/incubator-servicecomb-website/pull/20
 
 
   Translated setup develop environment and submit code pages.


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 #93: [WIP]SCB-138 replace thrift with grpc

2017-12-29 Thread GitBox
coveralls commented on issue #93: [WIP]SCB-138 replace thrift with grpc
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/93#issuecomment-354419148
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/14837043/badge)](https://coveralls.io/builds/14837043)
   
   Coverage decreased (-0.4%) to 94.702% when pulling 
**b762e8fe28446217feeab265cef099b9eb24081e on eric-lee-ltk:SCB-138** into 
**82f591682aae43d2a1eb6dbdd2bf3adb745c0bcc 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