This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 41b7e5e  migrate travis to action, upgrade go chassis (#138)
41b7e5e is described below

commit 41b7e5edb3b620cd1b45f91f24b52c6c54bbb2bb
Author: Shawn <[email protected]>
AuthorDate: Wed Feb 24 16:42:09 2021 +0800

    migrate travis to action, upgrade go chassis (#138)
---
 .github/workflows/golangci-lint.yml | 19 ++++++++++
 .github/workflows/static_check.yml  | 21 +++++++++++
 .travis.yml                         | 58 ------------------------------
 cmd/mesher/mesher.go                |  2 --
 go.mod                              |  9 ++---
 proxy/control/istio/cache.go        | 26 --------------
 proxy/control/istio/panel.go        | 72 -------------------------------------
 proxy/control/istio/transfer.go     | 49 -------------------------
 8 files changed, 43 insertions(+), 213 deletions(-)

diff --git a/.github/workflows/golangci-lint.yml 
b/.github/workflows/golangci-lint.yml
new file mode 100644
index 0000000..9640ae5
--- /dev/null
+++ b/.github/workflows/golangci-lint.yml
@@ -0,0 +1,19 @@
+name: golangci-lint
+on:
+  push:
+    tags:
+      - v*
+    branches:
+      - master
+  pull_request:
+jobs:
+  golangci:
+    name: lint
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: golangci-lint
+        uses: golangci/golangci-lint-action@v2
+        with:
+          version: v1.29
+          args: --skip-dirs=examples --out-format=colored-line-number 
--skip-files=.*_test.go$
\ No newline at end of file
diff --git a/.github/workflows/static_check.yml 
b/.github/workflows/static_check.yml
new file mode 100644
index 0000000..8200f30
--- /dev/null
+++ b/.github/workflows/static_check.yml
@@ -0,0 +1,21 @@
+name: Merge check
+on: [push, pull_request]
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Set up Go 1.13
+      uses: actions/setup-go@v1
+      with:
+        go-version: 1.13
+      id: go
+
+    - name: Check out code into the Go module directory
+      uses: actions/checkout@v1
+
+    - name: Build
+      run: go build github.com/apache/servicecomb-mesher/cmd/mesher
+
+    - name: UT
+      run: |
+        bash -x scripts/travis/unit_test.sh
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 6a56d3c..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-language: go
-sudo: required
-go:
-  - 1.14.2
-install: true
-
-services:
-  - docker
-
-before_install:
-  - docker pull gomesh/mock-pilot:latest
-  - docker run -d -p 15010:15010 gomesh/mock-pilot:latest
-
-before_script:
-  - mkdir -p $HOME/gopath/src/github.com/apache/servicecomb-mesher
-  - rsync -az ${TRAVIS_BUILD_DIR}/ 
$HOME/gopath/src/github.com/apache/servicecomb-mesher
-  - export 
TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/apache/servicecomb-mesher
-  - export 
KUBE_CONFIG=$HOME/gopath/src/github.com/apache/servicecomb-mesher/tests/util/sample_kubeconfig
-  - cd $HOME/gopath/src/github.com/apache/servicecomb-mesher
-jobs:
-  include:
-    - stage: Format Checker
-      script: bash -x scripts/travis/formatChecker.sh
-    - stage: DeadCode Checker
-      script:
-        - go get -u github.com/tsenart/deadcode
-        - bash -x scripts/travis/deadCodeChecker.sh
-    - stage: Misspell Checker
-      script:
-        - go get -u github.com/client9/misspell
-        - bash -x scripts/travis/misspellChecker.sh
-    - stage: GoConst Checker
-      script:
-        - go get -u github.com/jgautheron/goconst/cmd/goconst
-        - bash -x scripts/travis/goConstChecker.sh
-    - stage: GoLint Checker
-      script:
-        - go get -u golang.org/x/lint/golint
-        - bash -x scripts/travis/goLintChecker.sh
-    - stage: GoCyclo Checker
-      script:
-        - go get github.com/fzipp/gocyclo
-        - bash -x scripts/travis/goCycloChecker.sh
-    - stage: GoSecure Checker
-      script:
-        - go get github.com/securego/gosec/cmd/gosec
-        - bash -x scripts/travis/goSecureChecker.sh
-    - stage: Build
-      script: 
-        - GO111MODULE=on go mod download
-        - go build github.com/apache/servicecomb-mesher/cmd/mesher
-    - stage: Unit Test
-      script:
-        - go get github.com/mattn/goveralls
-        - go get golang.org/x/tools/cmd/cover
-        - GO111MODULE=on go mod download
-        - bash -x scripts/travis/unit_test.sh && $HOME/gopath/bin/goveralls 
-coverprofile=coverage.txt -service=travis-ci
-
diff --git a/cmd/mesher/mesher.go b/cmd/mesher/mesher.go
index afef17f..b44f096 100644
--- a/cmd/mesher/mesher.go
+++ b/cmd/mesher/mesher.go
@@ -35,8 +35,6 @@ import (
 
        _ "github.com/apache/servicecomb-mesher/proxy/pkg/egress/archaius"
 
-       _ "github.com/apache/servicecomb-mesher/proxy/control/istio"
-
        _ "github.com/apache/servicecomb-mesher/proxy/handler/oauth2"
 
        //middle wares
diff --git a/go.mod b/go.mod
index 56703eb..648ab14 100644
--- a/go.mod
+++ b/go.mod
@@ -1,20 +1,17 @@
 module github.com/apache/servicecomb-mesher
 
 require (
-       github.com/envoyproxy/go-control-plane 
v0.9.1-0.20191026205805-5f8ba28d4473
        github.com/ghodss/yaml v1.0.0
        github.com/go-chassis/foundation v0.1.1-0.20200825060850-b16bf420f7b3
-       github.com/go-chassis/go-archaius v1.3.6-0.20200917065837-57a2bca2b7ff
-       github.com/go-chassis/go-chassis/v2 v2.0.3-0.20200917125036-902f9f8fecd2
+       github.com/go-chassis/go-archaius v1.3.6-0.20201103103813-43dd1680ebfb
+       github.com/go-chassis/go-chassis/v2 v2.1.0
        github.com/go-chassis/gohessian v0.0.0-20180702061429-e5130c25af55
        github.com/go-chassis/openlog v1.1.2
-       github.com/gogo/googleapis v1.3.1 // indirect
        github.com/gogo/protobuf v1.3.0
-       github.com/lyft/protoc-gen-validate v0.1.0 // indirect
        github.com/patrickmn/go-cache v2.1.0+incompatible
        github.com/prometheus/client_golang v0.9.1
        github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
-       github.com/stretchr/testify v1.5.1
+       github.com/stretchr/testify v1.6.1
        github.com/tetratelabs/go2sky v0.1.1-0.20190703154722-1eaab8035277
        github.com/urfave/cli v1.20.1-0.20181029213200-b67dcf995b6a
        golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
diff --git a/proxy/control/istio/cache.go b/proxy/control/istio/cache.go
deleted file mode 100644
index 76a3e40..0000000
--- a/proxy/control/istio/cache.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package istio
-
-import "github.com/patrickmn/go-cache"
-
-//save configs
-var (
-       //key is service name
-       EgressConfigCache = cache.New(0, 0)
-)
diff --git a/proxy/control/istio/panel.go b/proxy/control/istio/panel.go
deleted file mode 100644
index f869824..0000000
--- a/proxy/control/istio/panel.go
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package istio
-
-import (
-       meshercontrol "github.com/apache/servicecomb-mesher/proxy/control"
-       "github.com/apache/servicecomb-mesher/proxy/pkg/egress"
-       "github.com/go-chassis/go-chassis/v2/control"
-       "github.com/go-chassis/go-chassis/v2/core/config/model"
-       "github.com/go-chassis/go-chassis/v2/core/invocation"
-       
"github.com/go-chassis/go-chassis/v2/third_party/forked/afex/hystrix-go/hystrix"
-)
-
-func init() {
-       meshercontrol.InstallPlugin("pilot", newPilotPanel)
-}
-
-//PilotPanel pull configs from istio pilot
-type PilotPanel struct {
-}
-
-func newPilotPanel(options meshercontrol.Options) control.Panel {
-       SaveToEgressCache(egress.DefaultEgress.FetchEgressRule())
-       return &PilotPanel{}
-}
-
-//GetEgressRule get egress config
-func (p *PilotPanel) GetEgressRule() []control.EgressConfig {
-       c, ok := EgressConfigCache.Get("")
-       if !ok {
-
-               return nil
-       }
-       return c.([]control.EgressConfig)
-}
-
-//GetCircuitBreaker return command , and circuit breaker settings
-func (p *PilotPanel) GetCircuitBreaker(inv invocation.Invocation, serviceType 
string) (string, hystrix.CommandConfig) {
-       return "", hystrix.CommandConfig{}
-
-}
-
-//GetLoadBalancing get load balancing config
-func (p *PilotPanel) GetLoadBalancing(inv invocation.Invocation) 
control.LoadBalancingConfig {
-       return control.LoadBalancingConfig{}
-
-}
-
-//GetRateLimiting get rate limiting config
-func (p *PilotPanel) GetRateLimiting(inv invocation.Invocation, serviceType 
string) control.RateLimitingConfig {
-       return control.RateLimitingConfig{}
-}
-
-//GetFaultInjection get Fault injection config
-func (p *PilotPanel) GetFaultInjection(inv invocation.Invocation) model.Fault {
-       return model.Fault{}
-}
diff --git a/proxy/control/istio/transfer.go b/proxy/control/istio/transfer.go
deleted file mode 100644
index ed6bd88..0000000
--- a/proxy/control/istio/transfer.go
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package istio
-
-import (
-       "github.com/apache/servicecomb-mesher/proxy/config"
-       "github.com/go-chassis/go-chassis/v2/control"
-)
-
-//SaveToEgressCache save the egress rules in the cache
-func SaveToEgressCache(egressConfigFromPilot map[string][]*config.EgressRule) {
-       {
-               var egressconfig []control.EgressConfig
-               for _, v := range egressConfigFromPilot {
-                       for _, v1 := range v {
-                               var Ports []*control.EgressPort
-                               for _, v2 := range v1.Ports {
-                                       p := control.EgressPort{
-                                               Port:     (*v2).Port,
-                                               Protocol: (*v2).Protocol,
-                                       }
-                                       Ports = append(Ports, &p)
-                               }
-                               c := control.EgressConfig{
-                                       Hosts: v1.Hosts,
-                                       Ports: Ports,
-                               }
-
-                               egressconfig = append(egressconfig, c)
-                       }
-               }
-               EgressConfigCache.Set("", egressconfig, 0)
-       }
-}

Reply via email to