diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 3bff85a..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Go -on: [push] -jobs: - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Set up Go 1.12 - uses: actions/setup-go@v1 - with: - go-version: 1.12 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v1 - with: - path: src/github.com/target/go-arty - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - mkdir /home/runner/work/go-arty/bin - export GOPATH=/home/runner/work/go-arty - export PATH=$PATH:/home/runner/work/go-arty/bin - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: | - export GOPATH=/home/runner/work/go-arty - go test -v -race ./... - # Check that go vet ./... produces a zero diff; clean up any changes afterwards. - go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) - # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. - go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) - # Check that go generate ./... produces a zero diff; clean up any changes afterwards. - go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7d70a7e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +# name of the action +name: test + +# trigger on pull_request or push events +on: + pull_request: + push: + +# pipeline to execute +jobs: + test: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 + + - name: install + run: | + go get github.com/mattn/goveralls + + - name: test + run: | + go test -covermode=atomic -coverprofile=coverage.out ./... + + - name: coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.out diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..81c1943 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,28 @@ +# name of the action +name: validate + +# trigger on pull_request or push events +on: + pull_request: + push: + +# pipeline to execute +jobs: + validate: + runs-on: ubuntu-latest + container: + image: golang:latest + steps: + - name: clone + uses: actions/checkout@v1 + + - name: validate + run: | + # Check that go mod tidy produces a zero diff; clean up any changes afterwards. + go mod tidy && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # Check that go vet ./... produces a zero diff; clean up any changes afterwards. + go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. + go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # Check that go generate ./... produces a zero diff; clean up any changes afterwards. + go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a8a0a61..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false -language: go -go: - - "1.12.x" -matrix: - allow_failures: - - go: master - fast_finish: true - -before_install: - - go get github.com/mattn/goveralls - - go get github.com/go-playground/overalls - -script: - - go test -v -race ./... - - go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go vet ./... produces a zero diff; clean up any changes afterwards. - - - go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. - - - go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go generate ./... produces a zero diff; clean up any changes afterwards. - - # Generate test coverage report. This must be after all other tests. - - rm -f artifactory/artifactory-accessors.go xray/xray-accessors.go # exclude generated code - - $GOPATH/bin/overalls -project=github.com/target/go-arty -covermode=count - - $GOPATH/bin/goveralls -coverprofile=overalls.coverprofile -service=travis-ci diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 3f83f84..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,122 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:0ef770954bca104ee99b3b6b7f9b240605ac03517d9f98cbc1893daa03f3c038" - name = "github.com/coreos/go-semver" - packages = ["semver"] - pruneopts = "UT" - revision = "8ab6407b697782a06568d4b7f1db25550ec2e4c6" - version = "v0.2.0" - -[[projects]] - digest = "1:0afa63759ae8c5aa13d813346e414e7ed3bde76a98f48b9ebe3272f5a5e2f7ec" - name = "github.com/franela/goblin" - packages = ["."] - pruneopts = "UT" - revision = "cd5d08fb4ede9eaac1812fdb513552e7404eae2e" - -[[projects]] - branch = "master" - digest = "1:36fe9527deed01d2a317617e59304eb2c4ce9f8a24115bcc5c2e37b3aee5bae4" - name = "github.com/gin-contrib/sse" - packages = ["."] - pruneopts = "UT" - revision = "22d885f9ecc78bf4ee5d72b937e4bbcdc58e8cae" - -[[projects]] - digest = "1:489e108f21464371ebf9cb5c30b1eceb07c6dd772dff073919267493dd9d04ea" - name = "github.com/gin-gonic/gin" - packages = [ - ".", - "binding", - "render", - ] - pruneopts = "UT" - revision = "d459835d2b077e44f7c9b453505ee29881d5d12d" - version = "v1.2" - -[[projects]] - digest = "1:15042ad3498153684d09f393bbaec6b216c8eec6d61f63dff711de7d64ed8861" - name = "github.com/golang/protobuf" - packages = ["proto"] - pruneopts = "UT" - revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:a63cff6b5d8b95638bfe300385d93b2a6d9d687734b863da8e09dc834510a690" - name = "github.com/google/go-querystring" - packages = ["query"] - pruneopts = "UT" - revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a" - -[[projects]] - digest = "1:d4d17353dbd05cb52a2a52b7fe1771883b682806f68db442b436294926bbfafb" - name = "github.com/mattn/go-isatty" - packages = ["."] - pruneopts = "UT" - revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" - version = "v0.0.3" - -[[projects]] - digest = "1:94ed228bbfb27fec075be076cf4cc4b44b8f473fac746e051122f2b8793d0f7b" - name = "github.com/tidwall/gjson" - packages = ["."] - pruneopts = "UT" - revision = "01f00f129617a6fe98941fb920d6c760241b54d2" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:d3f968e2a2c9f8506ed44b01b605ade0176ba6cf73ff679073e77cfdef2c0d55" - name = "github.com/tidwall/match" - packages = ["."] - pruneopts = "UT" - revision = "1731857f09b1f38450e2c12409748407822dc6be" - -[[projects]] - digest = "1:03aa6e485e528acb119fb32901cf99582c380225fc7d5a02758e08b180cb56c3" - name = "github.com/ugorji/go" - packages = ["codec"] - pruneopts = "UT" - revision = "b4c50a2b199d93b13dc15e78929cfb23bfdf21ab" - version = "v1.1.1" - -[[projects]] - branch = "master" - digest = "1:fcf2b18db0af0f60d58e71ae8ed15555d46fdca3fc2529f65a14cef30ced981f" - name = "golang.org/x/sys" - packages = ["unix"] - pruneopts = "UT" - revision = "c11f84a56e43e20a78cee75a7c034031ecf57d1f" - -[[projects]] - digest = "1:cbc72c4c4886a918d6ab4b95e347ffe259846260f99ebdd8a198c2331cf2b2e9" - name = "gopkg.in/go-playground/validator.v8" - packages = ["."] - pruneopts = "UT" - revision = "5f1438d3fca68893a817e4a66806cea46a9e4ebf" - version = "v8.18.2" - -[[projects]] - digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "UT" - revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" - version = "v2.2.1" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/coreos/go-semver/semver", - "github.com/franela/goblin", - "github.com/gin-gonic/gin", - "github.com/google/go-querystring/query", - "github.com/tidwall/gjson", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 5cf55b0..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[constraint]] - name = "github.com/coreos/go-semver" - version = "0.2.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/artifactory/client_test.go b/artifactory/client_test.go index e6ce211..ae4edbb 100644 --- a/artifactory/client_test.go +++ b/artifactory/client_test.go @@ -159,7 +159,7 @@ func Test_client(t *testing.T) { options := options{ShowAll: true, Page: 1} _, err := addOptions("!@*&^%%", options) g.Assert(err != nil).IsTrue() - g.Assert(err.Error()).Equal("parse !@*&^%%: invalid URL escape \"%%\"") + g.Assert(err.Error()).Equal("parse \"!@*&^%%\": invalid URL escape \"%%\"") }) g.It("- call addOptions - nil options passed", func() { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..028d505 --- /dev/null +++ b/go.mod @@ -0,0 +1,21 @@ +module github.com/target/go-arty + +go 1.13 + +require ( + github.com/coreos/go-semver v0.2.0 + github.com/franela/goblin v0.0.0-20180407132755-cd5d08fb4ede + github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect + github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07 + github.com/golang/protobuf v1.1.0 // indirect + github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 + github.com/mattn/go-isatty v0.0.3 // indirect + github.com/stretchr/testify v1.5.1 // indirect + github.com/tidwall/gjson v1.1.0 + github.com/tidwall/match v1.0.0 // indirect + github.com/ugorji/go v1.1.1 // indirect + golang.org/x/net v0.0.0-20200301022130-244492dfa37a // indirect + golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect + gopkg.in/go-playground/assert.v1 v1.2.1 // indirect + gopkg.in/go-playground/validator.v8 v8.18.2 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..24442d2 --- /dev/null +++ b/go.sum @@ -0,0 +1,43 @@ +github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/franela/goblin v0.0.0-20180407132755-cd5d08fb4ede h1:7xeyXGhglRmH/zT+5dgsjB5zu/NVJgZn4WrIB9vYcFE= +github.com/franela/goblin v0.0.0-20180407132755-cd5d08fb4ede/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 h1:AzN37oI0cOS+cougNAV9szl6CVoj2RYwzS3DpUQNtlY= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07 h1:Gm6bjW5SQ/sIib9Zcgyyw5chSE6SLcgVZIflI0qGI6s= +github.com/gin-gonic/gin v1.1.5-0.20170702092826-d459835d2b07/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/golang/protobuf v1.1.0 h1:0iH4Ffd/meGoXqF2lSAhZHt8X+cPgkfn/cb6Cce5Vpc= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tidwall/gjson v1.1.0 h1:/7OBSUzFP8NhuzLlHg0vETJrRL02C++0ql5uSY3DITs= +github.com/tidwall/gjson v1.1.0/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA= +github.com/tidwall/match v1.0.0 h1:Ym1EcFkp+UQ4ptxfWlW+iMdq5cPH5nEuGzdf/Pb7VmI= +github.com/tidwall/match v1.0.0/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/ugorji/go v1.1.1 h1:gmervu+jDMvXTbcHQ0pd2wee85nEoE0BsVyEuzkfK8w= +github.com/ugorji/go v1.1.1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=