Skip to content

Commit 4888bc3

Browse files
authored
Move all proto files to temporal package (#54)
1 parent 59d1cce commit 4888bc3

File tree

24 files changed

+338
-331
lines changed

24 files changed

+338
-331
lines changed

Diff for: Makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ GOPATH := $(shell go env GOPATH)
88
endif
99

1010
PROTO_ROOT := .
11-
# List only subdirectories with *.proto files. Sort to remove duplicates.
12-
PROTO_DIRS = $(sort $(dir $(wildcard $(PROTO_ROOT)/*/*/*.proto)))
13-
PROTO_SERVICES = $(wildcard $(PROTO_ROOT)/*/service.proto)
11+
PROTO_DIRS = $(shell find $(PROTO_ROOT) -name "*.proto" -printf "%h\n" | sort -u)
1412
PROTO_OUT := .gen
1513
PROTO_IMPORT := $(PROTO_ROOT):$(GOPATH)/src/github.com/temporalio/gogo-protobuf/protobuf
1614

@@ -23,15 +21,18 @@ $(PROTO_OUT):
2321

2422
# Compile proto files to go
2523

26-
grpc: go-grpc gogo-grpc
24+
grpc: gogo-grpc fix-path
2725

2826
go-grpc: clean $(PROTO_OUT)
2927
echo "Compiling for go-gRPC..."
30-
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --proto_path=$(PROTO_IMPORT) --go_out=plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
28+
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --proto_path=$(PROTO_IMPORT) --go_out=plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)/*.proto;)
3129

3230
gogo-grpc: clean $(PROTO_OUT)
3331
echo "Compiling for gogo-gRPC..."
34-
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --proto_path=$(PROTO_IMPORT) --gogoslick_out=Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
32+
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --proto_path=$(PROTO_IMPORT) --gogoslick_out=Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)/*.proto;)
33+
34+
fix-path:
35+
mv -f $(PROTO_OUT)/temporal/* $(PROTO_OUT) && rm -d $(PROTO_OUT)/temporal
3536

3637
# Plugins & tools
3738

Diff for: buf.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build:
2+
roots:
3+
- .
4+
lint:
5+
use:
6+
- DEFAULT

Diff for: common/v1/message.proto renamed to temporal/common/v1/message.proto

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222

2323
syntax = "proto3";
2424

25-
package common.v1;
25+
package temporal.common.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/common/v1;common";
2828
option java_package = "io.temporal.proto.common.v1";
2929
option java_multiple_files = true;
3030
option java_outer_classname = "MessageProto";
3131

32-
import "enums/v1/common.proto";
32+
import "temporal/enums/v1/common.proto";
3333

3434
message DataBlob {
35-
enums.v1.EncodingType encoding_type = 1;
35+
temporal.enums.v1.EncodingType encoding_type = 1;
3636
bytes data = 2;
3737
}
3838

Diff for: decision/v1/message.proto renamed to temporal/decision/v1/message.proto

+40-40
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222

2323
syntax = "proto3";
2424

25-
package decision.v1;
25+
package temporal.decision.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/decision/v1;decision";
2828
option java_package = "io.temporal.proto.decision.v1";
2929
option java_multiple_files = true;
3030
option java_outer_classname = "MessageProto";
3131

32-
import "enums/v1/workflow.proto";
33-
import "enums/v1/decision_type.proto";
34-
import "common/v1/message.proto";
35-
import "failure/v1/message.proto";
36-
import "tasklist/v1/message.proto";
32+
import "temporal/enums/v1/workflow.proto";
33+
import "temporal/enums/v1/decision_type.proto";
34+
import "temporal/common/v1/message.proto";
35+
import "temporal/failure/v1/message.proto";
36+
import "temporal/tasklist/v1/message.proto";
3737

3838
message ScheduleActivityTaskDecisionAttributes {
3939
string activity_id = 1;
40-
common.v1.ActivityType activity_type = 2;
40+
temporal.common.v1.ActivityType activity_type = 2;
4141
string namespace = 3;
42-
tasklist.v1.TaskList task_list = 4;
43-
common.v1.Header header = 5;
44-
common.v1.Payloads input = 6;
42+
temporal.tasklist.v1.TaskList task_list = 4;
43+
temporal.common.v1.Header header = 5;
44+
temporal.common.v1.Payloads input = 6;
4545
// Indicates how long the caller is willing to wait for an activity completion.
4646
// Limits for how long retries are happening. Either this or startToCloseTimeoutSeconds is required.
4747
// When not specified defaults to the workflow execution timeout.
@@ -59,7 +59,7 @@ message ScheduleActivityTaskDecisionAttributes {
5959
// Activity retry policy. Note that activity is retried by default according to a default retry policy.
6060
// To disable retries provide a retry policy with maximumAttempts equals to 1.
6161
// The retries happen up to scheduleToCloseTimeout.
62-
common.v1.RetryPolicy retry_policy = 11;
62+
temporal.common.v1.RetryPolicy retry_policy = 11;
6363
}
6464

6565
message RequestCancelActivityTaskDecisionAttributes {
@@ -72,19 +72,19 @@ message StartTimerDecisionAttributes {
7272
}
7373

7474
message CompleteWorkflowExecutionDecisionAttributes {
75-
common.v1.Payloads result = 1;
75+
temporal.common.v1.Payloads result = 1;
7676
}
7777

7878
message FailWorkflowExecutionDecisionAttributes {
79-
failure.v1.Failure failure = 1;
79+
temporal.failure.v1.Failure failure = 1;
8080
}
8181

8282
message CancelTimerDecisionAttributes {
8383
string timer_id = 1;
8484
}
8585

8686
message CancelWorkflowExecutionDecisionAttributes {
87-
common.v1.Payloads details = 1;
87+
temporal.common.v1.Payloads details = 1;
8888
}
8989

9090
message RequestCancelExternalWorkflowExecutionDecisionAttributes {
@@ -97,68 +97,68 @@ message RequestCancelExternalWorkflowExecutionDecisionAttributes {
9797

9898
message SignalExternalWorkflowExecutionDecisionAttributes {
9999
string namespace = 1;
100-
common.v1.WorkflowExecution execution = 2;
100+
temporal.common.v1.WorkflowExecution execution = 2;
101101
string signal_name = 3;
102-
common.v1.Payloads input = 4;
102+
temporal.common.v1.Payloads input = 4;
103103
string control = 5;
104104
bool child_workflow_only = 6;
105105
}
106106

107107
message UpsertWorkflowSearchAttributesDecisionAttributes {
108-
common.v1.SearchAttributes search_attributes = 1;
108+
temporal.common.v1.SearchAttributes search_attributes = 1;
109109
}
110110

111111
message RecordMarkerDecisionAttributes {
112112
string marker_name = 1;
113-
map<string, common.v1.Payloads> details = 2;
114-
common.v1.Header header = 3;
115-
failure.v1.Failure failure = 4;
113+
map<string, temporal.common.v1.Payloads> details = 2;
114+
temporal.common.v1.Header header = 3;
115+
temporal.failure.v1.Failure failure = 4;
116116
}
117117

118118
message ContinueAsNewWorkflowExecutionDecisionAttributes {
119-
common.v1.WorkflowType workflow_type = 1;
120-
tasklist.v1.TaskList task_list = 2;
121-
common.v1.Payloads input = 3;
119+
temporal.common.v1.WorkflowType workflow_type = 1;
120+
temporal.tasklist.v1.TaskList task_list = 2;
121+
temporal.common.v1.Payloads input = 3;
122122
// workflowExecutionTimeout is omitted as it shouldn'be overridden from within a workflow
123123
// Timeout of a single workflow run
124124
int32 workflow_run_timeout_seconds = 4;
125125
// Timeout of a single workflow task
126126
int32 workflow_task_timeout_seconds = 5;
127127
int32 backoff_start_interval_in_seconds = 6;
128-
common.v1.RetryPolicy retry_policy = 7;
129-
enums.v1.ContinueAsNewInitiator initiator = 8;
130-
failure.v1.Failure failure = 9;
131-
common.v1.Payloads last_completion_result = 10;
128+
temporal.common.v1.RetryPolicy retry_policy = 7;
129+
temporal.enums.v1.ContinueAsNewInitiator initiator = 8;
130+
temporal.failure.v1.Failure failure = 9;
131+
temporal.common.v1.Payloads last_completion_result = 10;
132132
string cron_schedule = 11;
133-
common.v1.Header header = 12;
134-
common.v1.Memo memo = 13;
135-
common.v1.SearchAttributes search_attributes = 14;
133+
temporal.common.v1.Header header = 12;
134+
temporal.common.v1.Memo memo = 13;
135+
temporal.common.v1.SearchAttributes search_attributes = 14;
136136
}
137137

138138
message StartChildWorkflowExecutionDecisionAttributes {
139139
string namespace = 1;
140140
string workflow_id = 2;
141-
common.v1.WorkflowType workflow_type = 3;
142-
tasklist.v1.TaskList task_list = 4;
143-
common.v1.Payloads input = 5;
141+
temporal.common.v1.WorkflowType workflow_type = 3;
142+
temporal.tasklist.v1.TaskList task_list = 4;
143+
temporal.common.v1.Payloads input = 5;
144144
// Total workflow execution timeout including retries and continue as new
145145
int32 workflow_execution_timeout_seconds = 6;
146146
// Timeout of a single workflow run
147147
int32 workflow_run_timeout_seconds = 7;
148148
// Timeout of a single workflow task
149149
int32 workflow_task_timeout_seconds = 8;
150-
enums.v1.ParentClosePolicy parent_close_policy = 9;
150+
temporal.enums.v1.ParentClosePolicy parent_close_policy = 9;
151151
string control = 10;
152-
enums.v1.WorkflowIdReusePolicy workflow_id_reuse_policy = 11;
153-
common.v1.RetryPolicy retry_policy = 12;
152+
temporal.enums.v1.WorkflowIdReusePolicy workflow_id_reuse_policy = 11;
153+
temporal.common.v1.RetryPolicy retry_policy = 12;
154154
string cron_schedule = 13;
155-
common.v1.Header header = 14;
156-
common.v1.Memo memo = 15;
157-
common.v1.SearchAttributes search_attributes = 16;
155+
temporal.common.v1.Header header = 14;
156+
temporal.common.v1.Memo memo = 15;
157+
temporal.common.v1.SearchAttributes search_attributes = 16;
158158
}
159159

160160
message Decision {
161-
enums.v1.DecisionType decision_type = 1;
161+
temporal.enums.v1.DecisionType decision_type = 1;
162162
oneof attributes {
163163
ScheduleActivityTaskDecisionAttributes schedule_activity_task_decision_attributes = 2;
164164
StartTimerDecisionAttributes start_timer_decision_attributes = 3;

Diff for: enums/v1/common.proto renamed to temporal/enums/v1/common.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/decision_type.proto renamed to temporal/enums/v1/decision_type.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/event_type.proto renamed to temporal/enums/v1/event_type.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/failed_cause.proto renamed to temporal/enums/v1/failed_cause.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/namespace.proto renamed to temporal/enums/v1/namespace.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/query.proto renamed to temporal/enums/v1/query.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/task_list.proto renamed to temporal/enums/v1/task_list.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: enums/v1/workflow.proto renamed to temporal/enums/v1/workflow.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
syntax = "proto3";
2424

25-
package enums.v1;
25+
package temporal.enums.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/enums/v1;enums";
2828
option java_package = "io.temporal.proto.enums.v1";

Diff for: errordetails/v1/message.proto renamed to temporal/errordetails/v1/message.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ syntax = "proto3";
2424

2525
// These error details extend failures defined in https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
2626

27-
package errordetails.v1;
27+
package temporal.errordetails.v1;
2828

2929
option go_package = "go.temporal.io/temporal-proto/errordetails/v1;errordetails";
3030
option java_package = "io.temporal.proto.errordetails.v1";

Diff for: failure/v1/message.proto renamed to temporal/failure/v1/message.proto

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@
2222

2323
syntax = "proto3";
2424

25-
package failure.v1;
25+
package temporal.failure.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/failure/v1;failure";
2828
option java_package = "io.temporal.proto.failure.v1";
2929
option java_multiple_files = true;
3030
option java_outer_classname = "MessageProto";
3131

32-
import "common/v1/message.proto";
33-
import "enums/v1/workflow.proto";
32+
import "temporal/common/v1/message.proto";
33+
import "temporal/enums/v1/workflow.proto";
3434

3535
message ApplicationFailureInfo {
3636
string type = 1;
3737
bool non_retryable = 2;
38-
common.v1.Payloads details = 3;
38+
temporal.common.v1.Payloads details = 3;
3939
}
4040

4141
message TimeoutFailureInfo {
42-
enums.v1.TimeoutType timeout_type = 1;
43-
common.v1.Payloads last_heartbeat_details = 2;
42+
temporal.enums.v1.TimeoutType timeout_type = 1;
43+
temporal.common.v1.Payloads last_heartbeat_details = 2;
4444
}
4545

4646
message CanceledFailureInfo {
47-
common.v1.Payloads details = 1;
47+
temporal.common.v1.Payloads details = 1;
4848
}
4949

5050
message TerminatedFailureInfo {
@@ -55,25 +55,25 @@ message ServerFailureInfo {
5555
}
5656

5757
message ResetWorkflowFailureInfo {
58-
common.v1.Payloads last_heartbeat_details = 1;
58+
temporal.common.v1.Payloads last_heartbeat_details = 1;
5959
}
6060

6161
message ActivityFailureInfo {
6262
int64 scheduled_event_id = 1;
6363
int64 started_event_id = 2;
6464
string identity = 3;
65-
common.v1.ActivityType activity_type = 4;
65+
temporal.common.v1.ActivityType activity_type = 4;
6666
string activity_id = 5;
67-
enums.v1.RetryStatus retry_status = 6;
67+
temporal.enums.v1.RetryStatus retry_status = 6;
6868
}
6969

7070
message ChildWorkflowExecutionFailureInfo {
7171
string namespace = 1;
72-
common.v1.WorkflowExecution workflow_execution = 2;
73-
common.v1.WorkflowType workflow_type = 3;
72+
temporal.common.v1.WorkflowExecution workflow_execution = 2;
73+
temporal.common.v1.WorkflowType workflow_type = 3;
7474
int64 initiated_event_id = 4;
7575
int64 started_event_id = 5;
76-
enums.v1.RetryStatus retry_status = 6;
76+
temporal.enums.v1.RetryStatus retry_status = 6;
7777
}
7878

7979
message Failure {

Diff for: filter/v1/message.proto renamed to temporal/filter/v1/message.proto

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
syntax = "proto3";
2424

25-
package filter.v1;
25+
package temporal.filter.v1;
2626

2727
option go_package = "go.temporal.io/temporal-proto/filter/v1;filter";
2828
option java_package = "io.temporal.proto.filter.v1";
2929
option java_multiple_files = true;
3030
option java_outer_classname = "MessageProto";
3131

32-
import "enums/v1/workflow.proto";
32+
import "temporal/enums/v1/workflow.proto";
3333

3434
message WorkflowExecutionFilter {
3535
string workflow_id = 1;
@@ -46,5 +46,5 @@ message StartTimeFilter {
4646
}
4747

4848
message StatusFilter {
49-
enums.v1.WorkflowExecutionStatus status = 1;
49+
temporal.enums.v1.WorkflowExecutionStatus status = 1;
5050
}

0 commit comments

Comments
 (0)