Skip to content

Commit

Permalink
Chore/go version 1 23 (#862)
Browse files Browse the repository at this point in the history
* chore: upgrade go version to 1.23

* chore: update all direct dependencies

* chore: rm vendor dir from repo

* chore: revert hcl pkg update; needs work due to custom things

* update changelog /w go update

* ci: add go mod download calls to pipeline

* Change test command to pkg loop due to test output streaming issue

See golang/go#46959

* test: rm obsolete wait for port from NewRun test
  • Loading branch information
malud authored Feb 1, 2025
1 parent 17d6bee commit 3156b16
Show file tree
Hide file tree
Showing 2,103 changed files with 171 additions and 637,694 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Set up Go 1.x in order to write go.list file
uses: actions/[email protected]

- name: Dependencies
run: go mod download

- name: WriteGoList
run: go list -json -mod=readonly -m all > go.list

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: '1.22'
go-version: '1.23'
id: go
- run: go version

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/go-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: '1.22'
go-version: '1.23'
- uses: actions/checkout@v4
- name: Dependencies
run: go mod download
- name: 'test & report'
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: '1.22'
go-version: '1.23'
id: go
- run: go version

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Dependencies
run: go mod download

- name: Source-Code formatting
run: test -z $(go fmt ./...)

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: '1.22'
goversion: '1.23'
binary_name: 'couper'
ldflags: '-X ${{ env.VERSION_PACKAGE }}.VersionName=${{ github.ref_name }} -X ${{ env.VERSION_PACKAGE }}.BuildName=${{ steps.vars.outputs.sha_short }} -X ${{ env.VERSION_PACKAGE }}.BuildDate=${{ steps.vars.outputs.build_date }}'
sha256sum: true
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: '1.22'
go-version: '1.23'
- name: 'install assets-uploader'
run: go install github.com/wangyoucao577/assets-uploader/[email protected]
- name: 'upload signed binary archive'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: '1.22'
go-version: '1.23'
id: go
- run: go version

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*.out

.vscode/settings.json
.idea

#binary
/couper
Expand All @@ -26,3 +27,5 @@ docs/website/.vite
# tls
/*.crt
/*.key

vendor
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

Unreleased changes are available as `coupergateway/couper:edge` container.

* **Dependencies**
* build with go 1.23 ([#862](https://github.com/coupergateway/couper/pull/862))

---

## [1.13.0](https://github.com/coupergateway/couper/releases/tag/v1.13.0)
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder

WORKDIR /go/src/app
COPY . .

ENV GOFLAGS="-mod=vendor" \
VERSION_PACKAGE="github.com/coupergateway/couper/utils"

RUN go mod download

RUN go generate && \
CGO_ENABLED=0 go build -v \
-ldflags "-X ${VERSION_PACKAGE}.VersionName=`git describe --tags --abbrev=0 --exact-match || git symbolic-ref -q --short HEAD` -X ${VERSION_PACKAGE}.BuildName=`git rev-parse --short HEAD` -X ${VERSION_PACKAGE}.BuildDate=`date +'%F'`" \
Expand Down
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: docker-telemetry build generate image
.PHONY: test test-docker coverage test-coverage convert-test-coverage test-coverage-show

GO_VERSION := 1.22
GO_VERSION := 1.23

build:
go build -race -v -o couper main.go
Expand All @@ -25,7 +25,19 @@ image:
docker build -t coupergateway/couper:latest .

test:
go test -v -short -race -count 1 -timeout 300s ./...
@echo "Running tests..."
@for PACKAGE in $$(go list ./...); do \
echo "Testing $$PACKAGE"; \
if go test -v -timeout 90s -race -count=1 $$PACKAGE; then \
echo "\033[32m✔ $$PACKAGE PASSED\033[0m"; \
else \
echo "\033[31m✖ $$PACKAGE FAILED\033[0m"; \
exit 1; \
fi; \
done
@echo "\033[32m✔ All tests passed!\033[0m"



test-docker:
docker run --rm -v $(CURDIR):/go/app -w /go/app golang:$(GO_VERSION) sh -c "go test -short -count 1 -v -timeout 300s -race ./..."
Expand Down
3 changes: 1 addition & 2 deletions command/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@ func TestNewRun(t *testing.T) {
close(resultSettings)
}

ctx, shutdown := context.WithCancel(context.Background())
ctx, shutdown := context.WithTimeout(context.Background(), 22*time.Second) // fail fast for port binds
defer func() {
n := time.Now()
shutdown()
test.WaitForClosedPort(8080)
subT.Log("shutdown duration: " + time.Since(n).String())
RunCmdTestCallback = nil
RunCmdConfigTestCallback = nil
Expand Down
84 changes: 42 additions & 42 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
module github.com/coupergateway/couper

go 1.22
go 1.23

require (
github.com/docker/go-units v0.5.0
github.com/fatih/color v1.13.0
github.com/getkin/kin-openapi v0.126.0
github.com/fatih/color v1.18.0
github.com/getkin/kin-openapi v0.128.0
github.com/hashicorp/hcl/v2 v2.12.0
github.com/jimlambrt/go-oauth-pkce-code-verifier v0.0.0-20201220003123-6363600dffda
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_model v0.5.0
github.com/rs/xid v1.5.0
github.com/russellhaering/gosaml2 v0.9.0
github.com/russellhaering/goxmldsig v1.2.0
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/client_model v0.6.1
github.com/rs/xid v1.6.0
github.com/russellhaering/gosaml2 v0.9.1
github.com/russellhaering/goxmldsig v1.4.0
github.com/sirupsen/logrus v1.9.3
github.com/zclconf/go-cty v1.12.1
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/exporters/prometheus v0.44.0
go.opentelemetry.io/otel/metric v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/sdk/metric v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
golang.org/x/crypto v0.21.0
golang.org/x/net v0.23.0
google.golang.org/grpc v1.59.0
github.com/zclconf/go-cty v1.16.2
go.opentelemetry.io/otel v1.34.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0
go.opentelemetry.io/otel/exporters/prometheus v0.56.0
go.opentelemetry.io/otel/metric v1.34.0
go.opentelemetry.io/otel/sdk v1.34.0
go.opentelemetry.io/otel/sdk/metric v1.34.0
go.opentelemetry.io/otel/trace v1.34.0
golang.org/x/crypto v0.32.0
golang.org/x/net v0.34.0
google.golang.org/grpc v1.69.4
)

require (
github.com/algolia/algoliasearch-client-go/v3 v3.26.0
github.com/algolia/algoliasearch-client-go/v3 v3.31.4
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
go.uber.org/automaxprocs v1.5.3
go.uber.org/automaxprocs v1.6.0
)

require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/beevik/etree v1.1.0 // indirect
github.com/beevik/etree v1.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.0 // indirect
github.com/invopop/yaml v0.3.1 // indirect
github.com/jonboulle/clockwork v0.3.0 // indirect
github.com/jonboulle/clockwork v0.5.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattermost/xml-roundtrip-validator v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.33.0 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250122153221-138b5a5a4fd4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
Loading

0 comments on commit 3156b16

Please sign in to comment.