Skip to content

Commit b1e5e4b

Browse files
authored
Update protos (#647)
* Update protos * Set new server / SDK metadata to their zero values
1 parent f41283c commit b1e5e4b

File tree

41 files changed

+2786
-401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2786
-401
lines changed

core/src/internal_flags.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ impl InternalFlags {
140140
WorkflowTaskCompletedMetadata {
141141
core_used_flags: core_newly_used,
142142
lang_used_flags: lang_newly_used,
143+
sdk_name: "".to_string(),
144+
sdk_version: "".to_string(),
143145
}
144146
}
145147
Self::Disabled => WorkflowTaskCompletedMetadata::default(),
@@ -182,6 +184,8 @@ mod tests {
182184
sdk_metadata: Some(WorkflowTaskCompletedMetadata {
183185
core_used_flags: vec![1],
184186
lang_used_flags: vec![],
187+
sdk_name: "".to_string(),
188+
sdk_version: "".to_string(),
185189
}),
186190
..Default::default()
187191
});
@@ -215,6 +219,8 @@ mod tests {
215219
sdk_metadata: Some(WorkflowTaskCompletedMetadata {
216220
core_used_flags: vec![2],
217221
lang_used_flags: vec![2],
222+
sdk_name: "".to_string(),
223+
sdk_version: "".to_string(),
218224
}),
219225
..Default::default()
220226
});

core/src/worker/client/mocks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub(crate) static DEFAULT_TEST_CAPABILITIES: &Capabilities = &Capabilities {
1818
upsert_memo: true,
1919
eager_workflow_start: true,
2020
sdk_metadata: true,
21+
count_group_by_execution_status: false,
2122
};
2223

2324
#[cfg(test)]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
FROM temporalio/base-ci-builder:1.5.0
2-
WORKDIR /temporal
1+
FROM temporalio/base-ci-builder:1.10.3
2+
WORKDIR /temporal
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/.idea
22
/.gen
3-
/.vscode
3+
/.vscode
4+
/.stamp

sdk-core-protos/protos/api_upstream/Makefile

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,77 @@ GOPATH := $(shell go env GOPATH)
1515
endif
1616

1717
GOBIN := $(if $(shell go env GOBIN),$(shell go env GOBIN),$(GOPATH)/bin)
18-
SHELL := PATH=$(GOBIN):$(PATH) /bin/sh
18+
PATH := $(GOBIN):$(PATH)
19+
STAMPDIR := .stamp
1920

2021
COLOR := "\e[1;36m%s\e[0m\n"
2122

23+
# Only prints output if the exit code is non-zero
24+
define silent_exec
25+
@output=$$($(1) 2>&1); \
26+
status=$$?; \
27+
if [ $$status -ne 0 ]; then \
28+
echo "$$output"; \
29+
fi; \
30+
exit $$status
31+
endef
32+
2233
PROTO_ROOT := .
23-
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto")
34+
PROTO_FILES = $(shell find temporal -name "*.proto")
2435
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))
2536
PROTO_OUT := .gen
26-
PROTO_IMPORTS = -I=$(PROTO_ROOT) -I=$(shell go list -modfile build/go.mod -m -f '{{.Dir}}' github.com/temporalio/gogo-protobuf)/protobuf
37+
PROTO_IMPORTS = \
38+
-I=$(PROTO_ROOT)
39+
PROTO_PATHS = paths=source_relative:$(PROTO_OUT)
2740

2841
$(PROTO_OUT):
2942
mkdir $(PROTO_OUT)
3043

3144
##### Compile proto files for go #####
32-
grpc: buf-lint api-linter buf-breaking gogo-grpc fix-path
45+
grpc: buf-lint api-linter buf-breaking clean go-grpc fix-path
3346

