From 4aadb4205d0964b95e7915f775281dcc26d64c33 Mon Sep 17 00:00:00 2001 From: Glen Johnson Date: Wed, 25 Jan 2023 17:04:45 -0700 Subject: [PATCH] Upgrade yaml.v3 indirect dependencies and Dockerfile to golang:1.19 --- CHANGELOG.md | 4 ++++ CONTRIBUTING.md | 2 +- Dockerfile | 2 +- Jenkinsfile | 58 +++++++++++++++++++++++++++------------------- bin/test.sh | 2 +- docker-compose.yml | 21 ++++++++++++++++- go.mod | 5 +++- go.sum | 1 - 8 files changed, 65 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 260f1e7..949a738 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [:]:. [cyberark/conjur-api-go#153](https://github.com/cyberark/conjur-api-go/pull/153) +### Security +- Upgrade gopkg.in/yaml.v3 indirect dependencies to v3.0.1 and Dockerfile to golang:1.19.5 + [cyberark/conjur-api-go#158](https://github.com/cyberark/conjur-api-go/pull/158) + ## [0.10.2] - 2022-11-14 ### Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e038df0..27bbed8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ To run the tests against a specific version of Golang, you can run the following This will spin up a containerized Conjur environment and build the test containers, and will run the tests in a `golang:1.17` container -Supported arguments are `1.17` and `1.18`, with the +Supported arguments are `1.17`, `1.18`, and `1.19`, with the default being `1.17` if no argument is given. ### Setting up a development environment diff --git a/Dockerfile b/Dockerfile index 69115a8..51d27a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG FROM_IMAGE="golang:1.17" +ARG FROM_IMAGE="golang:1.19" FROM ${FROM_IMAGE} MAINTAINER Conjur Inc. diff --git a/Jenkinsfile b/Jenkinsfile index eae472f..f7b57d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,32 +20,42 @@ pipeline { } } } + stage('Run Tests') { + parallel { + stage('Run tests: Golang 1.19') { + steps { + sh './bin/test.sh 1.19' + junit 'output/1.19/junit.xml' + } + } - stage('Run tests: Golang 1.18') { - steps { - sh './bin/test.sh 1.18' - junit 'output/1.18/junit.xml' - } - } + stage('Run tests: Golang 1.18') { + steps { + sh './bin/test.sh 1.18' + junit 'output/1.18/junit.xml' + } + } - stage('Run tests: Golang 1.17') { - steps { - sh './bin/test.sh 1.17' - junit 'output/1.17/junit.xml' - cobertura autoUpdateHealth: false, - autoUpdateStability: false, - coberturaReportFile: 'output/1.17/coverage.xml', - conditionalCoverageTargets: '30, 0, 0', - failUnhealthy: true, - failUnstable: false, - lineCoverageTargets: '30, 0, 0', - maxNumberOfBuilds: 0, - methodCoverageTargets: '30, 0, 0', - onlyStable: false, - sourceEncoding: 'ASCII', - zoomCoverageChart: false - sh 'cp output/1.17/c.out .' - ccCoverage("gocov", "--prefix github.com/cyberark/conjur-api-go") + stage('Run tests: Golang 1.17') { + steps { + sh './bin/test.sh 1.17' + junit 'output/1.17/junit.xml' + cobertura autoUpdateHealth: false, + autoUpdateStability: false, + coberturaReportFile: 'output/1.17/coverage.xml', + conditionalCoverageTargets: '30, 0, 0', + failUnhealthy: true, + failUnstable: false, + lineCoverageTargets: '30, 0, 0', + maxNumberOfBuilds: 0, + methodCoverageTargets: '30, 0, 0', + onlyStable: false, + sourceEncoding: 'ASCII', + zoomCoverageChart: false + sh 'cp output/1.17/c.out .' + ccCoverage("gocov", "--prefix github.com/cyberark/conjur-api-go") + } + } } } diff --git a/bin/test.sh b/bin/test.sh index 90f34ed..2aa3ad3 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -24,7 +24,7 @@ failed() { exit 1 } -# Golang container version to use: `1.17` or `1.18` +# Golang container version to use: `1.17`, `1.18`, or `1.19` announce "Running tests for Go version: $GO_VERSION..."; docker-compose run \ -e CONJUR_AUTHN_API_KEY \ diff --git a/docker-compose.yml b/docker-compose.yml index ccde45b..7a0840e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,11 +57,30 @@ services: CONJUR_AUTHN_API_KEY: GO_VERSION: + test-1.19: + build: + context: . + args: + FROM_IMAGE: "golang:1.19" + ports: + - 8080 + depends_on: + - conjur + volumes: + - ./output:/conjur-api-go/output + environment: + CONJUR_DATA_KEY: + CONJUR_APPLIANCE_URL: http://conjur + CONJUR_ACCOUNT: cucumber + CONJUR_AUTHN_LOGIN: admin + CONJUR_AUTHN_API_KEY: + GO_VERSION: + dev: build: context: . args: - FROM_IMAGE: "golang:1.17" + FROM_IMAGE: "golang:1.19" ports: - 8080 depends_on: diff --git a/go.mod b/go.mod index 1c56342..b3ae6a8 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/cyberark/conjur-api-go +go 1.17 + require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d github.com/sirupsen/logrus v1.8.1 @@ -21,4 +23,5 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -go 1.17 +replace gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c => gopkg.in/yaml.v3 v3.0.1 + diff --git a/go.sum b/go.sum index 50271cd..6d1c85a 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,5 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLF gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=