diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 74cd92a..d7740be 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -26,3 +26,18 @@ steps: command: - |- make proto-lint + + - label: "thrift compile" + agents: + queue: "buildkite-gcp" + plugins: + - kubernetes: + <<: *kubernetes + podSpec: + <<: *podSpec + containers: + - <<: *commandContainer + command: + - |- + apt-get update && apt-get install -y thrift-compiler + make thriftlint diff --git a/Makefile b/Makefile index b28b741..23f715b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ .DEFAULT_GOAL := all +.PHONY: thriftlint + # M1 macs may need to switch back to x86, until arm releases are available EMULATE_X86 = ifeq ($(shell uname -sm),Darwin arm64) @@ -44,6 +46,8 @@ PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) proto-lint: $(PROTO_FILES) $(BIN)/$(BUF_VERSION_BIN) @$(BIN)/$(BUF_VERSION_BIN) lint +THRIFT_FILES=$(shell find . -name "*.thrift") + # https://www.grpc.io/docs/languages/go/quickstart/ # protoc-gen-gogofast (yarpc) are versioned via tools.go + go.mod (built above) and will be rebuilt as needed. # changing PROTOC_VERSION will automatically download and use the specified version @@ -89,6 +93,14 @@ proto-go: $(PROTO_FILES) $(BIN)/$(PROTOC_VERSION_BIN) $(BIN)/protoc-gen-gogofast @mv $(PROTO_GO_OUT)/uber/cadence/* $(PROTO_GO_OUT) @rm -r $(PROTO_GO_OUT)/uber +thriftlint: + @for file in $(THRIFT_FILES); do \ + if ! thrift --gen go "$$file"; then \ + echo "FAILED: $$file"; \ + exit 1; \ + fi; \ + done + all: proto-lint proto-go # generally not necessary unless we change library versions, but this DOES impact codegen diff --git a/thrift/shared.thrift b/thrift/shared.thrift index b610903..ec0469e 100644 --- a/thrift/shared.thrift +++ b/thrift/shared.thrift @@ -1209,7 +1209,7 @@ struct UpdateDomainResponse { struct FailoverDomainRequest { 10: optional string domainName 20: optional string domainActiveClusterName - // only applicable to active-active domains where + // only applicable to active-active domains where // specific cluster-attributes are being failed over 30: optional ActiveClusters activeClusters } @@ -1262,7 +1262,7 @@ struct FailoverEvent { // Can be passed with the ID to fetch a specific event. 20: optional i64 (js.type = "Long") createdTime 30: optional FailoverType failoverType - 40: optional List clusterFailovers + 40: optional list clusterFailovers } struct ClusterFailover {