3447
go-grpc: clean $(PROTO_OUT)
3548
printf $(COLOR) "Compile for go-gRPC..."
36-
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --fatal_warnings $(PROTO_IMPORTS) --go_out=plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
37-
38-
gogo-grpc: clean $(PROTO_OUT)
39-
printf $(COLOR) "Compile for gogo-gRPC..."
40-
$(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;)
49+
$(foreach PROTO_DIR,$(PROTO_DIRS),\
50+
protoc --fatal_warnings $(PROTO_IMPORTS) \
51+
--go_out=$(PROTO_PATHS) \
52+
--grpc-gateway_out=allow_patch_feature=false,$(PROTO_PATHS)\
53+
--doc_out=html,index.html,source_relative:$(PROTO_OUT) \
54+
$(PROTO_DIR)*.proto;)
4155

4256
fix-path:
4357
mv -f $(PROTO_OUT)/temporal/api/* $(PROTO_OUT) && rm -rf $(PROTO_OUT)/temporal
4458

4559
##### Plugins & tools #####
46-
grpc-install: gogo-protobuf-install
47-
printf $(COLOR) "Install/update gRPC plugins..."
48-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
49-
50-
gogo-protobuf-install: go-protobuf-install
51-
go install -modfile build/go.mod github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick
52-
53-
go-protobuf-install:
54-
go install github.com/golang/protobuf/protoc-gen-go@v1.5.2
60+
grpc-install:
61+
@printf $(COLOR) "Install/update protoc and plugins..."
62+
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
63+
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
64+
@go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
65+
@go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
5566

5667
api-linter-install:
5768
printf $(COLOR) "Install/update api-linter..."
5869
go install github.com/googleapis/api-linter/cmd/api-linter@v1.32.3
5970

6071
buf-install:
6172
printf $(COLOR) "Install/update buf..."
62-
go install github.com/bufbuild/buf/cmd/buf@v1.6.0
73+
go install github.com/bufbuild/buf/cmd/buf@v1.27.0
6374

6475
##### Linters #####
6576
api-linter:
6677
printf $(COLOR) "Run api-linter..."
67-
api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES)
78+
$(call silent_exec, api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES))
79+
80+
$(STAMPDIR):
81+
mkdir $@
82+
83+
$(STAMPDIR)/buf-mod-prune: $(STAMPDIR) buf.yaml
84+
printf $(COLOR) "Pruning buf module"
85+
buf mod prune
86+
touch $@
6887

69-
buf-lint:
88+
buf-lint: $(STAMPDIR)/buf-mod-prune
7089
printf $(COLOR) "Run buf linter..."
7190
(cd $(PROTO_ROOT) && buf lint)
7291

@@ -77,4 +96,4 @@ buf-breaking:
7796
##### Clean #####
7897
clean:
7998
printf $(COLOR) "Delete generated go files..."
80-
rm -rf $(PROTO_OUT)
99+
rm -rf $(PROTO_OUT) $(BUF_DEPS)
Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
11
- included_paths:
2-
- '**/*.proto'
2+
- "**/*.proto"
33
disabled_rules:
4-
- 'core::0192::has-comments'
4+
- "core::0192::has-comments"
55

66
- included_paths:
7-
- '**/message.proto'
7+
- "**/message.proto"
88
disabled_rules:
9-
- 'core::0122::name-suffix'
10-
- 'core::0123::resource-annotation'
9+
- "core::0122::name-suffix"
10+
- "core::0123::resource-annotation"
1111

