Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go: upgrade to 1.24 #746

Merged
merged 7 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.23"]
name: Lint with Go ${{ matrix.go }}
name: Lint
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
go-version: ">=1.24"
- name: Install dependencies
run: make install/dev
# It duplicates running linter from pre-commit
Expand All @@ -36,7 +33,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.23"]
go: ["1.24"]
os: [ubuntu-latest, windows-latest]
name: Build and test with Go ${{ matrix.go }} on ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -125,7 +122,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ">=1.23"
go-version: ">=1.24"
- name: Setup & build
uses: stateful/runme-action@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To request a new feature you should open an [issue](../../issues/new) and summar
This is an outline of what the workflow for code contributions looks like

- Check the list of open [issues](../../issues). Either assign an existing issue to yourself, or
create a new one that you would like work on and discuss your ideas and use cases.
create a new one that you would like work on and discuss your ideas and use cases.

It is always best to discuss your plans beforehand, to ensure that your contribution is in line with our goals.

Expand Down Expand Up @@ -177,7 +177,7 @@ $ go get -t -u ./...
When you need to upgrade to major versions of your dependencies, it’s prudent to upgrade each dependency one at a time to manage potential breaking changes efficiently. The `gomajor` tool can assist you in listing and upgrading major version dependencies. To list all major version upgrades available for your project, use the following command:

```sh {"id":"01HF7BT3HEQBTBM9SSSK6JMS58"}
$ gomajor list
$ go tool gomajor list
```

### Coverage
Expand Down
70 changes: 31 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ test-docker/run:
-v dev.runme.test-env-gocache:/root/.cache/go-build \
runme-test-env:latest

.PHONY: test/update-snapshots
test/update-snapshots:
@TZ=UTC UPDATE_SNAPSHOTS=true go test ./...
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted, because I could not find any reference to it.


.PHONY: test/parser
test/parser:
./runme --version
Expand All @@ -93,10 +89,18 @@ test/coverage/html:
test/coverage/func:
go tool cover -func=cover.out

.PHONY: install/dev
install/dev:
@# Most of the tools got moved to go.mod, but this is used in buf.gen.yaml.
@# Remove when buf starts respecting binaries from provided by "go tool".
go install github.com/stateful/go-proto-gql/protoc-gen-gql@latest
@# Does not work with "go tool".
go install gvisor.dev/gvisor/tools/checklocks/cmd/checklocks@go

.PHONY: fmt
fmt:
@gofumpt -w .
@goimports -local="github.com/stateful/runme" -w -l .
@go tool gofumpt -w .
@go tool goimports -local="github.com/stateful/runme" -w -l .

.PHONY: generate
generate: _generate fmt
Expand All @@ -108,39 +112,23 @@ _generate:
.PHONY: lint
lint:
@# "gofumpt -d ." does not return non-zero exit code if there are changes
@test -z $(shell gofumpt -d .)
test -z $(shell go tool gofumpt -d .)
@# "goimports -d ." does not return non-zero exit code if there are changes
@test -z $(shell goimports -local="github.com/stateful/runme" -l .)
@revive \
test -z $(shell go tool goimports -local="github.com/stateful/runme" -l .)
go tool revive \
-config revive.toml \
-formatter friendly \
-exclude integration/subject/... \
./...
@staticcheck ./...
@gosec -quiet -exclude=G110,G204,G304,G404 -exclude-generated ./...
@go vet -stdmethods=false ./...
@go vet -vettool=$(shell go env GOPATH)/bin/checklocks ./...
go tool staticcheck ./...
go tool gosec -quiet -exclude=G110,G115,G204,G304,G404 -exclude-generated ./...
go vet -stdmethods=false ./...
go vet -vettool=$(shell go env GOPATH)/bin/checklocks ./...

.PHONY: pre-commit
pre-commit: build wasm test lint
pre-commit run --all-files

.PHONY: install/dev
install/dev:
go install github.com/mgechev/[email protected]
go install github.com/securego/gosec/v2/cmd/[email protected]
go install honnef.co/go/tools/cmd/[email protected]
go install mvdan.cc/[email protected]
go install github.com/icholy/[email protected]
go install github.com/stateful/go-proto-gql/protoc-gen-gql@latest
go install github.com/atombender/[email protected]
go install gvisor.dev/gvisor/tools/checklocks/cmd/checklocks@go
go install golang.org/x/tools/cmd/goimports@latest

.PHONY: install/goreleaser
install/goreleaser:
go install github.com/goreleaser/[email protected]

.PHONY: proto/generate
proto/generate: proto/_generate fmt

Expand Down Expand Up @@ -170,13 +158,23 @@ proto/dev/reset:
proto/publish:
@cd ./pkg/api/proto && buf push

