-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update protos * Set new server / SDK metadata to their zero values
- Loading branch information
1 parent
f41283c
commit b1e5e4b
Showing
41 changed files
with
2,786 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
FROM temporalio/base-ci-builder:1.5.0 | ||
WORKDIR /temporal | ||
FROM temporalio/base-ci-builder:1.10.3 | ||
WORKDIR /temporal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.idea | ||
/.gen | ||
/.vscode | ||
/.vscode | ||
/.stamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,58 +15,77 @@ GOPATH := $(shell go env GOPATH) | |
endif | ||
|
||
GOBIN := $(if $(shell go env GOBIN),$(shell go env GOBIN),$(GOPATH)/bin) | ||
SHELL := PATH=$(GOBIN):$(PATH) /bin/sh | ||
PATH := $(GOBIN):$(PATH) | ||
STAMPDIR := .stamp | ||
|
||
COLOR := "\e[1;36m%s\e[0m\n" | ||
|
||
# Only prints output if the exit code is non-zero | ||
define silent_exec | ||
@output=$$($(1) 2>&1); \ | ||
status=$$?; \ | ||
if [ $$status -ne 0 ]; then \ | ||
echo "$$output"; \ | ||
fi; \ | ||
exit $$status | ||
endef | ||
|
||
PROTO_ROOT := . | ||
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto") | ||
PROTO_FILES = $(shell find temporal -name "*.proto") | ||
PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) | ||
PROTO_OUT := .gen | ||
PROTO_IMPORTS = -I=$(PROTO_ROOT) -I=$(shell go list -modfile build/go.mod -m -f '{{.Dir}}' github.com/temporalio/gogo-protobuf)/protobuf | ||
PROTO_IMPORTS = \ | ||
-I=$(PROTO_ROOT) | ||
PROTO_PATHS = paths=source_relative:$(PROTO_OUT) | ||
|
||
$(PROTO_OUT): | ||
mkdir $(PROTO_OUT) | ||
|
||
##### Compile proto files for go ##### | ||
grpc: buf-lint api-linter buf-breaking gogo-grpc fix-path | ||
grpc: buf-lint api-linter buf-breaking clean go-grpc fix-path | ||
|
||
go-grpc: clean $(PROTO_OUT) | ||
printf $(COLOR) "Compile for go-gRPC..." | ||
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --fatal_warnings $(PROTO_IMPORTS) --go_out=plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;) | ||
|
||
gogo-grpc: clean $(PROTO_OUT) | ||
printf $(COLOR) "Compile for gogo-gRPC..." | ||
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --fatal_warnings $(PROTO_IMPORTS) --gogoslick_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;) | ||
$(foreach PROTO_DIR,$(PROTO_DIRS),\ | ||
protoc --fatal_warnings $(PROTO_IMPORTS) \ | ||
--go_out=$(PROTO_PATHS) \ | ||
--grpc-gateway_out=allow_patch_feature=false,$(PROTO_PATHS)\ | ||
--doc_out=html,index.html,source_relative:$(PROTO_OUT) \ | ||
$(PROTO_DIR)*.proto;) | ||
|
||
fix-path: | ||
mv -f $(PROTO_OUT)/temporal/api/* $(PROTO_OUT) && rm -rf $(PROTO_OUT)/temporal | ||
|
||
##### Plugins & tools ##### | ||
grpc-install: gogo-protobuf-install | ||
printf $(COLOR) "Install/update gRPC plugins..." | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
|
||
gogo-protobuf-install: go-protobuf-install | ||
go install -modfile build/go.mod github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick | ||
|
||
go-protobuf-install: | ||
go install github.com/golang/protobuf/[email protected] | ||
grpc-install: | ||
@printf $(COLOR) "Install/update protoc and plugins..." | ||
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
@go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest | ||
@go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest | ||
|
||
api-linter-install: | ||
printf $(COLOR) "Install/update api-linter..." | ||
go install github.com/googleapis/api-linter/cmd/[email protected] | ||
|
||
buf-install: | ||
printf $(COLOR) "Install/update buf..." | ||
go install github.com/bufbuild/buf/cmd/buf@v1.6.0 | ||
go install github.com/bufbuild/buf/cmd/buf@v1.27.0 | ||
|
||
##### Linters ##### | ||
api-linter: | ||
printf $(COLOR) "Run api-linter..." | ||
api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES) | ||
$(call silent_exec, api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES)) | ||
|
||
$(STAMPDIR): | ||
mkdir $@ | ||
|
||
$(STAMPDIR)/buf-mod-prune: $(STAMPDIR) buf.yaml | ||
printf $(COLOR) "Pruning buf module" | ||
buf mod prune | ||
touch $@ | ||
|
||
buf-lint: | ||
buf-lint: $(STAMPDIR)/buf-mod-prune | ||
printf $(COLOR) "Run buf linter..." | ||
(cd $(PROTO_ROOT) && buf lint) | ||
|
||
|
@@ -77,4 +96,4 @@ buf-breaking: | |
##### Clean ##### | ||
clean: | ||
printf $(COLOR) "Delete generated go files..." | ||
rm -rf $(PROTO_OUT) | ||
rm -rf $(PROTO_OUT) $(BUF_DEPS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,56 @@ | ||
- included_paths: | ||
- '**/*.proto' | ||
- "**/*.proto" | ||
disabled_rules: | ||
- 'core::0192::has-comments' | ||
- "core::0192::has-comments" | ||
|
||
- included_paths: | ||
- '**/message.proto' | ||
- "**/message.proto" | ||
disabled_rules: | ||
- 'core::0122::name-suffix' | ||
- 'core::0123::resource-annotation' | ||
- "core::0122::name-suffix" | ||
- "core::0123::resource-annotation" | ||
|
||
- included_paths: | ||
- '**/workflowservice/v1/request_response.proto' | ||
- '**/operatorservice/v1/request_response.proto' | ||
- "**/workflowservice/v1/request_response.proto" | ||
- "**/operatorservice/v1/request_response.proto" | ||
disabled_rules: | ||
- 'core::0122::name-suffix' | ||
- 'core::0131::request-name-required' | ||
- 'core::0131::request-unknown-fields' | ||
- 'core::0132::request-parent-required' | ||
- 'core::0132::request-unknown-fields' | ||
- 'core::0132::response-unknown-fields' | ||
- 'core::0134::request-unknown-fields' | ||
- 'core::0158::request-page-size-field' | ||
- 'core::0158::request-page-token-field' | ||
- 'core::0158::response-next-page-token-field' | ||
- 'core::0158::response-plural-first-field' | ||
- 'core::0158::response-repeated-first-field' | ||
- "core::0122::name-suffix" | ||
- "core::0131::request-name-required" | ||
- "core::0131::request-unknown-fields" | ||
- "core::0132::request-parent-required" | ||
- "core::0132::request-unknown-fields" | ||
- "core::0132::response-unknown-fields" | ||
- "core::0134::request-unknown-fields" | ||
- "core::0158::request-page-size-field" | ||
- "core::0158::request-page-token-field" | ||
- "core::0158::response-next-page-token-field" | ||
- "core::0158::response-plural-first-field" | ||
- "core::0158::response-repeated-first-field" | ||
|
||
- included_paths: | ||
- '**/workflowservice/v1/service.proto' | ||
- '**/operatorservice/v1/service.proto' | ||
- "**/workflowservice/v1/service.proto" | ||
- "**/operatorservice/v1/service.proto" | ||
disabled_rules: | ||
- 'core::0127::http-annotation' | ||
- 'core::0131::method-signature' | ||
- 'core::0131::response-message-name' | ||
# We extract specific fields in URL since the gRPC API predates the HTTP API | ||
- "core::0127::resource-name-extraction" | ||
|
||
# We do not require specific "Get", "Create", "Update", or "Delete" RPC | ||
# rules just because we happen to use a known RPC name prefix | ||
- "core::0131" | ||
- "core::0133" | ||
- "core::0134" | ||
- "core::0135" | ||
|
||
# We don't require HTTP calls to be suffixed with the same name as the gRPC | ||
# name | ||
- "core::0136::http-uri-suffix" | ||
|
||
- included_paths: | ||
- "**/operatorservice/v1/service.proto" | ||
disabled_rules: | ||
# Do not require HTTP annotations on OperatorService calls at this time | ||
- "core::0127::http-annotation" | ||
|
||
- included_paths: | ||
- 'dependencies/gogoproto/gogo.proto' | ||
- "google/**/*.proto" | ||
disabled_rules: | ||
- 'all' | ||
- "all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: v1 | ||
plugins: | ||
- plugin: buf.build/protocolbuffers/go:v1.31.0 | ||
out: ./ | ||
opt: | ||
- paths=source_relative | ||
- plugin: buf.build/grpc/go:v1.3.0 | ||
out: ./ | ||
opt: | ||
- paths=source_relative | ||
- plugin: buf.build/grpc-ecosystem/gateway:v2.18.0 | ||
out: ./ | ||
opt: | ||
- paths=source_relative | ||
- allow_patch_feature=false | ||
- name: go-helpers | ||
out: ./ | ||
path: ["go", "run", "./protoc-gen-go-helpers"] | ||
opt: | ||
- paths=source_relative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v1 | ||
deps: | ||
- remote: buf.build | ||
owner: googleapis | ||
repository: googleapis | ||
commit: 28151c0d0a1641bf938a7672c500e01d | ||
- remote: buf.build | ||
owner: grpc-ecosystem | ||
repository: grpc-gateway | ||
commit: 048ae6ff94ca4476b3225904b1078fad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
version: v1 | ||
deps: | ||
- buf.build/grpc-ecosystem/grpc-gateway | ||
build: | ||
excludes: | ||
# Buf won't accept a local dependency on the google protos but we need them | ||
# to run api-linter, so just tell buf it ignore it | ||
breaking: | ||
use: | ||
- WIRE_JSON | ||
ignore: | ||
lint: | ||
use: | ||
- DEFAULT | ||
ignore: | ||
- dependencies | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.