Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ docker-clean: ## Try to remove provisioned nodes and assigned network

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


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

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


.PHONY: setup
setup: tools ## Setup the dev environment

setup: tools vendor ## Setup the dev environment

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


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


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


.PHONY: check-sign-release
Expand Down
5 changes: 3 additions & 2 deletions generated/alerting/api_alerting_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions generated/alerting/mocks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package alerting

//go:generate go tool go.uber.org/mock/mockgen -destination=./api_alerting_mocks.go -package=alerting -source ./api_alerting.go AlertingAPI
3 changes: 3 additions & 0 deletions generated/connectors/connectors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package connectors

//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
6 changes: 3 additions & 3 deletions generated/kbapi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ oas_url := https://raw.githubusercontent.com/elastic/kibana/$(github_ref)/oas

.PHONY: all
all: download transform generate ## Fetch, bundle, transform, and generate the API


.PHONY: download
download: oas.yaml ## Download the remote schema

oas.yaml:
oas.yaml:
curl -sSfo oas.yaml "$(oas_url)"

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

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


.PHONY: clean
Expand Down
362 changes: 343 additions & 19 deletions go.mod

Large diffs are not rendered by default.

1,200 changes: 1,150 additions & 50 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions internal/clients/kibana/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func ruleActionsToActionsInner(ruleActions []models.AlertingRuleAction) []alerti
return actions
}

//go:generate go tool go.uber.org/mock/mockgen -destination=./alerting_mocks.go -package=kibana -source ./alerting.go ApiClient
type ApiClient interface {
GetAlertingClient() (alerting.AlertingAPI, error)
SetAlertingAuthContext(context.Context) context.Context
Expand Down
5 changes: 3 additions & 2 deletions internal/clients/kibana/alerting_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions tools/connectors_gen.go

This file was deleted.

Loading
Loading