Skip to content

Commit a50b48b

Browse files
authored
Move tools to go.mod managed tools (elastic#1185)
* Move mockgen to a go.mod managed tool * Move oapi-codegen to a go.mod managed tool * Move tfplugindocs to a go.mod managed tool * Move goreleaser to a go.mod managed tool * Remove yaml from tools
1 parent 2200fda commit a50b48b

File tree

13 files changed

+1497
-1738
lines changed

13 files changed

+1497
-1738
lines changed

Makefile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ docker-clean: ## Try to remove provisioned nodes and assigned network
225225

226226
.PHONY: docs-generate
227227
docs-generate: tools ## Generate documentation for the provider
228-
@ $(GOBIN)/tfplugindocs
228+
@ go tool github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
229229

230230

231231
.PHONY: gen
@@ -247,10 +247,6 @@ install: build ## Install built provider into the local terraform cache
247247
.PHONY: tools
248248
tools: $(GOBIN) tools-golangci-lint ## Install useful tools for linting, docs generation and development
249249
@ cd tools && go install github.com/client9/misspell/cmd/misspell
250-
@ cd tools && go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
251-
@ cd tools && go install github.com/goreleaser/goreleaser/v2
252-
@ cd tools && go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen
253-
@ cd tools && go install go.uber.org/mock/mockgen
254250

255251
.PHONY: tools-golangci-lint
256252
tools-golangci-lint: ## Download golangci-lint locally if necessary.
@@ -290,22 +286,21 @@ check-docs: docs-generate ## Check uncommitted changes on docs
290286

291287

292288
.PHONY: setup
293-
setup: tools ## Setup the dev environment
294-
289+
setup: tools vendor ## Setup the dev environment
295290

296291
.PHONY: release-snapshot
297292
release-snapshot: tools ## Make local-only test release to see if it works using "release" command
298-
@ $(GOBIN)/goreleaser release --snapshot --clean
293+
@ go tool github.com/goreleaser/goreleaser/v2 release --snapshot --clean
299294

300295

301296
.PHONY: release-no-publish
302297
release-no-publish: tools check-sign-release ## Make a release without publishing artifacts
303-
@ $(GOBIN)/goreleaser release --skip=publish,announce,validate --parallelism=2
298+
@ go tool github.com/goreleaser/goreleaser/v2 release --skip=publish,announce,validate --parallelism=2
304299

305300

306301
.PHONY: release
307302
release: tools check-sign-release check-publish-release ## Build, sign, and upload your release
308-
@ $(GOBIN)/goreleaser release --clean --parallelism=4
303+
@ go tool github.com/goreleaser/goreleaser/v2 release --clean --parallelism=4
309304

310305

311306
.PHONY: check-sign-release

generated/alerting/api_alerting_mocks.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/alerting/mocks.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package alerting
2+
3+
//go:generate go tool go.uber.org/mock/mockgen -destination=./api_alerting_mocks.go -package=alerting -source ./api_alerting.go AlertingAPI

generated/connectors/connectors.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package connectors
2+
3+
//go:generate go tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -package connectors -o ./connectors.gen.go -generate "types,client" ./bundled.yaml

generated/kbapi/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ oas_url := https://raw.githubusercontent.com/elastic/kibana/$(github_ref)/oas
77

88
.PHONY: all
99
all: download transform generate ## Fetch, bundle, transform, and generate the API
10-
10+
1111

1212
.PHONY: download
1313
download: oas.yaml ## Download the remote schema
1414

15-
oas.yaml:
15+
oas.yaml:
1616
curl -sSfo oas.yaml "$(oas_url)"
1717

1818
.PHONY: transform
@@ -21,7 +21,7 @@ transform: download ## Transform and filter the schema
2121

2222
.PHONY: generate
2323
generate: ## Generate the API
24-
go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 -config oapi-config.yaml ./oas-filtered.yaml
24+
go tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config oapi-config.yaml ./oas-filtered.yaml
2525

2626

2727
.PHONY: clean

go.mod

Lines changed: 337 additions & 13 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 1138 additions & 38 deletions
Large diffs are not rendered by default.

internal/clients/kibana/alerting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func ruleActionsToActionsInner(ruleActions []models.AlertingRuleAction) []alerti
150150
return actions
151151
}
152152

153+
//go:generate go tool go.uber.org/mock/mockgen -destination=./alerting_mocks.go -package=kibana -source ./alerting.go ApiClient
153154
type ApiClient interface {
154155
GetAlertingClient() (alerting.AlertingAPI, error)
155156
SetAlertingAuthContext(context.Context) context.Context

internal/clients/kibana/alerting_mocks.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/connectors_gen.go

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)