Skip to content

Commit

Permalink
build: pin oapi-gen until toolbox gets 1.21.13
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap committed Sep 24, 2024
1 parent 249c2bb commit b93ebfc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/clients/composer/package.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config client.cfg.yaml openapi.v2.yml
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.3.0

// Generated OpenAPI clients for the Composer service.
package composer
2 changes: 1 addition & 1 deletion internal/clients/content_sources/package.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config client.cfg.yaml content-sources.v1.json
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.3.0

// Generated OpenAPI clients for the Content Sources service.
package content_sources
2 changes: 1 addition & 1 deletion internal/clients/provisioning/package.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config client.cfg.yml provisioning.v1.yml
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.3.0

// Generated OpenAPI clients for the Provisioning service.
package provisioning
2 changes: 1 addition & 1 deletion internal/clients/recommendations/package.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config client.cfg.yml recommendations.v3.json
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.3.0
package recommendations
2 changes: 1 addition & 1 deletion internal/v1/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config server.cfg.yaml api.yaml
//go:generate go run -mod=mod github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.3.0
package v1

import (
Expand Down
8 changes: 5 additions & 3 deletions tools/prepare-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -eux

GO_VERSION=1.21.9
GO_BINARY=$(go env GOPATH)/bin/go$GO_VERSION
OAPI_VERSION=2.3.0


# this is the official way to get a different version of golang
# see https://go.dev/doc/manage-install
Expand All @@ -12,12 +14,12 @@ $GO_BINARY download
# Ensure dev tools are installed
which goimports || $GO_BINARY install golang.org/x/tools/cmd/goimports@latest

# Ensure that all code has been regenerated from its sources
$GO_BINARY generate -mod=mod ./...
# Ensure that all code has been regenerated from its sources with the pinned oapi version
git grep -l "go:generate.*github.com/oapi-codegen/oapi-codegen/v2/cmd/[email protected]"

# ... the code is formatted correctly, ...
goimports -w internal cmd
$GO_BINARY fmt -mod=mod ./internal/... ./cmd/...
$GO_BINARY fmt -mod=vendor ./internal/... ./cmd/...

# ... and that go.mod and go.sum are up to date.
$GO_BINARY mod tidy
Expand Down

0 comments on commit b93ebfc

Please sign in to comment.