1212
- included_paths:
13-
- '**/workflowservice/v1/request_response.proto'
14-
- '**/operatorservice/v1/request_response.proto'
13+
- "**/workflowservice/v1/request_response.proto"
14+
- "**/operatorservice/v1/request_response.proto"
1515
disabled_rules:
16-
- 'core::0122::name-suffix'
17-
- 'core::0131::request-name-required'
18-
- 'core::0131::request-unknown-fields'
19-
- 'core::0132::request-parent-required'
20-
- 'core::0132::request-unknown-fields'
21-
- 'core::0132::response-unknown-fields'
22-
- 'core::0134::request-unknown-fields'
23-
- 'core::0158::request-page-size-field'
24-
- 'core::0158::request-page-token-field'
25-
- 'core::0158::response-next-page-token-field'
26-
- 'core::0158::response-plural-first-field'
27-
- 'core::0158::response-repeated-first-field'
16+
- "core::0122::name-suffix"
17+
- "core::0131::request-name-required"
18+
- "core::0131::request-unknown-fields"
19+
- "core::0132::request-parent-required"
20+
- "core::0132::request-unknown-fields"
21+
- "core::0132::response-unknown-fields"
22+
- "core::0134::request-unknown-fields"
23+
- "core::0158::request-page-size-field"
24+
- "core::0158::request-page-token-field"
25+
- "core::0158::response-next-page-token-field"
26+
- "core::0158::response-plural-first-field"
27+
- "core::0158::response-repeated-first-field"
2828

2929
- included_paths:
30-
- '**/workflowservice/v1/service.proto'
31-
- '**/operatorservice/v1/service.proto'
30+
- "**/workflowservice/v1/service.proto"
31+
- "**/operatorservice/v1/service.proto"
3232
disabled_rules:
33-
- 'core::0127::http-annotation'
34-
- 'core::0131::method-signature'
35-
- 'core::0131::response-message-name'
33+
# We extract specific fields in URL since the gRPC API predates the HTTP API
34+
- "core::0127::resource-name-extraction"
35+
36+
# We do not require specific "Get", "Create", "Update", or "Delete" RPC
37+
# rules just because we happen to use a known RPC name prefix
38+
- "core::0131"
39+
- "core::0133"
40+
- "core::0134"
41+
- "core::0135"
42+
43+
# We don't require HTTP calls to be suffixed with the same name as the gRPC
44+
# name
45+
- "core::0136::http-uri-suffix"
46+
47+
- included_paths:
48+
- "**/operatorservice/v1/service.proto"
49+
disabled_rules:
50+
# Do not require HTTP annotations on OperatorService calls at this time
51+
- "core::0127::http-annotation"
3652

3753
- included_paths:
38-
- 'dependencies/gogoproto/gogo.proto'
54+
- "google/**/*.proto"
3955
disabled_rules:
40-
- 'all'
56+
- "all"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: v1
2+
plugins:
3+
- plugin: buf.build/protocolbuffers/go:v1.31.0
4+
out: ./
5+
opt:
6+
- paths=source_relative
7+
- plugin: buf.build/grpc/go:v1.3.0
8+
out: ./
9+
opt:
10+
- paths=source_relative
11+
- plugin: buf.build/grpc-ecosystem/gateway:v2.18.0
12+
out: ./
13+
opt:
14+
- paths=source_relative
15+
- allow_patch_feature=false
16+
- name: go-helpers
17+
out: ./
18+
path: ["go", "run", "./protoc-gen-go-helpers"]
19+
opt:
20+
- paths=source_relative
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Generated by buf. DO NOT EDIT.
2+
version: v1
3+
deps:
4+
- remote: buf.build
5+
owner: googleapis
6+
repository: googleapis
7+
commit: 28151c0d0a1641bf938a7672c500e01d
8+
- remote: buf.build
9+
owner: grpc-ecosystem
10+
repository: grpc-gateway
11+
commit: 048ae6ff94ca4476b3225904b1078fad
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
version: v1
2+
deps:
3+
- buf.build/grpc-ecosystem/grpc-gateway
4+
build:
5+
excludes:
6+
# Buf won't accept a local dependency on the google protos but we need them
7+
# to run api-linter, so just tell buf it ignore it
8+
- google
29
breaking:
310
use:
411
- WIRE_JSON
12+
ignore:
13+
- google
514
lint:
615
use:
716
- DEFAULT
817
ignore:
9-
- dependencies
18+
- google

sdk-core-protos/protos/api_upstream/build/go.mod

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

0 commit comments

Comments
 (0)