.PHONY: schema/generate
schema/generate:
go-jsonschema -t \
.PHONY: config/schema/generate
config/schema/generate:
@go tool go-jsonschema -t \
-p config \
--tags "json,yaml" \
-o internal/config/config_schema.go \
internal/config/config.schema.json
internal/config/config.schema.json

.PHONY: gql/schema/generate
gql/schema/generate:
@go run ./cmd/gqltool/main.go > ./internal/client/graphql/schema/introspection_query_result.json
@npm install --prefix internal/client/graphql/schema
@cd ./internal/client/graphql/schema && npm run convert

.PHONY: install/goreleaser
install/goreleaser:
go install github.com/goreleaser/[email protected]

.PHONY: release
release: install/goreleaser
Expand All @@ -186,9 +184,3 @@ release: install/goreleaser
.PHONY: release/publish
release/publish: install/goreleaser
@goreleaser release

.PHONY: update-gql-schema
update-gql-schema:
@go run ./cmd/gqltool/main.go > ./internal/client/graphql/schema/introspection_query_result.json
@npm install --prefix internal/client/graphql/schema
@cd ./internal/client/graphql/schema && npm run convert
2 changes: 1 addition & 1 deletion docker/runme-test-env.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23-bookworm
FROM golang:1.24-bookworm

LABEL org.opencontainers.image.authors="StatefulHQ <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/stateful/runme"
Expand Down
78 changes: 57 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/stateful/runme/v3

go 1.23
go 1.23.1

toolchain go1.23.2
toolchain go1.24.0

// replace github.com/stateful/godotenv => ../godotenv

Expand All @@ -24,7 +24,7 @@ require (
github.com/gabriel-vasile/mimetype v1.4.8
github.com/go-git/go-billy/v5 v5.6.1
github.com/gobwas/glob v0.2.3
github.com/golang/mock v1.6.0
github.com/golang/mock v1.7.0-rc.1
github.com/google/go-github/v45 v45.2.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/graphql-go/graphql v0.8.1
Expand All @@ -45,61 +45,86 @@ require (
go.uber.org/multierr v1.11.0
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
golang.org/x/oauth2 v0.25.0
golang.org/x/sys v0.29.0
golang.org/x/term v0.28.0
google.golang.org/api v0.216.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422
google.golang.org/protobuf v1.36.2
golang.org/x/sys v0.30.0
golang.org/x/term v0.29.0
google.golang.org/api v0.220.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287
google.golang.org/protobuf v1.36.4
mvdan.cc/sh/v3 v3.10.0
)

require (
cloud.google.com/go/auth v0.14.0 // indirect
cloud.google.com/go v0.118.0 // indirect
cloud.google.com/go/ai v0.8.0 // indirect
cloud.google.com/go/auth v0.14.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
cloud.google.com/go/compute/metadata v0.6.0 // indirect
cloud.google.com/go/iam v1.3.1 // indirect
cloud.google.com/go/longrunning v0.6.4 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/atombender/go-jsonschema v0.16.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bufbuild/protocompile v0.14.1 // indirect
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
github.com/charmbracelet/x/ansi v0.6.0 // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.3 // indirect
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-yaml v1.11.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/generative-ai-go v0.19.0 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/icholy/gomajor v0.13.1 // indirect
github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect
github.com/mgechev/revive v1.7.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mmcloughlin/avo v0.6.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/otiai10/mint v1.6.3 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/sanity-io/litter v1.5.5 // indirect
github.com/securego/gosec/v2 v2.22.1 // indirect
github.com/spf13/afero v1.12.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
gotest.tools/v3 v3.5.1 // indirect
gvisor.dev/gvisor v0.0.0-20250215002057-313350f3e697 // indirect
honnef.co/go/tools v0.6.0 // indirect
mvdan.cc/gofumpt v0.7.0 // indirect
)

require (
Expand All @@ -119,7 +144,7 @@ require (
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
Expand All @@ -132,9 +157,9 @@ require (
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.29.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/tools v0.30.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -160,6 +185,17 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.10.0
go.uber.org/zap v1.27.0
golang.org/x/sync v0.10.0
google.golang.org/grpc v1.69.2
golang.org/x/sync v0.11.0
google.golang.org/grpc v1.70.0
)

tool (
github.com/atombender/go-jsonschema
github.com/icholy/gomajor
github.com/mgechev/revive
github.com/securego/gosec/v2/cmd/gosec
golang.org/x/tools/cmd/goimports
gvisor.dev/gvisor/tools/checklocks/cmd/checklocks
honnef.co/go/tools/cmd/staticcheck
mvdan.cc/gofumpt
)
Loading
Loading