[GitHub] [apisix] spacewander commented on a change in pull request #2965: feat: use luasocket instead of curl in etcd.lua

2020-12-24 Thread GitBox


spacewander commented on a change in pull request #2965:
URL: https://github.com/apache/apisix/pull/2965#discussion_r548827770



##
File path: apisix/cli/etcd.lua
##
@@ -179,14 +179,14 @@ function _M.init(env, show_output)
 
 local post_json_auth = dkjson.encode(json_auth)
 local response_body = {}
-local _, err = http.request{url = auth_url, method = "POST",
+local res, err = http.request{url = auth_url, method = "POST",
 source = 
ltn12.source.string(post_json_auth),
 sink = ltn12.sink.table(response_body),
 headers = {["Content-Length"] = 
#post_json_auth}}
 -- In case of failure, request returns nil followed by an error 
message.
 -- Else the first return value is just the number 1

Review comment:
   The first return value isn't the response body?





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io commented on pull request #1118: fix: be consumer e2e test ci failed in pr#999

2020-12-24 Thread GitBox


codecov-io commented on pull request #1118:
URL: https://github.com/apache/apisix-dashboard/pull/1118#issuecomment-751202005


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1118?src=pr&el=h1) 
Report
   > Merging 
[#1118](https://codecov.io/gh/apache/apisix-dashboard/pull/1118?src=pr&el=desc) 
(0c23782) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/e0af89e7df02de137aeac3d4bad53cf2efde41c6?el=desc)
 (e0af89e) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1118/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1118?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1118   +/-   ##
   ===
 Coverage   41.67%   41.67%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  758  758   
 Misses952  952   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1118?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1118?src=pr&el=footer).
 Last update 
[e0af89e...0c23782](https://codecov.io/gh/apache/apisix-dashboard/pull/1118?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] liuxiran opened a new pull request #1118: fix: be consumer e2e test ci failed in pr#999

2020-12-24 Thread GitBox


liuxiran opened a new pull request #1118:
URL: https://github.com/apache/apisix-dashboard/pull/1118


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   #999 be e2e ci failed 
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-helm-chart] spacewander opened a new pull request #10: chore: fix the service name in NOTES.txt

2020-12-24 Thread GitBox


spacewander opened a new pull request #10:
URL: https://github.com/apache/apisix-helm-chart/pull/10


   Fix #9



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix] branch master updated: feat: Implement traffic splitting plugin (#2935)

2020-12-24 Thread spacewander
This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 86fa46d  feat: Implement traffic splitting plugin (#2935)
86fa46d is described below

commit 86fa46d85b91ae2604a69aec531b87c276a9a453
Author: Yuelin Zheng <52862365+firstsaw...@users.noreply.github.com>
AuthorDate: Fri Dec 25 15:53:00 2020 +0800

feat: Implement traffic splitting plugin (#2935)

close #2303
close #2603
---
 README.md  |1 +
 README_CN.md   |1 +
 apisix/init.lua|1 +
 apisix/plugins/traffic-split.lua   |  323 +
 conf/config-default.yaml   |1 +
 doc/README.md  |1 +
 doc/plugins/traffic-split.md   |  453 +
 doc/zh-cn/README.md|1 +
 doc/zh-cn/plugins/traffic-split.md |  464 +
 t/admin/plugins.t  |2 +-
 t/debug/debug-mode.t   |1 +
 t/plugin/traffic-split.t   | 1289 
 12 files changed, 2537 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c6533c6..062d38b 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,7 @@ A/B testing, canary release, blue-green deployment, limit 
rate, defense against
   - [Health Checks](doc/health-check.md): Enable health check on the upstream 
node, and will automatically filter unhealthy nodes during load balancing to 
ensure system stability.
   - Circuit-Breaker: Intelligent tracking of unhealthy upstream services.
   - [Proxy Mirror](doc/plugins/proxy-mirror.md): Provides the ability to 
mirror client requests.
+  - [Traffic Split](doc/plugins/traffic-split.md): Allows users to 
incrementally direct percentages of traffic between various upstreams.
 
 - **Fine-grained routing**
 
diff --git a/README_CN.md b/README_CN.md
index 275dd54..6ca2fec 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -97,6 +97,7 @@ A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵
   - [健康检查](doc/zh-cn/health-check.md):启用上游节点的健康检查,将在负载均衡期间自动过滤不健康的节点,以确保系统稳定性。
   - 熔断器: 智能跟踪不健康上游服务。
   - [代理镜像](doc/zh-cn/plugins/proxy-mirror.md): 提供镜像客户端请求的能力。
+  - [流量拆分](doc/zh-cn/plugins/traffic-split.md): 允许用户逐步控制各个上游之间的流量百分比。
 
 - **精细化路由**
 
diff --git a/apisix/init.lua b/apisix/init.lua
index 38f5f75..1455bd8 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -210,6 +210,7 @@ local function parse_domain(host)
 return nil, "failed to parse domain"
 end
 end
+_M.parse_domain = parse_domain
 
 
 local function parse_domain_for_nodes(nodes)
diff --git a/apisix/plugins/traffic-split.lua b/apisix/plugins/traffic-split.lua
new file mode 100644
index 000..d74b08c
--- /dev/null
+++ b/apisix/plugins/traffic-split.lua
@@ -0,0 +1,323 @@
+--
+-- 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.
+--
+local core   = require("apisix.core")
+local upstream   = require("apisix.upstream")
+local schema_def = require("apisix.schema_def")
+local init   = require("apisix.init")
+local roundrobin = require("resty.roundrobin")
+local ipmatcher  = require("resty.ipmatcher")
+local expr   = require("resty.expr.v1")
+local pairs  = pairs
+local ipairs = ipairs
+local type   = type
+local table_insert = table.insert
+
+local lrucache = core.lrucache.new({
+ttl = 0, count = 512
+})
+
+
+local vars_schema = {
+type = "array",
+items = {
+type = "array",
+items = {
+{
+type = "string",
+minLength = 1,
+maxLength = 100
+},
+{
+type = "string",
+minLength = 1,
+maxLength = 2
+}
+},
+additionalItems = {
+anyOf = {
+{type = "string"},
+{type = "number"},
+{type = "boolean"},
+{
+type = "array",
+items = {
+anyOf = {
+{
+type = "string",
+

[GitHub] [apisix] spacewander merged pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


spacewander merged pull request #2935:
URL: https://github.com/apache/apisix/pull/2935


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander closed issue #2603: request help: dynamic-upstream 插件如何与1.5版本的apisix融合及2.0版本融合,后期考虑将这个插件直接集成到apisix中吗

2020-12-24 Thread GitBox


spacewander closed issue #2603:
URL: https://github.com/apache/apisix/issues/2603


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander closed issue #2303: Proposal: inptroduce traffic split plugin

2020-12-24 Thread GitBox


spacewander closed issue #2303:
URL: https://github.com/apache/apisix/issues/2303


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-helm-chart] moonming opened a new issue #9: request help: helm charts for Apache APISIX

2020-12-24 Thread GitBox


moonming opened a new issue #9:
URL: https://github.com/apache/apisix-helm-chart/issues/9


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-helm-chart] Miss-you opened a new issue #8: BUG:install fail ‘pod has unbound immediate PersistentVolumeClaims’ on Qcloud/TencentCloud TKE

2020-12-24 Thread GitBox


Miss-you opened a new issue #8:
URL: https://github.com/apache/apisix-helm-chart/issues/8


   env:TKE
   command:helm install apisix ./chart/apisix -n default
   
   
   
![image](https://user-images.githubusercontent.com/3816205/103125563-737d6a00-46c6-11eb-8ff4-b27fb4df6f68.png)
   
   
   
![image](https://user-images.githubusercontent.com/3816205/103125529-5183e780-46c6-11eb-9d00-250fc2f7f385.png)
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1057: feat: support global rules for Manager API

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1057:
URL: https://github.com/apache/apisix-dashboard/pull/1057#issuecomment-747873491


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=h1) 
Report
   > Merging 
[#1057](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=desc) 
(f4207a3) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/0e6e2805362a8dc9b83f56f53be17f12a8ddbacf?el=desc)
 (0e6e280) will **increase** coverage by `0.03%`.
   > The diff coverage is `47.14%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1057/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master#1057  +/-   ##
   ==
   + Coverage   41.94%   41.97%   +0.03% 
   ==
 Files  29   30   +1 
 Lines1824 1887  +63 
   ==
   + Hits  765  792  +27 
   - Misses951  986  +35 
   - Partials  108  109   +1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1057/diff?src=pr&el=tree#diff-YXBpL2ZpbHRlci9zY2hlbWEuZ28=)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1057/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1057/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <0.00%> (ø)` | |
   | 
[api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1057/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=)
 | `62.26% <62.26%> (ø)` | |
   | 
[api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1057/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=)
 | `63.04% <0.00%> (-5.59%)` | :arrow_down: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=footer).
 Last update 
[0e6e280...f4207a3](https://codecov.io/gh/apache/apisix-dashboard/pull/1057?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-ingress-controller] moonming merged pull request #129: doc: update develop.md

2020-12-24 Thread GitBox


moonming merged pull request #129:
URL: https://github.com/apache/apisix-ingress-controller/pull/129


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch master updated: doc: update develop.md (#129)

2020-12-24 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
 new e58e6d6  doc: update develop.md (#129)
e58e6d6 is described below

commit e58e6d6b518b24fa168dc8e9c04c1cf7997a41e1
Author: Alex Zhang 
AuthorDate: Fri Dec 25 15:17:12 2020 +0800

doc: update develop.md (#129)

* doc: update develop.md

* fix: add httpbin deployment/service yaml in docs/develop.md
---
 docs/develop.md | 58 +++--
 1 file changed, 52 insertions(+), 6 deletions(-)

diff --git a/docs/develop.md b/docs/develop.md
index 3a63ab6..d2502a5 100644
--- a/docs/develop.md
+++ b/docs/develop.md
@@ -37,15 +37,59 @@ Tips: The Kubernetes cluster deployment method is 
recommended for production and
 
 [Install Apache APISIX in 
Kubernetes](https://github.com/apache/apisix/tree/master/kubernetes)
 
+### 3. httpbin service
+
+Deploy [httpbin](https://github.com/postmanlabs/httpbin) to your Kubernetes 
cluster and expose it as a Service. For instance:
+
+```yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: httpbin
+spec:
+  replicas: 1
+  selector:
+matchLabels:
+  app: httpbin
+  template:
+metadata:
+  labels:
+app: httpbin
+spec:
+  terminationGracePeriodSeconds: 0
+  containers:
+  - name: httpbin
+image: "kennethreitz/httpbin"
+imagePullPolicy: IfNotPresent
+ports:
+- containerPort: 80
+  name: "http"
+  protocol: "TCP"
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: httpbin
+spec:
+  selector:
+app: httpbin
+  ports:
+- name: http
+  port: 8080
+  protocol: TCP
+  targetPort: 80
+  type: ClusterIP
+```
+
 ## Configuration
 
-### Configure the `kube config` file locally to facilitate local debugging
+### Configure the kubeconfig file locally to facilitate local debugging
 
 1. Start minikube.
 
 2. Location: ~/.kube/config
 
-3. Copy the config file to your local development environment, the path should 
be configured in apisix-ingress-controller by specifying `--kuebconfig` option.
+3. Copy the config file to your local development environment, the path should 
be configured in apisix-ingress-controller by specifying `--kubeconfig` option.
 
 ### Configure APISIX service address
 
@@ -68,7 +112,7 @@ Tips: The program may print some error logs, indicating that 
the resource cannot
 
 ### Define ApisixRoute
 
-Take the back-end service `httpserver` as an example (you can choose any 
upstream service for test).
+Take the backend service `httpbin` as an example (you can choose any other 
upstream services for test).
 
 In fact, in order to reduce the trouble caused by ingress migration, we try to 
keep the structure of ApisixRoute consistent with the original ingress.
 
@@ -89,12 +133,14 @@ spec:
 http:
   paths:
   - backend:
-  serviceName: httpserver
+  serviceName: httpbin.default.svc.cluster.local
   servicePort: 8080
 path: /hello*
 EOF
 ```
 
+Here we use the FQDN `httpbin.default.svc.cluster.local` as the `serviceName`, 
and the service port is 8080, change them if your `httpbin` service has a 
different name, namespace or port.
+
 In addition, `ApisixRoute` also continues to support the definition with 
annotation, you can also define as below.
 
 ```yaml
@@ -115,7 +161,7 @@ spec:
 http:
   paths:
   - backend:
-  serviceName: httpserver
+  serviceName: httpbin.default.svc.cluster.local
   servicePort: 8080
 path: /hello*
 plugins:
@@ -165,7 +211,7 @@ kubectl apply -f - <

[GitHub] [apisix-ingress-controller] moonming merged pull request #128: chore: integrated api7/seven

2020-12-24 Thread GitBox


moonming merged pull request #128:
URL: https://github.com/apache/apisix-ingress-controller/pull/128


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch master updated: chore: integrated api7/seven (#128)

2020-12-24 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
 new cf99f1f  chore: integrated api7/seven (#128)
cf99f1f is described below

commit cf99f1f57a4072fc743ce361053171ba9ad95c67
Author: Alex Zhang 
AuthorDate: Fri Dec 25 15:16:37 2020 +0800

chore: integrated api7/seven (#128)

This commit integrated github.com/api7/seven module, previously the
release it not so convenient.

What's more, we have the follow changes:

* Apache License V2 header is added in each of file;
* Apply gofmt;
* Change the reference from github.com/api7/seven to 
github.com/api7/ingress-controller/pkg/seven
---
 cmd/ingress/ingress.go |   2 +-
 cmd/ingress/ingress_test.go|   2 +-
 go.mod |  11 +-
 go.sum |   2 -
 pkg/ingress/apisix/annotation.go   |   6 +-
 pkg/ingress/apisix/plugin.go   |   3 +-
 pkg/ingress/apisix/route.go|   8 +-
 pkg/ingress/apisix/service.go  |   8 +-
 pkg/ingress/apisix/tls.go  |   5 +-
 pkg/ingress/apisix/upstream.go |   8 +-
 pkg/ingress/controller/apisix_route.go |   4 +-
 pkg/ingress/controller/apisix_service.go   |   2 +-
 pkg/ingress/controller/apisix_tls.go   |   7 +-
 pkg/ingress/controller/apisix_upstream.go  |   2 +-
 pkg/ingress/controller/endpoint.go |   6 +-
 pkg/ingress/controller/watch.go|  10 +-
 .../apisix/plugin.go => seven/apisix/client.go}|  49 ++--
 pkg/seven/apisix/error.go  |  22 ++
 pkg/seven/apisix/event.go  |  23 ++
 pkg/seven/apisix/plugins.go| 115 +
 pkg/seven/apisix/route.go  | 246 +++
 pkg/seven/apisix/route_test.go | 104 
 pkg/seven/apisix/service.go| 215 
 pkg/seven/apisix/service_test.go   |  80 ++
 pkg/seven/apisix/ssl.go| 139 +++
 pkg/seven/apisix/ssl_test.go   |  80 ++
 pkg/seven/apisix/upstream.go   | 269 +
 pkg/seven/apisix/upstream_test.go  |  84 +++
 pkg/seven/conf/conf.go |  36 +++
 pkg/seven/conf/conf_test.go|  24 ++
 pkg/seven/db/route.go  | 110 +
 pkg/seven/db/service.go|  97 
 pkg/seven/db/store.go  |  43 
 pkg/seven/db/upstream.go   | 103 
 pkg/seven/state/builder.go | 244 +++
 .../plugin.go => seven/state/builder_test.go}  |  52 ++--
 pkg/seven/state/diff.go|  15 ++
 .../apisix/plugin.go => seven/state/event.go}  |  48 ++--
 pkg/seven/state/route_worker.go|  61 +
 pkg/seven/state/service_worker.go  | 195 +++
 pkg/seven/state/solver.go  | 129 ++
 pkg/seven/state/sync.go|  15 ++
 pkg/seven/state/upstream_worker.go |  23 ++
 .../apisix/plugin.go => seven/utils/diff.go}   |  61 ++---
 pkg/seven/utils/http.go|  88 +++
 pkg/seven/utils/types.go   |  15 ++
 46 files changed, 2731 insertions(+), 140 deletions(-)

diff --git a/cmd/ingress/ingress.go b/cmd/ingress/ingress.go
index 5cae8a5..fb41553 100644
--- a/cmd/ingress/ingress.go
+++ b/cmd/ingress/ingress.go
@@ -24,7 +24,6 @@ import (
"time"
 
api6Informers 
"github.com/gxthrj/apisix-ingress-types/pkg/client/informers/externalversions"
-   "github.com/gxthrj/seven/conf"
"github.com/spf13/cobra"
 
"github.com/api7/ingress-controller/pkg/api"
@@ -32,6 +31,7 @@ import (
"github.com/api7/ingress-controller/pkg/ingress/controller"
"github.com/api7/ingress-controller/pkg/kube"
"github.com/api7/ingress-controller/pkg/log"
+   "github.com/api7/ingress-controller/pkg/seven/conf"
 )
 
 func dief(template string, args ...interface{}) {
diff --git a/cmd/ingress/ingress_test.go b/cmd/ingress/ingress_test.go
index 144f753..108fee1 100644
--- a/cmd/ingress/ingress_test.go
+++ b/cmd/ingress/ingress_test.go
@@ -25,11 +25,11 @@ import (
"testing"
"time"
 
-   "github.com/gxthrj/seven/conf"
"github.com/stretchr/testify/assert"
 
"github.com/api7/ingress-controller/pkg/config"
"github

[GitHub] [apisix] spacewander commented on issue #2637: feat(CLI): support to specify proxy timeout in config.yaml

2020-12-24 Thread GitBox


spacewander commented on issue #2637:
URL: https://github.com/apache/apisix/issues/2637#issuecomment-751194479


   Now we set the timeout dynamically via 
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/balancer.md#set_timeouts,
 see https://github.com/apache/apisix/blob/master/doc/admin-api.md#upstream
   ```
   "timeout": {# Set the timeout for connection, sending and 
receiving messages.
   "connect":15,
   "send":15,
   "read":15,
   },
   ```



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander closed issue #2637: feat(CLI): support to specify proxy timeout in config.yaml

2020-12-24 Thread GitBox


spacewander closed issue #2637:
URL: https://github.com/apache/apisix/issues/2637


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] moonming merged pull request #122: chore: hone e2e test scaffold and run cases in CI

2020-12-24 Thread GitBox


moonming merged pull request #122:
URL: https://github.com/apache/apisix-ingress-controller/pull/122


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch master updated: chore: hone e2e test scaffold and run cases in CI (#122)

2020-12-24 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
 new d339fe5  chore: hone e2e test scaffold and run cases in CI (#122)
d339fe5 is described below

commit d339fe5fc02f6457e64de7fa0fd289b431e4fa5a
Author: Alex Zhang 
AuthorDate: Fri Dec 25 15:14:32 2020 +0800

chore: hone e2e test scaffold and run cases in CI (#122)
---
 .github/workflows/e2e-test-ci.yml   |  38 
 .github/workflows/lint-checker.yml  |   1 -
 .github/workflows/unit-test-ci.yml  |   1 -
 .gitignore  |   1 +
 Makefile|  14 +++
 test/e2e/e2e.go |  69 +++
 test/e2e/{main_test.go => e2e_test.go}  |   3 +-
 test/e2e/go.mod |   2 +
 test/e2e/ingress/sanity.go  |  62 +
 test/e2e/main.go|  21 -
 test/e2e/proxy/sanity.go|  28 --
 test/e2e/scaffold/apisix.go |  69 +--
 test/e2e/scaffold/crd.go| 150 
 test/e2e/scaffold/etcd.go   |  38 +++-
 test/e2e/scaffold/ingress.go|  39 -
 test/e2e/scaffold/scaffold.go   |  69 ---
 test/e2e/testdata/apisix-gw-config.yaml |   3 +-
 17 files changed, 530 insertions(+), 78 deletions(-)

diff --git a/.github/workflows/e2e-test-ci.yml 
b/.github/workflows/e2e-test-ci.yml
new file mode 100644
index 000..ff4f400
--- /dev/null
+++ b/.github/workflows/e2e-test-ci.yml
@@ -0,0 +1,38 @@
+name: e2e-test-ci
+
+on:
+  push:
+branches:
+  - master
+  pull_request:
+branches:
+  - master
+  - test/e2e-sanity-case
+jobs:
+  e2e-test:
+runs-on: ubuntu-latest
+steps:
+  - uses: actions/checkout@v2
+  - name: Install minikube
+uses: abstractj/setup-minikube@issue-12
+  - name: Output cluster info
+run: kubectl cluster-info
+  - name: Add images
+run: |
+  IMAGE_TAG=dev make build-image
+  minikube cache add apache/apisix:latest -v 7 --alsologtostderr
+  minikube cache add bitnami/etcd:3.4.14-debian-10-r0 -v 7 
--alsologtostderr
+  minikube cache add kennethreitz/httpbin -v 7 --alsologtostderr
+  minikube cache add apisix-ingress-controller:dev -v 7 
--alsologtostderr
+  - name: Setup Go Env
+uses: actions/setup-go@v1
+with:
+  go-version: '1.13'
+  - name: Run e2e test cases
+working-directory: ./
+run: |
+  make e2e-test
+  - name: upload coverage profile
+working-directory: ./test/e2e
+run: |
+  bash <(curl -s https://codecov.io/bash)
diff --git a/.github/workflows/lint-checker.yml 
b/.github/workflows/lint-checker.yml
index 31d65ab..c1f59d8 100644
--- a/.github/workflows/lint-checker.yml
+++ b/.github/workflows/lint-checker.yml
@@ -4,7 +4,6 @@ on:
   push:
 branches:
   - master
-  - chore/gofmt
   pull_request:
 branches:
   - master
diff --git a/.github/workflows/unit-test-ci.yml 
b/.github/workflows/unit-test-ci.yml
index 527ed96..62d03f5 100644
--- a/.github/workflows/unit-test-ci.yml
+++ b/.github/workflows/unit-test-ci.yml
@@ -4,7 +4,6 @@ on:
   push:
 branches:
   - master
-  - ci/go-unit-test-coverage-report
   pull_request:
 branches:
   - master
diff --git a/.gitignore b/.gitignore
index 0fdeedf..384d362 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,5 +14,6 @@
 .idea
 .DS_Store
 coverage.txt
+test/e2e/coverage.txt
 apisix-ingress-controller
 .actions/openwhisk-utilities
diff --git a/Makefile b/Makefile
index b1d54e1..2a7b3fc 100644
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,11 @@
 default: help
 
 VERSION ?= 0.0.0
+IMAGE_TAG ?= "latest"
 GITSHA ?= $(shell git rev-parse --short=7 HEAD)
 OSNAME ?= $(shell uname -s | tr A-Z a-z)
 OSARCH ?= $(shell uname -m | tr A-Z a-z)
+PWD ?= $(shell pwd)
 ifeq ($(OSARCH), x86_64)
OSARCH = amd64
 endif
@@ -36,6 +38,10 @@ build:
-ldflags $(GO_LDFLAGS) \
main.go
 
+### build-image:  Build apisix-ingress-controller image
+build-image:
+   docker build -t apisix-ingress-controller:$(IMAGE_TAG) .
+
 ### lint: Do static lint check
 lint:
golangci-lint run
@@ -48,6 +54,14 @@ gofmt:
 unit-test:
go test -cover -coverprofile=coverage.txt ./...
 
+### e2e-test: Run e2e test cases
+e2e-test:
+   export 
APISIX_ROUTE_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixRoute.yaml && \
+   export 
APISIX_UPSTREAM_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixUpstream.yaml && \
+   export 
APISIX_SERVICE_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixService.yaml && \
+   export APISIX_TLS_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixTls.y

[GitHub] [apisix] gewei2000 commented on issue #3126: request help: do we support pinpoint?

2020-12-24 Thread GitBox


gewei2000 commented on issue #3126:
URL: https://github.com/apache/apisix/issues/3126#issuecomment-751192237


   > We don't support pinpoint. It seems there is not an official / widely-used 
pinpoint client for OpenResty. Anyway, PR is welcome!
   
   3Q



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] gewei2000 closed issue #3126: request help: do we support pinpoint?

2020-12-24 Thread GitBox


gewei2000 closed issue #3126:
URL: https://github.com/apache/apisix/issues/3126


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] tokers opened a new issue #133: Refactor: Optimize process of resources push to APISIX

2020-12-24 Thread GitBox


tokers opened a new issue #133:
URL: https://github.com/apache/apisix-ingress-controller/issues/133


   When `ApisixRoute`, `ApisixUpstream` and other CRDs are watched by ingress 
controller, it converts these objects to the format of APISIX Resources, like 
Route, Upstream and etc.
   
   Currently, one rule in `ApisixRoute` object may generate a Route, Service, 
Upstream object; an `APISIXService` may generate  
   a Service and Upstream object; an `ApisixUpstream` will generate an Upstream 
object. What's more, the order to push them (to  APISIX) is important, we must 
push Upstream before Service, push Service before Route.
   
   Some drawbacks in current implementation:
   
   * the Service object generated by `ApisixRoute` is useless since all 
configurations in it are also in the Route, we can remove it;
   * also, logics for Route, Service, Upstream are highly duplicated, so we can 
abstract them to reduce the code complexity;
   * Resource cascading update are implemented in several different places with 
the channel to communicate and keep the order, which is complex, we can 
simplify it by writing sequential codes.
   
   Operations for resources like Route, Service, Upstream and others can be 
abstracted as a `ResourceOperator` interface.
   
   ```go
   // pseudo code
   // ResourceOperator abstracts all necessary operations for operating an 
APISIX resource like Route, Upstream.
   type ResourceOperator interface {
   Get() ([]interface{}, error)
   Add(obj interface{}) error
   Update(obj interface{}) error
   Delete(id string) error
   DiffFrom(t interface{}) (bool, error)
   ...
   }
   
   func NewRouteOperator() ResourceOperator {}
   func NewServiceOperator() ResourceOperator {}
   func NewUpstreamOperator() ResourceOperator {}
   ```
   
   For each resource change, we have a struct `ResourceChange`
   
   ```go
   type ResourceChange struct {
   operator ResourceOperator
   changeReason string // for logging
   }
   
   func ApplyResourceChange(rc *ResourceChange) error {}
   ```
   
   On a higher land, we can orchestrate the resource change to `ResourcesChange`
   
   ```go
   type ResourcesChange [][]ResourceChange
   func (rsc *ResourceChange) Apply() error {}
   ```
   
   We put Upstream in ResourcesChange[0] which means it has the first priority 
to apply, ResourcesChange[1] for Service and so on.
   
   Note the whole apply process can not be atomic, we relay on the user to 
delete the broken CRD object if the apply process is aborted.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on a change in pull request #2886: feat: provide the ability to view plug-in types

2020-12-24 Thread GitBox


spacewander commented on a change in pull request #2886:
URL: https://github.com/apache/apisix/pull/2886#discussion_r548819011



##
File path: apisix/admin/plugins.lua
##
@@ -37,7 +37,42 @@ function _M.stream_check_schema(plugins_conf, schema_type)
 end
 
 
+local function get_plugins_all_attributes()
+local plugins = core.config.local_conf().plugins
+local all_attributes = core.table.new(#plugins, 0)
+for _, name in ipairs(plugins) do
+local plugin_name = "apisix.plugins." .. name
+local ok, plugin = pcall(require, plugin_name)

Review comment:
   It is different thing. #3092 is in control API.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on a change in pull request #2886: feat: provide the ability to view plug-in types

2020-12-24 Thread GitBox


tzssangglass commented on a change in pull request #2886:
URL: https://github.com/apache/apisix/pull/2886#discussion_r548818437



##
File path: apisix/admin/plugins.lua
##
@@ -37,7 +37,42 @@ function _M.stream_check_schema(plugins_conf, schema_type)
 end
 
 
+local function get_plugins_all_attributes()
+local plugins = core.config.local_conf().plugins
+local all_attributes = core.table.new(#plugins, 0)
+for _, name in ipairs(plugins) do
+local plugin_name = "apisix.plugins." .. name
+local ok, plugin = pcall(require, plugin_name)

Review comment:
   Is this pr still necessary?  I see 
https://github.com/apache/apisix/pull/3092 already contains the functions 
provided by this pr.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1104: test: add frontend e2e test (smoke test for metrics page)

2020-12-24 Thread GitBox


juzhiyuan commented on a change in pull request #1104:
URL: https://github.com/apache/apisix-dashboard/pull/1104#discussion_r548817956



##
File path: web/cypress/integration/metrics/metrics-smoketest.spec.js
##
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('metrics page smoke test', () => {
+  const domSelectors = {
+pageContent: '.ant-pro-page-container'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('visit metrics page', () => {

Review comment:
   ```suggestion
 it('should visit metrics page', () => {
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander closed issue #3060: bug: kafka logger plugin - failed to process entries: failed to send data to Kafka topic: not found topic

2020-12-24 Thread GitBox


spacewander closed issue #3060:
URL: https://github.com/apache/apisix/issues/3060


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1104: test: add frontend e2e test (smoke test for metrics page)

2020-12-24 Thread GitBox


juzhiyuan commented on a change in pull request #1104:
URL: https://github.com/apache/apisix-dashboard/pull/1104#discussion_r548817837



##
File path: web/cypress/integration/metrics/metrics-smoketest.spec.js
##
@@ -16,7 +16,7 @@
  */
 /* eslint-disable no-undef */
 
-context('ssl smoke test', () => {
+context('metrics page smoke test', () => {

Review comment:
   ```suggestion
   context('smoke test for Metrics module', () => {
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] liuxiran commented on pull request #999: feat: add route group

2020-12-24 Thread GitBox


liuxiran commented on pull request #999:
URL: https://github.com/apache/apisix-dashboard/pull/999#issuecomment-751190127


   > e2e failed, @idbeta @nic-chen
   
   
https://github.com/apache/apisix-dashboard/blob/e0af89e7df02de137aeac3d4bad53cf2efde41c6/api/test/e2e/consumer_test.go#L191
   
   need a  `sleep` after this line



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1066: test: add frontend e2e test (create_and_delete_upstream)

2020-12-24 Thread GitBox


juzhiyuan commented on pull request #1066:
URL: https://github.com/apache/apisix-dashboard/pull/1066#issuecomment-751190129


   After those PRs were merged, we need to:
   - [ ] Use a global file to contain global variables;
   - [ ] We should use `it should xxx` instead of `it creates xxx`;



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan merged pull request #1089: feat(FE): add service module

2020-12-24 Thread GitBox


juzhiyuan merged pull request #1089:
URL: https://github.com/apache/apisix-dashboard/pull/1089


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan closed issue #471: Support Service

2020-12-24 Thread GitBox


juzhiyuan closed issue #471:
URL: https://github.com/apache/apisix-dashboard/issues/471


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-dashboard] branch master updated (b3819c5 -> e0af89e)

2020-12-24 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


from b3819c5  chore: introduce corba as the cli scafford (#773)
 add e0af89e  feat(FE): add service module (#1089)

No new revisions were added by this update.

Summary of changes:
 web/config/routes.ts   |  12 ++
 .../route/create-and-delete-route.spec.js  |   2 +-
 web/src/components/Plugin/typing.d.ts  |   2 +-
 web/src/components/Upstream/UpstreamForm.tsx   |  28 ++--
 web/src/helpers.tsx|   5 +
 web/src/locales/en-US/menu.ts  |   1 +
 web/src/locales/zh-CN/menu.ts  |   1 +
 .../Route/components/Step1/RequestConfigView.tsx   |  25 +++-
 web/src/pages/Route/locales/en-US.ts   |   1 +
 web/src/pages/Route/locales/zh-CN.ts   |   1 +
 web/src/pages/Route/service.ts |   8 +-
 web/src/pages/Route/transform.ts   |   8 +-
 web/src/pages/Route/typing.d.ts|   2 +
 web/src/pages/Service/Create.tsx   | 143 +
 web/src/pages/Service/List.tsx | 103 +++
 .../{Consumer => Service}/components/Preview.tsx   |   7 +-
 .../components/Step1.tsx}  |  42 +-
 .../pages/{Metrics => Service}/locales/en-US.ts|   7 +-
 .../pages/Service/locales/zh-CN.ts}|  12 +-
 web/src/pages/{Upstream => Service}/service.ts |  25 ++--
 web/src/pages/{User => Service}/typing.d.ts|  47 ---
 21 files changed, 414 insertions(+), 68 deletions(-)
 create mode 100644 web/src/pages/Service/Create.tsx
 create mode 100644 web/src/pages/Service/List.tsx
 copy web/src/pages/{Consumer => Service}/components/Preview.tsx (85%)
 copy web/src/pages/{Route/components/Step2/RequestRewriteView.tsx => 
Service/components/Step1.tsx} (61%)
 copy web/src/pages/{Metrics => Service}/locales/en-US.ts (80%)
 copy web/{mock/notices.ts => src/pages/Service/locales/zh-CN.ts} (81%)
 copy web/src/pages/{Upstream => Service}/service.ts (68%)
 copy web/src/pages/{User => Service}/typing.d.ts (55%)



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #999: feat: add route group

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #999:
URL: https://github.com/apache/apisix-dashboard/pull/999#issuecomment-742169695


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=h1) 
Report
   > Merging 
[#999](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=desc) 
(97af52f) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/b3819c5ae939c9c0b0e55958718c9292eb89?el=desc)
 (b3819c5) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/999/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #999   +/-   ##
   ===
 Coverage   41.72%   41.72%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  759  759   
 Misses951  951   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=footer).
 Last update 
[b3819c5...97af52f](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1066: test: add frontend e2e test (create_and_delete_upstream)

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1066:
URL: https://github.com/apache/apisix-dashboard/pull/1066#issuecomment-747915461


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1066?src=pr&el=h1) 
Report
   > Merging 
[#1066](https://codecov.io/gh/apache/apisix-dashboard/pull/1066?src=pr&el=desc) 
(31c4bdf) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/b3819c5ae939c9c0b0e55958718c9292eb89?el=desc)
 (b3819c5) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1066/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1066?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1066   +/-   ##
   ===
 Coverage   41.72%   41.72%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  759  759   
 Misses951  951   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1066?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1066?src=pr&el=footer).
 Last update 
[b3819c5...31c4bdf](https://codecov.io/gh/apache/apisix-dashboard/pull/1066?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1066: test: add frontend e2e test (create_and_delete_upstream)

2020-12-24 Thread GitBox


juzhiyuan commented on a change in pull request #1066:
URL: https://github.com/apache/apisix-dashboard/pull/1066#discussion_r548815779



##
File path: web/cypress/integration/upstream/create_and_delete_upstream.spec.js
##
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Upstream', () => {
+  const name = `upstreamName${new Date().valueOf()}`;
+  const sleepTime = 100; // the unit is milliseconds
+  const domSelectors = {
+notification: '.ant-notification-notice-message'

Review comment:
   Why not use a global file to contain those selector mappers?

##
File path: web/cypress/integration/upstream/create_and_delete_upstream.spec.js
##
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Upstream', () => {
+  const name = `upstreamName${new Date().valueOf()}`;
+  const sleepTime = 100; // the unit is milliseconds
+  const domSelectors = {
+notification: '.ant-notification-notice-message'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('create upstream with default type (roundrobin)', () => {
+// go to upstream create page
+cy.visit('/');
+cy.contains('Upstream').click();
+cy.wait(sleepTime * 5);
+cy.contains('Create').click();
+
+// input name and description
+cy.get('#name').type(name);
+cy.get('#desc').type('desc_by_autotest');
+
+// input information
+cy.get('#nodes_0_host').type('127.0.0.1');
+cy.get('#nodes_0_port').clear().type('7000');
+cy.contains('Next').click();
+cy.contains('Submit').click();
+cy.get(domSelectors.notification).should('contain', 'Create upstream 
successfully');

Review comment:
   we could use a global file to contain those public text.

##
File path: web/cypress/integration/upstream/create_and_delete_upstream.spec.js
##
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('Create and Delete Upstream', () => {
+  const name = `upstreamName${new Date().valueOf()}`;
+  const sleepTime = 100; // the unit is milliseconds
+  const domSelectors = {
+notification: '.ant-notification-notice-message'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('create upstream with default type (roundrobin)', () => {
+// go to upstream create page
+cy.visit('/');
+cy.contains('Upstream').click();
+cy.wait(sleepTime * 5);
+cy.contains('Create').click();
+
+// input name and description
+cy.get('#name').type(name);
+   

[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1089: feat(FE): add service module

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1089:
URL: https://github.com/apache/apisix-dashboard/pull/1089#issuecomment-748893636


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1089?src=pr&el=h1) 
Report
   > Merging 
[#1089](https://codecov.io/gh/apache/apisix-dashboard/pull/1089?src=pr&el=desc) 
(31e8bf9) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/b3819c5ae939c9c0b0e55958718c9292eb89?el=desc)
 (b3819c5) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1089/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1089?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1089   +/-   ##
   ===
 Coverage   41.72%   41.72%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  759  759   
 Misses951  951   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1089?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1089?src=pr&el=footer).
 Last update 
[b3819c5...31e8bf9](https://codecov.io/gh/apache/apisix-dashboard/pull/1089?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix] Firstsawyou commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


Firstsawyou commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548815490



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: The ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+The traffic-split plugin is mainly composed of two parts: `match` and 
`weighted_upstreams`. `match` is a custom conditional rule, and 
`weighted_upstreams` is upstream configuration information. If you configure 
`match` and `weighted_upstreams` information, then after the `match` rule is 
verified, it will be based on the `weight` value in `weighted_upstreams`; the 
ratio of traffic between each upstream in the plug-in will be guided, 
otherwise, all traffic will be directly Reach the `upstream` configured on 
`route` or `service`. Of course, you can also configure only the 
`weighted_upstreams` part, which will directly guide the traffic ratio between 
each upstream in the plugin based on the `weight` value in `weighted_upstreams`.
+
+>Note: 1. 

[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1105: test: add frontend e2e test (smoke test for settings page)

2020-12-24 Thread GitBox


juzhiyuan commented on a change in pull request #1105:
URL: https://github.com/apache/apisix-dashboard/pull/1105#discussion_r548814851



##
File path: web/cypress/integration/settings/settings-smoketest.spec.js
##
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('settings page smoke test', () => {

Review comment:
   ```suggestion
   context('Smoke Test for Setting page', () => {
   ```

##
File path: web/cypress/integration/settings/settings-smoketest.spec.js
##
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('settings page smoke test', () => {
+  const domSelectors = {
+pageContent: '.ant-pro-page-container',
+notificationMsg: '.ant-notification-notice-message'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('visit settings page', () => {

Review comment:
   ```suggestion
 it('should visit settings page', () => {
   ```

##
File path: web/cypress/integration/settings/settings-smoketest.spec.js
##
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('settings page smoke test', () => {
+  const domSelectors = {
+pageContent: '.ant-pro-page-container',
+notificationMsg: '.ant-notification-notice-message'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('visit settings page', () => {
+// go to settings page
+cy.visit('/');
+cy.contains('Settings').click();
+cy.wait(500);
+cy.url().should('contains', '/settings');
+cy.get(domSelectors.pageContent)
+  .children()
+  .should('contain', 'Setting')
+  .and('contain', 'Grafana Address')
+  .and('contain', 'Grafana address should begin with HTTP or HTTPS')
+  });
+
+  it('set a invaild url', () => {

Review comment:
   ```suggestion
 it('should set a invaild url', () => {
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1116: test: enhance frontend e2e test stability (consumer)

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1116:
URL: https://github.com/apache/apisix-dashboard/pull/1116#issuecomment-750762834


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=h1) 
Report
   > Merging 
[#1116](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=desc) 
(941f2db) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/b3819c5ae939c9c0b0e55958718c9292eb89?el=desc)
 (b3819c5) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1116   +/-   ##
   ===
 Coverage   41.72%   41.72%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  759  759   
 Misses951  951   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=footer).
 Last update 
[b3819c5...941f2db](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix] spacewander commented on issue #3126: request help: do we support pinpoint?

2020-12-24 Thread GitBox


spacewander commented on issue #3126:
URL: https://github.com/apache/apisix/issues/3126#issuecomment-751186654


   We don't support pinpoint. It seems there is not an official / widely-used 
pinpoint client for OpenResty. Anyway, PR is welcome!



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1089: feat(FE): add service module

2020-12-24 Thread GitBox


liuxiran commented on a change in pull request #1089:
URL: https://github.com/apache/apisix-dashboard/pull/1089#discussion_r548813728



##
File path: web/src/pages/Service/Create.tsx
##
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+import React, { useState, useRef, useEffect } from 'react'
+import { useIntl, history } from 'umi';
+import { Card, Steps, Form, notification } from 'antd';
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
+import { omit } from 'lodash';
+
+import ActionBar from '@/components/ActionBar';
+import PluginPage from '@/components/Plugin';
+import Preview from './components/Preview';
+import Step1 from "./components/Step1";
+import { create, update, fetchItem } from './service';
+
+const { Step } = Steps;
+
+const Page: React.FC = (props) => {
+  const { formatMessage } = useIntl();
+  const [form] = Form.useForm();
+  const [upstreamForm] = Form.useForm();
+  const upstreamRef = useRef();
+  const [plugins, setPlugins] = useState({});
+
+  const STEP_HEADER = [
+formatMessage({ id: 'page.service.steps.stepTitle.basicInformation' }),
+formatMessage({ id: 'page.service.steps.stepTitle.pluginConfig' }),
+formatMessage({ id: 'component.global.steps.stepTitle.preview' }),
+  ]
+
+  const [stepHeader] = useState(STEP_HEADER);
+  const [step, setStep] = useState(1);
+
+  useEffect(() => {
+const { serviceId } = (props as any).match.params;
+if (serviceId) {
+  fetchItem(serviceId).then(({ data }) => {
+if (data.upstream_id && data.upstream_id !== '') {
+  upstreamForm.setFieldsValue({ upstream_id: data.upstream_id });
+}
+if (data.upstream) {
+  upstreamForm.setFieldsValue(data.upstream);
+}
+form.setFieldsValue(omit(data, ['upstream_id', 'upstream', 
'plugins']));
+setPlugins(data.plugins || {});
+  });
+}
+  }, []);
+
+  const onSubmit = () => {
+const data = {
+  ...form.getFieldsValue(),
+  plugins,
+};
+
+const upstreamFormData = upstreamForm.getFieldsValue();
+if (upstreamFormData.upstream_id === '') {
+  data.upstream = omit(upstreamFormData, ['upstream_id']);
+} else {
+  data.upstream_id = upstreamFormData.upstream_id;
+}
+
+const { serviceId } = (props as any).match.params;
+(serviceId ? update(serviceId, data) : create(data))
+  .then(() => {
+notification.success({
+  message: `${serviceId
+? formatMessage({ id: 'component.global.edit' })
+: formatMessage({ id: 'component.global.create' })
+} ${formatMessage({ id: 'menu.service' })} ${formatMessage({
+  id: 'component.status.success',
+})}`,
+});
+history.push('/service/list');
+  })
+  .catch(() => {
+setStep(3);
+  });
+  };
+
+  const onStepChange = (nextStep: number) => {
+if (step === 1 && nextStep === 2) {
+  form.validateFields().then(() => {
+upstreamForm.validateFields().then(() => {
+  setStep(nextStep);
+})
+  })
+  return;
+}
+if (nextStep === 4) {
+  onSubmit();
+  return;
+};
+setStep(nextStep);
+  }
+
+  return (<>
+
+  
+
+  {stepHeader.map((item) => (
+
+  ))}
+
+{step === 1 && }
+{step === 2 && (
+  

Review comment:
   got it





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] momo8zero closed issue #3123: request help: Route中vars不能使用IN操作符

2020-12-24 Thread GitBox


momo8zero closed issue #3123:
URL: https://github.com/apache/apisix/issues/3123


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] momo8zero commented on issue #3123: request help: Route中vars不能使用IN操作符

2020-12-24 Thread GitBox


momo8zero commented on issue #3123:
URL: https://github.com/apache/apisix/issues/3123#issuecomment-751185291


   > "vars": [
   > ["http_token","IN",["1","2"]]
   > ]
   > is the correct way.
   > 
   > The validation has bug. I fix it in #3124.
   
   Thank you!!!



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] gewei2000 opened a new issue #3126: request help: do we support pinpoint?

2020-12-24 Thread GitBox


gewei2000 opened a new issue #3126:
URL: https://github.com/apache/apisix/issues/3126


   ### Issue description
   do we support pinpoint?
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):2.1
   * OS: centos7
   * OpenResty / Nginx version: 1.19.3.1
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] tokers closed issue #739: Use cobra instead of flags for better CLI interactive feeling

2020-12-24 Thread GitBox


tokers closed issue #739:
URL: https://github.com/apache/apisix-dashboard/issues/739


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] tokers commented on issue #739: Use cobra instead of flags for better CLI interactive feeling

2020-12-24 Thread GitBox


tokers commented on issue #739:
URL: 
https://github.com/apache/apisix-dashboard/issues/739#issuecomment-751184943


   Solved since #773 was merged.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] tokers merged pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


tokers merged pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-dashboard] branch master updated (b3463fd -> b3819c5)

2020-12-24 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

tokers pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


from b3463fd  fix: delete POST method in /apisix/admin/consumer  (#1109)
 add b3819c5  chore: introduce corba as the cli scafford (#773)

No new revisions were added by this update.

Summary of changes:
 .actions/openwhisk-utilities |   1 -
 api/build.sh |   2 +-
 api/cmd/managerapi.go| 118 ++
 api/conf/conf.go |   5 +-
 api/go.mod   |  19 ++-
 api/go.sum   | 380 +--
 api/main.go  |  80 +
 api/test/shell/cli_test.sh   |   4 +-
 8 files changed, 508 insertions(+), 101 deletions(-)
 delete mode 16 .actions/openwhisk-utilities
 create mode 100644 api/cmd/managerapi.go



[GitHub] [apisix] spacewander opened a new pull request #3125: docs: improve the plugin-develop doc

2020-12-24 Thread GitBox


spacewander opened a new pull request #3125:
URL: https://github.com/apache/apisix/pull/3125


   Signed-off-by: spacewander 
   
   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [ ] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, 
please discuss on the [mailing 
list](https://github.com/apache/apisix/tree/master#community) first**
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #999: feat: add route group

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #999:
URL: https://github.com/apache/apisix-dashboard/pull/999#discussion_r548812825



##
File path: web/src/pages/Route/components/Step1/LabelsDrawer.tsx
##
@@ -0,0 +1,176 @@
+/*
+ * 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.
+ */
+import React, { useEffect, useState } from 'react';
+import { AutoComplete, Button, Col, Drawer, Form, notification, Row } from 
'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+import { transformLabelList, transformLableValueToKeyValue } from 
'../../transform';
+import { fetchLabelList } from '../../service';
+
+interface Props extends Pick {
+  labelsDataSource: string[];
+  disabled: boolean;
+  onClose(): void;
+}
+
+const LabelList = (disabled: boolean, labelList: RouteModule.LabelList) => {
+  const { formatMessage } = useIntl();
+
+  const keyOptions = Object.keys(labelList || {}).map((item) => ({ value: item 
}));
+  return (
+
+  {(fields, { add, remove }) => {
+return (
+  <>
+{fields.map((field, index) => (
+  
+
+  
+
+  
+
+  
+  
+
+  {({ getFieldValue }) => {
+const key = getFieldValue(['labels', field.name, 
'labelKey']);
+let valueOptions = [{ value: '' }];
+if (labelList) {
+  valueOptions = (labelList[key] || []).map((item) => 
({ value: item }));
+}
+
+return (
+  
+
+  
+);
+  }}
+
+  
+  
+{!disabled &&  
remove(field.name)} />}
+  
+
+  
+))}
+{!disabled && (
+  
+
+  
+  {formatMessage({ id: 'component.global.add' })}
+
+  
+)}
+  
+);
+  }}
+
+  );
+};
+
+const LabelsDrawer: React.FC = ({
+  disabled,
+  labelsDataSource,
+  onClose,
+  onChange = () => { },
+}) => {
+  const transformLabel = transformLableValueToKeyValue(labelsDataSource);
+
+  const { formatMessage } = useIntl();
+  const [form] = Form.useForm();
+  const [labelList, setLabelList] = useState();

Review comment:
   > default value?
   
   updated.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] tokers commented on pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


tokers commented on pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773#issuecomment-751184427


   > @tokers , What happen to the `.actions/openwhisk-utilities`?
   > Please see the file changes.
   
   We don't reference it as a submodule, just download it and use it in CI.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #999: feat: add route group

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #999:
URL: https://github.com/apache/apisix-dashboard/pull/999#discussion_r548812801



##
File path: web/src/pages/Route/List.tsx
##
@@ -14,21 +14,32 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import React, { useRef, useState } from 'react';
+import React, { useRef, useEffect, useState } from 'react';
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
 import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
-import { Button, Popconfirm, notification, Tag, Space } from 'antd';
+import { Button, Popconfirm, notification, Tag, Space, Select } from 'antd';
 import { history, useIntl } from 'umi';
 import { PlusOutlined, BugOutlined } from '@ant-design/icons';
-import { timestampToLocaleString } from '@/helpers';
 
-import { fetchList, remove, updateRouteStatus } from './service';
+import { timestampToLocaleString } from '@/helpers';
+import { transformLabelList } from './transform';
+import { fetchList, remove, fetchLabelList, updateRouteStatus } from 
'./service';
 import { DebugDrawView } from './components/DebugViews';
 
+
+const { OptGroup, Option } = Select;
+
 const Page: React.FC = () => {
   const ref = useRef();
   const { formatMessage } = useIntl();
 
+  const [labelList, setLabelList] = useState({});
+
+  useEffect(() => {
+fetchLabelList().then((data) => {
+  setLabelList(transformLabelList(data));

Review comment:
   > would better use a transformer in service, then you could set state by 
`then(setXXX)`
   
   updated.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #999: feat: add route group

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #999:
URL: https://github.com/apache/apisix-dashboard/pull/999#discussion_r548812782



##
File path: web/src/locales/zh-CN/component.ts
##
@@ -32,6 +32,7 @@ export default {
   'component.global.loading': '加载中',
   'component.global.list': '列表',
   'component.global.description': '描述',
+  'component.global.label': '标签',

Review comment:
   updated.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1096: test: add frontend e2e test (smoke test for ssl)

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1096:
URL: https://github.com/apache/apisix-dashboard/pull/1096#issuecomment-749412383


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1096?src=pr&el=h1) 
Report
   > Merging 
[#1096](https://codecov.io/gh/apache/apisix-dashboard/pull/1096?src=pr&el=desc) 
(0778525) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/b3463fda2c949833d5dba2c12c8fe3ab6a25399a?el=desc)
 (b3463fd) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1096/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1096?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1096   +/-   ##
   ===
 Coverage   41.72%   41.72%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  759  759   
 Misses951  951   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1096?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1096?src=pr&el=footer).
 Last update 
[b3463fd...0778525](https://codecov.io/gh/apache/apisix-dashboard/pull/1096?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #999: feat: add route group

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #999:
URL: https://github.com/apache/apisix-dashboard/pull/999#issuecomment-742169695


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=h1) 
Report
   > Merging 
[#999](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=desc) 
(f15ed3f) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/6fa6a16559a1c1d0e90de4a3277a3db6e73cb9fc?el=desc)
 (6fa6a16) will **decrease** coverage by `0.45%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/999/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #999  +/-   ##
   ==
   - Coverage   42.12%   41.67%   -0.46% 
   ==
 Files  29   29  
 Lines1816 1819   +3 
   ==
   - Hits  765  758   -7 
   - Misses943  952   +9 
   - Partials  108  109   +1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/999/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=)
 | `63.04% <0.00%> (-5.59%)` | :arrow_down: |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/999/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `78.57% <0.00%> (-0.65%)` | :arrow_down: |
   | 
[api/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/999/diff?src=pr&el=tree#diff-YXBpL2ZpbHRlci9zY2hlbWEuZ28=)
 | `0.00% <0.00%> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=footer).
 Last update 
[6fa6a16...f15ed3f](https://codecov.io/gh/apache/apisix-dashboard/pull/999?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773#issuecomment-747383388


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=h1) 
Report
   > Merging 
[#773](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=desc) 
(8929363) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/b3463fda2c949833d5dba2c12c8fe3ab6a25399a?el=desc)
 (b3463fd) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/773/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #773   +/-   ##
   ===
 Coverage   41.72%   41.72%   
   ===
 Files  29   29   
 Lines1819 1819   
   ===
 Hits  759  759   
 Misses951  951   
 Partials  109  109   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=footer).
 Last update 
[b3463fd...8929363](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix] spacewander commented on issue #3123: request help: Route中vars不能使用IN操作符

2020-12-24 Thread GitBox


spacewander commented on issue #3123:
URL: https://github.com/apache/apisix/issues/3123#issuecomment-751183185


   "vars": [
   ["http_token","IN",["1","2"]]
   ]
   is the correct way.
   
   The validation has bug. I fix it in 
https://github.com/apache/apisix/pull/3124.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander opened a new pull request #3124: fix: correct the validation of route.vars

2020-12-24 Thread GitBox


spacewander opened a new pull request #3124:
URL: https://github.com/apache/apisix/pull/3124


   Previously only the type is applied, and it is too strict.
   And now we should allow 4 items in the vars expression.
   
   Fix #3123
   
   Signed-off-by: spacewander 
   
   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, 
please discuss on the [mailing 
list](https://github.com/apache/apisix/tree/master#community) first**
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1116: test: enhance frontend e2e test stability (consumer)

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1116:
URL: https://github.com/apache/apisix-dashboard/pull/1116#issuecomment-750762834


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=h1) 
Report
   > Merging 
[#1116](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=desc) 
(d22f3b6) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/46bf1ef9cfe4f4c659752176424151bb4fc4952f?el=desc)
 (46bf1ef) will **increase** coverage by `0.66%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master#1116  +/-   ##
   ==
   + Coverage   41.06%   41.72%   +0.66% 
   ==
 Files  28   29   +1 
 Lines1773 1819  +46 
   ==
   + Hits  728  759  +31 
   - Misses939  951  +12 
   - Partials  106  109   +3 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=)
 | `63.04% <0.00%> (-5.59%)` | :arrow_down: |
   | 
[api/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/diff?src=pr&el=tree#diff-YXBpL2ZpbHRlci9zY2hlbWEuZ28=)
 | `0.00% <0.00%> (ø)` | |
   | 
[api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=)
 | `95.65% <0.00%> (ø)` | |
   | 
[api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==)
 | `29.54% <0.00%> (+0.06%)` | :arrow_up: |
   | 
[api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv)
 | `57.14% <0.00%> (+0.24%)` | :arrow_up: |
   | 
[api/internal/handler/plugin/plugin.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1116/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcGx1Z2luL3BsdWdpbi5nbw==)
 | `70.00% <0.00%> (+14.44%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=footer).
 Last update 
[46bf1ef...d22f3b6](https://codecov.io/gh/apache/apisix-dashboard/pull/1116?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] idbeta commented on a change in pull request #1116: test: enhance frontend e2e test stability (consumer)

2020-12-24 Thread GitBox


idbeta commented on a change in pull request #1116:
URL: https://github.com/apache/apisix-dashboard/pull/1116#discussion_r548811562



##
File path: web/cypress/integration/consumer/create_and_delete_consumer.spec.js
##
@@ -57,6 +57,8 @@ context('Create and Delete Consumer', () => {
   });
 cy.contains('button', 'Next').click();
 cy.contains('button', 'Submit').click();
+cy.wait(sleepTime)

Review comment:
   fixed.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1108: chore: adjust directory structure of api

2020-12-24 Thread GitBox


starsz commented on a change in pull request #1108:
URL: https://github.com/apache/apisix-dashboard/pull/1108#discussion_r548810935



##
File path: api/internal/filter/authentication.go
##
@@ -20,11 +20,11 @@ import (
"net/http"
"strings"
 
-   "github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
 
-   "github.com/apisix/manager-api/conf"
-   "github.com/apisix/manager-api/log"
+   "github.com/apisix/manager-api/internal/conf"
+   "github.com/apisix/manager-api/internal/log"
+   jwt "github.com/dgrijalva/jwt-go"

Review comment:
   I think we should classify the import package.
   
   See 
https://github.com/uber-go/guide/blob/master/style.md#import-group-ordering

##
File path: api/internal/filter/recover.go
##
@@ -24,7 +24,7 @@ import (
"runtime"
"time"
 
-   "github.com/apisix/manager-api/log"
+   "github.com/apisix/manager-api/internal/log"

Review comment:
   Ditto.

##
File path: api/internal/handler/route/route.go
##
@@ -30,15 +30,15 @@ import (
"github.com/shiningrush/droplet/data"
"github.com/shiningrush/droplet/wrapper"
wgin "github.com/shiningrush/droplet/wrapper/gin"
-   "github.com/yuin/gopher-lua"
 
-   "github.com/apisix/manager-api/conf"
+   "github.com/apisix/manager-api/internal/conf"
"github.com/apisix/manager-api/internal/core/entity"
"github.com/apisix/manager-api/internal/core/store"
"github.com/apisix/manager-api/internal/handler"
+   "github.com/apisix/manager-api/internal/log"
"github.com/apisix/manager-api/internal/utils"
"github.com/apisix/manager-api/internal/utils/consts"
-   "github.com/apisix/manager-api/log"
+   lua "github.com/yuin/gopher-lua"

Review comment:
   Ditto.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773#issuecomment-747383388


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=h1) 
Report
   > Merging 
[#773](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=desc) 
(45b0fd3) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/46bf1ef9cfe4f4c659752176424151bb4fc4952f?el=desc)
 (46bf1ef) will **increase** coverage by `1.71%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/773/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #773  +/-   ##
   ==
   + Coverage   41.06%   42.77%   +1.71% 
   ==
 Files  28   29   +1 
 Lines1773 1985 +212 
   ==
   + Hits  728  849 +121 
   - Misses939 1026  +87 
   - Partials  106  110   +4 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/773/diff?src=pr&el=tree#diff-YXBpL2ZpbHRlci9zY2hlbWEuZ28=)
 | `0.00% <0.00%> (ø)` | |
   | 
[api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/773/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=)
 | `95.65% <0.00%> (ø)` | |
   | 
[api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/773/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=)
 | `70.66% <0.00%> (+2.03%)` | :arrow_up: |
   | 
[api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/773/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==)
 | `35.22% <0.00%> (+5.74%)` | :arrow_up: |
   | 
[api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/773/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv)
 | `65.21% <0.00%> (+8.32%)` | :arrow_up: |
   | 
[api/internal/handler/plugin/plugin.go](https://codecov.io/gh/apache/apisix-dashboard/pull/773/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcGx1Z2luL3BsdWdpbi5nbw==)
 | `75.67% <0.00%> (+20.12%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=footer).
 Last update 
[46bf1ef...45b0fd3](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix] idbeta commented on a change in pull request #3061: test: add ci on centos7

2020-12-24 Thread GitBox


idbeta commented on a change in pull request #3061:
URL: https://github.com/apache/apisix/pull/3061#discussion_r548811041



##
File path: .github/workflows/centos7.yml
##
@@ -0,0 +1,109 @@
+name: test_apisix_on_centos7
+
+on:
+  push:
+branches:
+  - master
+  pull_request:
+branches:
+  - master
+
+jobs:
+  test_apisix:
+name: test_apisix_on_centos7
+runs-on: ubuntu-latest
+
+services:
+  etcd:
+image: bitnami/etcd:3.4.0
+ports:
+  - 2379:2379
+  - 2380:2380
+env:
+  ALLOW_NONE_AUTHENTICATION: yes
+  ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
+
+  old_etcd:
+image: bitnami/etcd:3.3.8
+ports:
+  - 3379:2379
+  - 3380:2380
+env:
+  ALLOW_NONE_AUTHENTICATION: yes
+  ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
+
+steps:
+- name: Check out code
+  uses: actions/checkout@v2
+  with:
+submodules: recursive
+
+- name: Install Redis Cluster
+  uses: vishnudxb/redis-cluster@1.0.5
+  with:
+master1-port: 5000
+master2-port: 5001
+master3-port: 5002
+slave1-port: 5003
+slave2-port: 5004
+slave3-port: 5005
+
+- name: Running Redis Cluster Test
+  run: |
+sudo apt-get install -y redis-tools
+docker ps -a
+redis-cli -h 127.0.0.1 -p 5000 ping
+redis-cli -h 127.0.0.1 -p 5000 cluster nodes
+
+- name: Running etcd server with TLS
+  run: |
+sudo docker run -d -p 12379:12379 -p 12380:12380 \
+-e ALLOW_NONE_AUTHENTICATION=yes \
+-e ETCD_ADVERTISE_CLIENT_URLS=https://0.0.0.0:12379 \
+-e ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:12379 \
+-e ETCD_CERT_FILE=/certs/etcd.pem \
+-e ETCD_KEY_FILE=/certs/etcd.key \
+-e GITHUB_ACTIONS=true \
+-e CI=true \
+-v /home/runner/work/apisix/apisix/t/certs:/certs \
+bitnami/etcd:3.4.0
+
+- name: run centos7 docker and mapping apisix into container
+  run: |
+docker run -itd -v /home/runner/work/apisix/apisix:/tmp/apisix --name 
centos7Instance --net="host" docker.io/centos:7 /bin/bash
+
+- name: run other docker containers for test
+  run: |
+docker run --rm -itd -p 6379:6379 --name apisix_redis redis:3.0-alpine
+docker run --rm -itd -e HTTP_PORT= -e HTTPS_PORT= -p : 
-p : mendhak/http-https-echo
+docker run --rm -itd -e KEYCLOAK_USER=admin -e 
KEYCLOAK_PASSWORD=123456 -p 8090:8080 -p 8443:8443 sshniro/keycloak-apisix
+docker network create kafka-net --driver bridge
+docker run --name zookeeper-server -d -p 2181:2181 --network kafka-net 
-e ALLOW_ANONYMOUS_LOGIN=yes bitnami/zookeeper:3.6.0
+docker run --name kafka-server1 -d --network kafka-net -e 
ALLOW_PLAINTEXT_LISTENER=yes -e 
KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper-server:2181 -e 
KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092 -p 9092:9092 -e 
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true bitnami/kafka:latest
+docker run --name eureka -d -p 8761:8761 --env ENVIRONMENT=apisix 
--env spring.application.name=apisix-eureka --env server.port=8761 --env 
eureka.instance.ip-address=127.0.0.1 --env 
eureka.client.registerWithEureka=true --env eureka.client.fetchRegistry=false 
--env eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka/ 
bitinit/eureka
+sleep 5
+docker exec -i kafka-server1 /opt/bitnami/kafka/bin/kafka-topics.sh 
--create --zookeeper zookeeper-server:2181 --replication-factor 1 --partitions 
1 --topic test2
+docker run --rm --name skywalking -d -p 1234:1234 -p 11800:11800 -p 
12800:12800 apache/skywalking-oap-server
+
+- name: install dependencies
+  run: |
+docker exec centos7Instance bash -c "yum install -y wget tar gcc 
automake autoconf libtool make && wget 
http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && rpm 
-ivh epel-release-latest-7.noarch.rpm"
+docker exec centos7Instance bash -c "yum install -y curl git luarocks 
lua-devel which"
+docker exec centos7Instance bash -c "yum install -y yum-utils && 
yum-config-manager --add-repo 
https://openresty.org/package/centos/openresty.repo";
+docker exec centos7Instance bash -c "yum install -y openresty-debug"
+docker exec centos7Instance bash -c "wget 
https://github.com/etcd-io/etcd/releases/download/v3.4.0/etcd-v3.4.0-linux-amd64.tar.gz
 && tar xf etcd-v3.4.0-linux-amd64.tar.gz"
+docker exec centos7Instance bash -c "cp 
/etcd-v3.4.0-linux-amd64/etcdctl /usr/local/bin/ && rm -rf 
etcd-v3.4.0-linux-amd64"
+docker exec centos7Instance bash -c "yum install -y cpanminus 
build-essential libncurses5-dev libreadline-dev libssl-dev perl"
+docker exec centos7Instance bash -c "cp -r /tmp/apisix ./"
+docker exec centos7Instance bash -c 
"PATH=/usr/local/openresty-debu

[GitHub] [apisix] tokers commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


tokers commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548810397



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: The ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+The traffic-split plugin is mainly composed of two parts: `match` and 
`weighted_upstreams`. `match` is a custom conditional rule, and 
`weighted_upstreams` is upstream configuration information. If you configure 
`match` and `weighted_upstreams` information, then after the `match` rule is 
verified, it will be based on the `weight` value in `weighted_upstreams`; the 
ratio of traffic between each upstream in the plug-in will be guided, 
otherwise, all traffic will be directly Reach the `upstream` configured on 
`route` or `service`. Of course, you can also configure only the 
`weighted_upstreams` part, which will directly guide the traffic ratio between 
each upstream in the plugin based on the `weight` value in `weighted_upstreams`.
+
+>Note: 1. In `m

[GitHub] [apisix] spacewander commented on issue #3112: request help: what is the use of item_release in lrucache.lua

2020-12-24 Thread GitBox


spacewander commented on issue #3112:
URL: https://github.com/apache/apisix/issues/3112#issuecomment-751181222


   We only need lock when the cache is miss, and need to create the object (via 
query other system)



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] tokers merged pull request #1109: fix: delete POST method in /apisix/admin/consumer

2020-12-24 Thread GitBox


tokers merged pull request #1109:
URL: https://github.com/apache/apisix-dashboard/pull/1109


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] tokers closed issue #852: bug: manager-api supported `POST` method for consumer

2020-12-24 Thread GitBox


tokers closed issue #852:
URL: https://github.com/apache/apisix-dashboard/issues/852


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-dashboard] branch master updated: fix: delete POST method in /apisix/admin/consumer (#1109)

2020-12-24 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
 new b3463fd  fix: delete POST method in /apisix/admin/consumer  (#1109)
b3463fd is described below

commit b3463fda2c949833d5dba2c12c8fe3ab6a25399a
Author: Peter Zhu 
AuthorDate: Fri Dec 25 14:02:09 2020 +0800

fix: delete POST method in /apisix/admin/consumer  (#1109)

fixed #852
related #868
---
 api/internal/handler/consumer/consumer.go  |  38 +++---
 api/internal/handler/consumer/consumer_test.go |  87 ++--
 api/test/e2e/consumer_test.go  | 179 +
 api/test/e2e/route_online_debug_test.go|   2 +-
 api/test/shell/cli_test.sh |   4 +-
 web/src/pages/Consumer/service.ts  |   2 +-
 6 files changed, 248 insertions(+), 64 deletions(-)

diff --git a/api/internal/handler/consumer/consumer.go 
b/api/internal/handler/consumer/consumer.go
index 31b7af3..b3ea5a1 100644
--- a/api/internal/handler/consumer/consumer.go
+++ b/api/internal/handler/consumer/consumer.go
@@ -17,17 +17,21 @@
 package consumer
 
 import (
+   "fmt"
+   "net/http"
"reflect"
"strings"
 
"github.com/gin-gonic/gin"
"github.com/shiningrush/droplet"
+   "github.com/shiningrush/droplet/data"
"github.com/shiningrush/droplet/wrapper"
wgin "github.com/shiningrush/droplet/wrapper/gin"
 
"github.com/apisix/manager-api/internal/core/entity"
"github.com/apisix/manager-api/internal/core/store"
"github.com/apisix/manager-api/internal/handler"
+   "github.com/apisix/manager-api/internal/utils"
 )
 
 type Handler struct {
@@ -45,12 +49,10 @@ func (h *Handler) ApplyRoute(r *gin.Engine) {
wrapper.InputType(reflect.TypeOf(GetInput{}
r.GET("/apisix/admin/consumers", wgin.Wraps(h.List,
wrapper.InputType(reflect.TypeOf(ListInput{}
-   r.POST("/apisix/admin/consumers", wgin.Wraps(h.Create,
-   wrapper.InputType(reflect.TypeOf(entity.Consumer{}
-   r.PUT("/apisix/admin/consumers/:username", wgin.Wraps(h.Update,
-   wrapper.InputType(reflect.TypeOf(UpdateInput{}
-   r.PUT("/apisix/admin/consumers", wgin.Wraps(h.Update,
-   wrapper.InputType(reflect.TypeOf(UpdateInput{}
+   r.PUT("/apisix/admin/consumers/:username", wgin.Wraps(h.Set,
+   wrapper.InputType(reflect.TypeOf(SetInput{}
+   r.PUT("/apisix/admin/consumers", wgin.Wraps(h.Set,
+   wrapper.InputType(reflect.TypeOf(SetInput{}
r.DELETE("/apisix/admin/consumers/:usernames", wgin.Wraps(h.BatchDelete,
wrapper.InputType(reflect.TypeOf(BatchDeleteInput{}
 }
@@ -128,25 +130,17 @@ func (h *Handler) List(c droplet.Context) (interface{}, 
error) {
return ret, nil
 }
 
-func (h *Handler) Create(c droplet.Context) (interface{}, error) {
-   input := c.Input().(*entity.Consumer)
-   input.ID = input.Username
-
-   ensurePluginsDefValue(input.Plugins)
-   if err := h.consumerStore.Create(c.Context(), input); err != nil {
-   return handler.SpecCodeResponse(err), err
-   }
-
-   return nil, nil
-}
-
-type UpdateInput struct {
-   Username string `auto_read:"username,path"`
+type SetInput struct {
entity.Consumer
+   Username string `auto_read:"username,path"`
 }
 
-func (h *Handler) Update(c droplet.Context) (interface{}, error) {
-   input := c.Input().(*UpdateInput)
+func (h *Handler) Set(c droplet.Context) (interface{}, error) {
+   input := c.Input().(*SetInput)
+   if input.ID != nil && utils.InterfaceToString(input.ID) != 
input.Username {
+   return &data.SpecCodeResponse{StatusCode: 
http.StatusBadRequest},
+   fmt.Errorf("consumer's id and username must be a same 
value")
+   }
if input.Username != "" {
input.Consumer.Username = input.Username
}
diff --git a/api/internal/handler/consumer/consumer_test.go 
b/api/internal/handler/consumer/consumer_test.go
index 6a82154..5c80d90 100644
--- a/api/internal/handler/consumer/consumer_test.go
+++ b/api/internal/handler/consumer/consumer_test.go
@@ -20,14 +20,16 @@ package consumer
 import (
"context"
"fmt"
-   "github.com/apisix/manager-api/internal/core/entity"
-   "github.com/apisix/manager-api/internal/core/store"
+   "net/http"
+   "testing"
+
"github.com/shiningrush/droplet"
"github.com/shiningrush/droplet/data"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
-   "net/http"
-   "testing"
+
+   "github.com/apisix/manager-api/internal/core/entity"
+   "github.com/apisix/manager-api/internal/core/store"
 )
 
 func TestH

[GitHub] [apisix] Firstsawyou commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


Firstsawyou commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548809598



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: The ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+The traffic-split plugin is mainly composed of two parts: `match` and 
`weighted_upstreams`. `match` is a custom conditional rule, and 
`weighted_upstreams` is upstream configuration information. If you configure 
`match` and `weighted_upstreams` information, then after the `match` rule is 
verified, it will be based on the `weight` value in `weighted_upstreams`; the 
ratio of traffic between each upstream in the plug-in will be guided, 
otherwise, all traffic will be directly Reach the `upstream` configured on 
`route` or `service`. Of course, you can also configure only the 
`weighted_upstreams` part, which will directly guide the traffic ratio between 
each upstream in the plugin based on the `weight` value in `weighted_upstreams`.
+
+>Note: 1. 

[GitHub] [apisix-dashboard] starsz commented on pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


starsz commented on pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773#issuecomment-751179386


   @tokers , What happen to the `.actions/openwhisk-utilities`?
   Please see the file changes.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-docker] gxthrj commented on issue #107: request help: docker hub for apisix v1.5

2020-12-24 Thread GitBox


gxthrj commented on issue #107:
URL: https://github.com/apache/apisix-docker/issues/107#issuecomment-751179377


   @moonming Do you have time to look at this issue, it seems something was 
wrong when building or pushing image.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


tokers commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548807680



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: The ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+The traffic-split plugin is mainly composed of two parts: `match` and 
`weighted_upstreams`. `match` is a custom conditional rule, and 
`weighted_upstreams` is upstream configuration information. If you configure 
`match` and `weighted_upstreams` information, then after the `match` rule is 
verified, it will be based on the `weight` value in `weighted_upstreams`; the 
ratio of traffic between each upstream in the plug-in will be guided, 
otherwise, all traffic will be directly Reach the `upstream` configured on 
`route` or `service`. Of course, you can also configure only the 
`weighted_upstreams` part, which will directly guide the traffic ratio between 
each upstream in the plugin based on the `weight` value in `weighted_upstreams`.
+
+>Note: 1. In `m

[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1109: fix: delete POST method in /apisix/admin/consumer

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1109:
URL: https://github.com/apache/apisix-dashboard/pull/1109#issuecomment-750319379


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=h1) 
Report
   > Merging 
[#1109](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=desc) 
(2efadbb) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/266605229184a501a7bbf40e19e67df68d3367f3?el=desc)
 (2666052) will **decrease** coverage by `0.21%`.
   > The diff coverage is `12.50%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1109/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master#1109  +/-   ##
   ==
   - Coverage   41.94%   41.72%   -0.22% 
   ==
 Files  29   29  
 Lines1824 1819   -5 
   ==
   - Hits  765  759   -6 
 Misses951  951  
   - Partials  108  109   +1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1109/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=)
 | `63.04% <12.50%> (-5.59%)` | :arrow_down: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=footer).
 Last update 
[2666052...2efadbb](https://codecov.io/gh/apache/apisix-dashboard/pull/1109?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] membphis commented on a change in pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


membphis commented on a change in pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773#discussion_r548807322



##
File path: api/go.sum
##
@@ -1,30 +1,86 @@
+cloud.google.com/go v0.34.0/go.mod 
h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=

Review comment:
   nice





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] HelloBug0 commented on issue #3112: request help: what is the use of item_release in lrucache.lua

2020-12-24 Thread GitBox


HelloBug0 commented on issue #3112:
URL: https://github.com/apache/apisix/issues/3112#issuecomment-751174034


   Oh, I mean locking from line 100 to line 104. Sorry about the mistake.
   ```lua
   local cache_obj = fetch_valid_cache(lru_obj, invalid_stale, item_ttl,
   item_release, key, version)
   if cache_obj then
   return cache_obj.val
   end
   ```



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] gxthrj commented on pull request #1108: chore: mv main.go to cmd

2020-12-24 Thread GitBox


gxthrj commented on pull request #1108:
URL: https://github.com/apache/apisix-dashboard/pull/1108#issuecomment-751173797


   > should we move 'log' and 'conf' into 'internal' too?
   
   Done



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1108: chore: mv main.go to cmd

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1108:
URL: https://github.com/apache/apisix-dashboard/pull/1108#issuecomment-750012360


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=h1) 
Report
   > Merging 
[#1108](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=desc) 
(9685988) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/266605229184a501a7bbf40e19e67df68d3367f3?el=desc)
 (2666052) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1108   +/-   ##
   ===
 Coverage   41.94%   41.94%   
   ===
 Files  29   29   
 Lines1824 1824   
   ===
 Hits  765  765   
 Misses951  951   
 Partials  108  108   
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==)
 | `60.46% <ø> (ø)` | |
   | 
[api/internal/core/store/query.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvcXVlcnkuZ28=)
 | `88.09% <ø> (ø)` | |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.22% <ø> (ø)` | |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=)
 | `57.62% <ø> (ø)` | |
   | 
[api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/logging.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9sb2dnaW5nLmdv)
 | `86.95% <ø> (ø)` | |
   | 
[api/internal/filter/recover.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZWNvdmVyLmdv)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv)
 | `0.00% <ø> (ø)` | |
   | ... and [5 
more](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree-more)
 | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=footer).
 Last update 
[2666052...9685988](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix] Firstsawyou commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


Firstsawyou commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548804016



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: The ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+The traffic-split plugin is mainly composed of two parts: `match` and 
`weighted_upstreams`. `match` is a custom conditional rule, and 
`weighted_upstreams` is upstream configuration information. If you configure 
`match` and `weighted_upstreams` information, then after the `match` rule is 
verified, it will be based on the `weight` value in `weighted_upstreams`; the 
ratio of traffic between each upstream in the plug-in will be guided, 
otherwise, all traffic will be directly Reach the `upstream` configured on 
`route` or `service`. Of course, you can also configure only the 
`weighted_upstreams` part, which will directly guide the traffic ratio between 
each upstream in the plugin based on the `weight` value in `weighted_upstreams`.
+
+>Note: 1. 

[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1108: chore: mv main.go to cmd

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1108:
URL: https://github.com/apache/apisix-dashboard/pull/1108#issuecomment-750012360


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=h1) 
Report
   > Merging 
[#1108](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=desc) 
(a4699f7) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/266605229184a501a7bbf40e19e67df68d3367f3?el=desc)
 (2666052) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master#1108   +/-   ##
   ===
 Coverage   41.94%   41.94%   
   ===
 Files  29   29   
 Lines1824 1824   
   ===
 Hits  765  765   
 Misses951  951   
 Partials  108  108   
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==)
 | `60.46% <ø> (ø)` | |
   | 
[api/internal/core/store/query.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvcXVlcnkuZ28=)
 | `88.09% <ø> (ø)` | |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.22% <ø> (ø)` | |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=)
 | `57.62% <ø> (ø)` | |
   | 
[api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/logging.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9sb2dnaW5nLmdv)
 | `86.95% <ø> (ø)` | |
   | 
[api/internal/filter/recover.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZWNvdmVyLmdv)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv)
 | `0.00% <ø> (ø)` | |
   | ... and [2 
more](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree-more)
 | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=footer).
 Last update 
[2666052...a4699f7](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1108: chore: mv main.go to cmd

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1108:
URL: https://github.com/apache/apisix-dashboard/pull/1108#issuecomment-750012360


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=h1) 
Report
   > Merging 
[#1108](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=desc) 
(16b2aab) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/0e6e2805362a8dc9b83f56f53be17f12a8ddbacf?el=desc)
 (0e6e280) will **decrease** coverage by `0.05%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master#1108  +/-   ##
   ==
   - Coverage   41.94%   41.88%   -0.06% 
   ==
 Files  29   29  
 Lines1824 1824  
   ==
   - Hits  765  764   -1 
   - Misses951  952   +1 
 Partials  108  108  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==)
 | `60.46% <ø> (ø)` | |
   | 
[api/internal/core/store/query.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvcXVlcnkuZ28=)
 | `88.09% <ø> (ø)` | |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `78.57% <ø> (-0.65%)` | :arrow_down: |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=)
 | `57.62% <ø> (ø)` | |
   | 
[api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/logging.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9sb2dnaW5nLmdv)
 | `86.95% <ø> (ø)` | |
   | 
[api/internal/filter/recover.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZWNvdmVyLmdv)
 | `0.00% <ø> (ø)` | |
   | 
[api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv)
 | `0.00% <ø> (ø)` | |
   | ... and [3 
more](https://codecov.io/gh/apache/apisix-dashboard/pull/1108/diff?src=pr&el=tree-more)
 | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=footer).
 Last update 
[0e6e280...16b2aab](https://codecov.io/gh/apache/apisix-dashboard/pull/1108?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #773: chore: introduce corba as the cli scafford

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #773:
URL: https://github.com/apache/apisix-dashboard/pull/773#issuecomment-747383388


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=h1) 
Report
   > Merging 
[#773](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=desc) 
(dd52205) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/266605229184a501a7bbf40e19e67df68d3367f3?el=desc)
 (2666052) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/773/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #773   +/-   ##
   ===
 Coverage   41.94%   41.94%   
   ===
 Files  29   29   
 Lines1824 1824   
   ===
 Hits  765  765   
 Misses951  951   
 Partials  108  108   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=footer).
 Last update 
[2666052...dd52205](https://codecov.io/gh/apache/apisix-dashboard/pull/773?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix-dashboard] juzhiyuan commented on issue #1098: The menu bar `consumer ` in Chinese view supports Chinese

2020-12-24 Thread GitBox


juzhiyuan commented on issue #1098:
URL: 
https://github.com/apache/apisix-dashboard/issues/1098#issuecomment-751172436


   1. `消费者`;
   2. `应用`;
   3. xxx



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan closed issue #1013: add spell CI tool

2020-12-24 Thread GitBox


juzhiyuan closed issue #1013:
URL: https://github.com/apache/apisix-dashboard/issues/1013


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan merged pull request #1107: feat: add spell checker (#1013)

2020-12-24 Thread GitBox


juzhiyuan merged pull request #1107:
URL: https://github.com/apache/apisix-dashboard/pull/1107


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-dashboard] branch master updated: feat: add spell checker (#1013) (#1107)

2020-12-24 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
 new 2666052  feat: add spell checker (#1013) (#1107)
2666052 is described below

commit 266605229184a501a7bbf40e19e67df68d3367f3
Author: Peter Zhu 
AuthorDate: Fri Dec 25 13:06:59 2020 +0800

feat: add spell checker (#1013) (#1107)

Co-authored-by: 琚致远 
Co-authored-by: Alex Zhang 
---
 .github/workflows/spellchecker.yml | 21 +
 1 file changed, 21 insertions(+)

diff --git a/.github/workflows/spellchecker.yml 
b/.github/workflows/spellchecker.yml
new file mode 100644
index 000..6b24651
--- /dev/null
+++ b/.github/workflows/spellchecker.yml
@@ -0,0 +1,21 @@
+name: spellchecker
+on:
+  pull_request:
+branches:
+  - master
+jobs:
+  misspell:
+name: runner/misspell
+runs-on: ubuntu-latest
+steps:
+  - name: Check out code.
+uses: actions/checkout@v1
+  - name: Install
+run: |
+  wget -O - -q https://git.io/misspell | sh -s -- -b .
+  - name: Misspell
+run: |
+  find . -type f -maxdepth 1 | xargs ./misspell -error
+  find . -name "*.go" -type f | xargs ./misspell -error
+  find docs -type f | xargs ./misspell -error
+  find web/src web/cypress -type f | xargs ./misspell -error



[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1097: feat: "upstream" i18n

2020-12-24 Thread GitBox


juzhiyuan commented on pull request #1097:
URL: https://github.com/apache/apisix-dashboard/pull/1097#issuecomment-751172123


   ping @guoqqqi 



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nopost commented on issue #487: Who is using APISIX?(欢迎使用 APISIX 的个人和公司在此留言)

2020-12-24 Thread GitBox


nopost commented on issue #487:
URL: https://github.com/apache/apisix/issues/487#issuecomment-751168179


   Organization: zihao.biz
   Location: Hangzhou, China
   Contact: nop...@qq.com
   Scenario: to manage dynamic proxy and pass proxy api  ,As a gateway, it 
processes the traffic between various services, gray publishing and black and 
white lists
   
   组织:杭州紫豪网络科技有限公司
   地址:中国杭州
   联系方式:nop...@qq.com
   使用场景:反向代理服务器,网关使用处理平台各种服务之间的流量,灰度发布以及黑白名单等



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #1063: fix: when create a route without ID in request body by Admin API, it can't be displayed in Manager API

2020-12-24 Thread GitBox


ShiningRush commented on a change in pull request #1063:
URL: https://github.com/apache/apisix-dashboard/pull/1063#discussion_r548796489



##
File path: api/internal/core/store/store.go
##
@@ -54,7 +54,7 @@ type GenericStore struct {
 type GenericStoreOption struct {
BasePath   string
ObjTypereflect.Type
-   KeyFuncfunc(obj interface{}) string
+   KeyFuncfunc(obj interface{}, key string) string

Review comment:
   Wow, this is not a good way, `KeyFunc` is responsible to ensure resource 
key, not the place to do compatible logic.
   We can do it in `StringToObjPtr`.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] jinchizhou closed pull request #1114: test if CI tests broke

2020-12-24 Thread GitBox


jinchizhou closed pull request #1114:
URL: https://github.com/apache/apisix-dashboard/pull/1114


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1096: test: add frontend e2e test (smoke test for ssl)

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #1096:
URL: https://github.com/apache/apisix-dashboard/pull/1096#discussion_r548795161



##
File path: web/cypress/integration/ssl/ssl-smoketest.spec.js
##
@@ -0,0 +1,125 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('ssl smoke test', () => {
+  const domSelectors = {
+notificationDesc: '.ant-notification-notice-description',
+notificationMsg: '.ant-notification-notice-message'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('set match certificate and key by input', () => {
+// go to ssl create page
+cy.visit('/');
+cy.contains('SSL').click();
+cy.wait(500);
+cy.contains('Create').click();
+
+cy.get('#cert').type(`-BEGIN CERTIFICATE-
+MIIENzCCAx+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwaTELMAkGA1UEBhMCQ04x
+EjAQBgNVBAgMCUd1YW5nZG9uZzESMBAGA1UEBwwJR3Vhbmd6aG91MRQwEgYDVQQK
+DAtGaXNoZHJvd25lZDEcMBoGA1UEAwwTRmlzaGRyb3duZWQgUk9PVCBDQTAeFw0y
+MDExMDYwOTQ3NDhaFw0yMjExMDYwOTQ3NDhaMH8xCzAJBgNVBAYTAkNOMRIwEAYD
+VQQIDAlHdWFuZ2RvbmcxEjAQBgNVBAcMCUd1YW5nemhvdTEUMBIGA1UECgwLRmlz
+aGRyb3duZWQxFzAVBgNVBAsMDnd3dy50ZXN0aGouY29tMRkwFwYDVQQDDBAqLnd3
+dy50ZXN0aGouY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzt2V
+U3JAtNkiUhC/FKA0D3z9gRHaNR2+JYqnMHbetXJXF0ohWMKzjmzauaMYXUDPfQ8y
+c7leR6Gj9Ow5A0sUwlSdH1P0viM1gnQj0kLxeb59vQaWSNuPm73C26R6en/Jgu8I
+09c+gsBkhNykcnLevR5YPw2mOOKgLllmpCJsjqMkUUF1SLI503ZK2hVH6FdSntBS
+YDbQVJVQ8j3M71eKr/D8Z5wN4Px41Y2bTke+xXm/2x5YRkZdtLCx/rbXPnYLruhG
+/C7aLqlA/ykQV0AWQgu1tc5gnAcT3mb/3y7GlybC8poMNPcEWic05hBJhpxlDNll
+wmUpcLEI3orAfbZnBwIDAQABo4HSMIHPMAkGA1UdEwQCMAAwMwYJYIZIAYb4QgEN
+BCYWJE9wZW5TU0wgR2VuZXJhdGVkIFNlcnZlciBDZXJ0aWZpY2F0ZTAdBgNVHQ4E
+FgQUfETT6xM8b68g7gTGDoTMChRckhcwHwYDVR0jBBgwFoAUB160Cmr3uK3bPRJr
+QLm4zR+M4fEwCwYDVR0PBAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMCsGA1Ud
+EQQkMCKCECoud3d3LnRlc3Roai5jb22CDnd3dy50ZXN0aGouY29tMA0GCSqGSIb3
+DQEBCwUAA4IBAQBKhcUTzhgEwtbVfn1cmlH3sFpzs2Bp7LZNDbhvZHJHQv70lJzA
+Ik3b8WyYu6WvAAQS90P2HVh5m8jeVLfZod+AF96F+b9tOn+VkuEQ7g4gIbn/NhWp
+/A8WFG7c6UvE3qQDBqN8UXRO3ZUlrweZwkCWQ6ioHzf+mw69xv7z1R/xo6Jcls7f
+7o/W5xXhGgFuJCutjAMf+5PkZsqo1XgpZbcD3as3vTZ2ynbZuWrtqquIKHoulL6z
+7aaDKz3NSgdSrGLwTRny8iDW6aGdDsWQGlOZV0Z6r9neFKimE0alUUyIn0j4raoD
+X+/an0a+Qq1jWejwU9R59Xdv0/fZWXzKmkeC
+-END CERTIFICATE-`);
+cy.get('#key').type(`-BEGIN RSA PRIVATE KEY-
+MIIEpQIBAAKCAQEAzt2VU3JAtNkiUhC/FKA0D3z9gRHaNR2+JYqnMHbetXJXF0oh

Review comment:
   ditto





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1096: test: add frontend e2e test (smoke test for ssl)

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #1096:
URL: https://github.com/apache/apisix-dashboard/pull/1096#discussion_r548795125



##
File path: web/cypress/integration/ssl/ssl-smoketest.spec.js
##
@@ -0,0 +1,125 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('ssl smoke test', () => {
+  const domSelectors = {
+notificationDesc: '.ant-notification-notice-description',
+notificationMsg: '.ant-notification-notice-message'
+  };
+
+  beforeEach(() => {
+// init login 
+cy.login();
+  })
+
+  it('set match certificate and key by input', () => {
+// go to ssl create page
+cy.visit('/');
+cy.contains('SSL').click();
+cy.wait(500);
+cy.contains('Create').click();
+
+cy.get('#cert').type(`-BEGIN CERTIFICATE-

Review comment:
   too ugly here. need to extract public variables.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


tokers commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548793999



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: The ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+The traffic-split plugin is mainly composed of two parts: `match` and 
`weighted_upstreams`. `match` is a custom conditional rule, and 
`weighted_upstreams` is upstream configuration information. If you configure 
`match` and `weighted_upstreams` information, then after the `match` rule is 
verified, it will be based on the `weight` value in `weighted_upstreams`; the 
ratio of traffic between each upstream in the plug-in will be guided, 
otherwise, all traffic will be directly Reach the `upstream` configured on 
`route` or `service`. Of course, you can also configure only the 
`weighted_upstreams` part, which will directly guide the traffic ratio between 
each upstream in the plugin based on the `weight` value in `weighted_upstreams`.
+
+>Note: 1. In `m

[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1089: feat(FE): add service module

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #1089:
URL: https://github.com/apache/apisix-dashboard/pull/1089#discussion_r548793531



##
File path: web/src/pages/Service/components/Step1.tsx
##
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+import React, { useEffect, useState } from 'react';
+import { Form, Input } from 'antd';
+import { useIntl } from 'umi';
+
+import UpstreamForm from '@/components/Upstream';

Review comment:
   updated.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1063: fix: when create a route without ID in request body by Admin API, it can't be displayed in Manager API

2020-12-24 Thread GitBox


codecov-io edited a comment on pull request #1063:
URL: https://github.com/apache/apisix-dashboard/pull/1063#issuecomment-747899278


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=h1) 
Report
   > Merging 
[#1063](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=desc) 
(8720671) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/0e6e2805362a8dc9b83f56f53be17f12a8ddbacf?el=desc)
 (0e6e280) will **decrease** coverage by `0.09%`.
   > The diff coverage is `32.14%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1063/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master#1063  +/-   ##
   ==
   - Coverage   41.94%   41.84%   -0.10% 
   ==
 Files  29   29  
 Lines1824 1828   +4 
   ==
 Hits  765  765  
   - Misses951  956   +5 
   + Partials  108  107   -1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=tree) 
| Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1063/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <0.00%> (ø)` | |
   | 
[api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1063/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==)
 | `50.00% <50.00%> (-7.15%)` | :arrow_down: |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1063/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.48% <88.88%> (+0.26%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=footer).
 Last update 
[0e6e280...8720671](https://codecov.io/gh/apache/apisix-dashboard/pull/1063?src=pr&el=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [apisix] Firstsawyou commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


Firstsawyou commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548793046



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: Since the selection of different upstream in the plugin is based on the 
roundrobin algorithm, the ratio of traffic distribution is not completely 
accurate when the algorithm state is reset.

Review comment:
   updated.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] starsz commented on a change in pull request #2965: feat: use luasocket instead of curl in etcd.lua

2020-12-24 Thread GitBox


starsz commented on a change in pull request #2965:
URL: https://github.com/apache/apisix/pull/2965#discussion_r548792861



##
File path: apisix/cli/etcd.lua
##
@@ -160,31 +163,38 @@ function _M.init(env, show_output)
 for index, host in ipairs(yaml_conf.etcd.host) do
 local is_success = true
 
-local token_head = ""
+local errmsg
+local auth_token
 local user = yaml_conf.etcd.user
 local password = yaml_conf.etcd.password
 if user and password then
-local uri_auth = host .. "/v3/auth/authenticate"
+local auth_url = host .. "/v3/auth/authenticate"
 local json_auth = {
 name =  etcd_conf.user,
 password = etcd_conf.password
 }
-local post_json_auth = dkjson.encode(json_auth)
-local cmd_auth = "curl -s " .. uri_auth .. " -X POST -d '" ..
- post_json_auth .. "' --connect-timeout " .. 
timeout
- .. " --max-time " .. timeout * 2 .. " --retry 1 
2>&1"
 
-local res_auth = util.execute_cmd(cmd_auth)
-local body_auth, _, err_auth = dkjson.decode(res_auth)
-if err_auth then
-util.die(cmd_auth, "\n", res_auth)
+local post_json_auth = dkjson.encode(json_auth)
+local response_body = {}
+local _, err = http.request{url = auth_url, method = "POST",
+source = 
ltn12.source.string(post_json_auth),
+sink = ltn12.sink.table(response_body),
+headers = {["Content-Length"] = 
#post_json_auth}}
+-- err is string type
+if err and type(err) == "string" then

Review comment:
   Well. Agree with you.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1116: test: enhance frontend e2e test stability (consumer)

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #1116:
URL: https://github.com/apache/apisix-dashboard/pull/1116#discussion_r548792530



##
File path: web/cypress/integration/consumer/create_and_delete_consumer.spec.js
##
@@ -57,6 +57,8 @@ context('Create and Delete Consumer', () => {
   });
 cy.contains('button', 'Next').click();
 cy.contains('button', 'Submit').click();
+cy.wait(sleepTime)

Review comment:
   ```suggestion
   cy.wait(sleepTime);
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


tokers commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548791147



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: Since the selection of different upstream in the plugin is based on the 
roundrobin algorithm, the ratio of traffic distribution is not completely 
accurate when the algorithm state is reset.

Review comment:
   May change to:
   
   ```
   Note the ratio between each upstream may not so accurate since the drawback 
of weighted round robin algorithm (especially when the wrr state is reset).
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1097: feat: "upstream" i18n

2020-12-24 Thread GitBox


LiteSun commented on a change in pull request #1097:
URL: https://github.com/apache/apisix-dashboard/pull/1097#discussion_r548782425



##
File path: web/src/pages/Upstream/locales/en-US.ts
##
@@ -61,10 +68,12 @@ export default {
   'upstream.step.healthy.checks.successes': 'Successes',
   'upstream.step.input.healthy.checks.successes': 'Please input successes',
   'upstream.step.healthy.checks.http_failures': 'HttpFailures',
+  'upstream.step.healthy.checks.active.create.req_headers': 'Creat 
req_headers',
   'upstream.step.input.healthy.checks.http_failures': 'Please input 
httpFailures',
   'upstream.step.healthy.checks.active.req_headers': 'req_headers',
   'upstream.step.input.healthy.checks.active.req_headers': 'Please input 
req_headers',
   'upstream.step.healthy.checks.passive': 'Passive',
+  'upstream.step.healthy.checks.passive.create.http_statuses': 'Creat 
http_statuses',

Review comment:
   ditto

##
File path: web/src/pages/Upstream/locales/en-US.ts
##
@@ -61,10 +68,12 @@ export default {
   'upstream.step.healthy.checks.successes': 'Successes',
   'upstream.step.input.healthy.checks.successes': 'Please input successes',
   'upstream.step.healthy.checks.http_failures': 'HttpFailures',
+  'upstream.step.healthy.checks.active.create.req_headers': 'Creat 
req_headers',

Review comment:
   ```suggestion
 'upstream.step.healthy.checks.active.create.req_headers': 'Create 
req_headers',
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Firstsawyou commented on a change in pull request #2935: feat: Implement traffic splitting plugin

2020-12-24 Thread GitBox


Firstsawyou commented on a change in pull request #2935:
URL: https://github.com/apache/apisix/pull/2935#discussion_r548790153



##
File path: doc/plugins/traffic-split.md
##
@@ -0,0 +1,409 @@
+
+
+- [中文](../zh-cn/plugins/traffic-split.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+  - [**Grayscale Release**](#grayscale-release)
+  - [**Blue-green Release**](#blue-green-release)
+  - [**Custom Release**](#custom-release)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+The traffic split plugin allows users to incrementally direct percentages of 
traffic between various upstreams.
+
+Note: Since the selection of different upstream in the plugin is based on the 
roundrobin algorithm, the ratio of traffic distribution is not completely 
accurate when the algorithm state is reset.
+
+## Attributes
+
+| Name | Type| Requirement | Default | Valid   | Description   
   |
+|  | --- | --- | --- | --- | 

 |
+| rules.match  | array[object]  | optional| |  | List of 
matching rules. 
   |
+| rules.match.vars | array[array] | optional| |  | A list consisting 
of one or more {var, operator, val} elements, like this: {{var, operator, val}, 
{var, operator, val}, ...}}. For example: {"arg_name", "==", "json"}, which 
means that the current request parameter name is json. The var here is 
consistent with the naming of Nginx internal variables, so request_uri, host, 
etc. can also be used; for the operator part, the currently supported operators 
are ==, ~=, ~~, >, <, in, has and !. For specific usage of operators, please 
see the `operator-list` part of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
+| rules.weighted_upstreams  | array[object] | optional|| | 
List of upstream configuration rules.   
|
+| rules.weighted_upstreams.upstream_id  | string or integer | optional|
 | | The upstream id is bound to the corresponding upstream(not 
currently supported).|
+| rules.weighted_upstreams.upstream   | object | optional| |  | 
Upstream configuration information. 
   |
+| rules.weighted_upstreams.upstream.type | enum | optional| roundrobin  | 
[roundrobin, chash] | roundrobin supports weighted load, chash consistent 
hashing, the two are alternatives.   |
+| rules.weighted_upstreams.upstream.nodes  | object | optional|   |  | 
In the hash table, the key of the internal element is the list of upstream 
machine addresses, in the format of address + Port, where the address part can 
be an IP or a domain name, such as 192.168.1.100:80, foo.com:80, etc. value is 
the weight of the node. In particular, when the weight value is 0, it has 
special meaning, which usually means that the upstream node is invalid and 
never wants to be selected. |
+| rules.weighted_upstreams.upstream.timeout  | object | optional|  15 
|   | Set the timeout period for connecting, sending and receiving messages 
(time unit: second, all default to 15 seconds).  |
+| rules.weighted_upstreams.upstream.pass_host | enum | optional| "pass"  | 
["pass", "node", "rewrite"]  | pass: pass the host requested by the client, 
node: pass the host requested by the client; use the host configured with the 
upstream node, rewrite: rewrite the host with the value configured by the 
upstream_host. |
+| rules.weighted_upstreams.upstream.name  | string | optional|
|   | Identify the upstream service name, usage scenario, etc.  |
+| rules.weighted_upstreams.upstream.upstream_host | string | optional|
|   | Only valid when pass_host is configured as rewrite.|
+| rules.weighted_upstreams.weight | integer | optional| weight = 1   |  | 
The traffic is divided according to the `weight` value, and the roundrobin 
algorithm is used to divide multiple `weight`. |
+
+## How To Enable

Review comment:
   updated.

##
File path: doc/zh-cn/plugins/traffic-split.md
##
@@ -0,0 +1,420 @@
+
+
+- [English](../../plugins/traffic-split.md)
+
+# 目录
+
+- [名字](#名字)
+- [属性](#属性)
+- [如何启用](#如何启用)
+  - [灰度发布](#灰度发布)
+  - [蓝绿发布](#蓝绿发布)
+  - [自定义发布](#自定义发布)
+- [禁用插件](#禁用插件)
+
+## 名字
+
+traffic-split 插件使用户可以逐步引导各个上游之间的流量百分比。
+
+注:由于插件中选择不同上游是根据 roundrobin 算法选择,因此存在算法状态重置的情况下,会对流量分配的比率并不完全精准。
+
+## 属性
+
+| 参数名| 类型  | 可选项 | 默认值 | 有效值 | 描述 |
+|  | - | -- | -- | -- | 
 |
+| rules.match | array[object] | 可选  ||| 匹配规则列表  |
+| rules.match.vars | array[array]   | 可选   |   

  1   2   3   >