Skip to content

Commit

Permalink
Ensure docs can build (#320)
Browse files Browse the repository at this point in the history
* Add google protos. We'll need these for the eventual gogo/protobuf -> google/protobuf transition
* Ensure docs can build as part of local testing
  • Loading branch information
tdeebswihart authored Oct 19, 2023
1 parent 660b52b commit 108b40a
Show file tree
Hide file tree
Showing 14 changed files with 2,319 additions and 51 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define silent_exec
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 = \
Expand All @@ -50,6 +50,7 @@ gogo-grpc: clean $(PROTO_OUT)
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) \
--grpc-gateway_out=allow_patch_feature=false,paths=source_relative:$(PROTO_OUT) \
--doc_out=html,index.html,source_relative:$(PROTO_OUT) \
$(PROTO_DIR)*.proto;)

fix-path:
Expand All @@ -59,6 +60,7 @@ fix-path:
grpc-install: gogo-protobuf-install
printf $(COLOR) "Install/update gRPC plugins..."
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest

gogo-protobuf-install: go-protobuf-install
go install -modfile build/go.mod github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick
Expand Down
62 changes: 31 additions & 31 deletions api-linter.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +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:
# We extract specific fields in URL since the gRPC API predates the HTTP API
- 'core::0127::resource-name-extraction'
- "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'
- "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'
- "core::0136::http-uri-suffix"

- included_paths:
- '**/operatorservice/v1/service.proto'
- "**/operatorservice/v1/service.proto"
disabled_rules:
# Do not require HTTP annotations on OperatorService calls at this time
- 'core::0127::http-annotation'
- "core::0127::http-annotation"

- included_paths:
- 'dependencies/gogoproto/gogo.proto'
- "dependencies/gogoproto/gogo.proto"
disabled_rules:
- 'all'
- "all"
5 changes: 0 additions & 5 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: cc916c31859748a68fd229a3c8d7a2e8
3 changes: 1 addition & 2 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
version: v1
deps:
- buf.build/googleapis/googleapis
breaking:
use:
- WIRE_JSON
Expand All @@ -9,3 +7,4 @@ lint:
- DEFAULT
ignore:
- dependencies
- google
21 changes: 17 additions & 4 deletions build/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,27 @@ go 1.18

require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pseudomuto/protoc-gen-doc v1.5.1
github.com/temporalio/gogo-protobuf v1.22.1
)

require (
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/sprig v2.15.0+incompatible // indirect
github.com/aokoli/goutils v1.0.1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.3.0-java // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.3.3 // indirect
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 // indirect
google.golang.org/grpc v1.33.1 // indirect
gopkg.in/yaml.v2 v2.2.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/huandu/xstrings v1.0.0 // indirect
github.com/imdario/mergo v0.3.4 // indirect
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007 // indirect
github.com/pseudomuto/protokit v0.2.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 108b40a

Please sign in to comment.