Skip to content

Commit 34a5163

Browse files
authored
Remove type prefix from enum values (#275)
1 parent 0d22f81 commit 34a5163

File tree

169 files changed

+2636
-2626
lines changed

Some content is hidden

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

169 files changed

+2636
-2626
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ PROTO_ROOT := proto
9393
# Note: using "shell find" instead of "wildcard" because "wildcard" caches directory structure.
9494
PROTO_DIRS = $(sort $(dir $(shell find $(PROTO_ROOT) -name "*.proto" | grep -v temporal-proto)))
9595
PROTO_SERVICES = $(shell find $(PROTO_ROOT) -name "*service.proto" | grep -v temporal-proto)
96-
PROTO_IMPORT := $(PROTO_ROOT):$(PROTO_ROOT)/temporal-proto:$(GOPATH)/src/github.com/gogo/protobuf/protobuf
96+
PROTO_IMPORT := $(PROTO_ROOT):$(PROTO_ROOT)/temporal-proto:$(GOPATH)/src/github.com/gogo/protobuf:$(GOPATH)/src/github.com/gogo/protobuf/protobuf
9797
PROTO_GEN := .gen/proto
9898

9999
##### Tools #####
@@ -133,7 +133,7 @@ install-proto-submodule:
133133
protoc: $(PROTO_GEN)
134134
@printf $(COLOR) "Build proto files..."
135135
# Run protoc separately for each directory because of different package names.
136-
$(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_GEN) $(PROTO_DIR)*.proto$(NEWLINE))
136+
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --proto_path=$(PROTO_IMPORT) --gogoslick_out=Mprotobuf/google/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mprotobuf/google/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_GEN) $(PROTO_DIR)*.proto$(NEWLINE))
137137

138138
# All gRPC generated service files pathes relative to PROTO_ROOT.
139139
PROTO_GRPC_SERVICES = $(patsubst $(PROTO_GEN)/%,%,$(shell find $(PROTO_GEN) -name "service.pb.go"))

canary/canary.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ func (c *canaryImpl) createNamespace() error {
177177
name := c.canaryNamespace
178178
desc := "Namespace for running cadence canary workflows"
179179
owner := "canary"
180-
return c.canaryClient.createNamespace(name, desc, owner, namespacepb.ArchivalStatusDisabled)
180+
return c.canaryClient.createNamespace(name, desc, owner, namespacepb.ArchivalStatus_Disabled)
181181
}
182182

183183
func (c *canaryImpl) createArchivalNamespace() error {
184184
name := archivalNamespace
185185
desc := "Namespace used by cadence canary workflows to verify archival"
186186
owner := "canary"
187-
archivalStatus := namespacepb.ArchivalStatusEnabled
187+
archivalStatus := namespacepb.ArchivalStatus_Enabled
188188
return c.archivalClient.createNamespace(name, desc, owner, archivalStatus)
189189
}
190190

canary/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type cadenceClient struct {
5050
func (client *cadenceClient) createNamespace(name string, desc string, owner string, archivalStatus namespacepb.ArchivalStatus) error {
5151
emitMetric := true
5252
retention := int32(workflowRetentionDays)
53-
if archivalStatus == namespacepb.ArchivalStatusEnabled {
53+
if archivalStatus == namespacepb.ArchivalStatus_Enabled {
5454
retention = int32(0)
5555
}
5656
req := &workflowservice.RegisterNamespaceRequest{

canary/reset.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ func triggerResetActivity(ctx context.Context, namespace string, baseWE workflow
193193
return workflow.Execution{}, err
194194
}
195195
for _, event := range events {
196-
if event.GetEventType() == eventpb.EventTypeDecisionTaskCompleted {
196+
if event.GetEventType() == eventpb.EventType_DecisionTaskCompleted {
197197
resetEventID = event.GetEventId()
198198
}
199-
if event.GetEventType() == eventpb.EventTypeSignalExternalWorkflowExecutionInitiated {
199+
if event.GetEventType() == eventpb.EventType_SignalExternalWorkflowExecutionInitiated {
200200
seenTrigger = true
201201
break
202202
}
@@ -237,7 +237,7 @@ func verifyResetActivity(ctx context.Context, namespace string, newWE workflow.E
237237
if err != nil {
238238
return err
239239
}
240-
if resp.WorkflowExecutionInfo.GetStatus() == executionpb.WorkflowExecutionStatusRunning || resp.WorkflowExecutionInfo.GetStatus() != executionpb.WorkflowExecutionStatusCompleted {
240+
if resp.WorkflowExecutionInfo.GetStatus() == executionpb.WorkflowExecutionStatus_Running || resp.WorkflowExecutionInfo.GetStatus() != executionpb.WorkflowExecutionStatus_Completed {
241241
return fmt.Errorf("new execution triggered by reset is not completed")
242242
}
243243
return nil

canary/visibility.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func getMyHistory(client cadenceClient, execInfo workflow.Execution, scope tally
129129
defer sw.Stop()
130130

131131
var events []*eventpb.HistoryEvent
132-
iter := client.GetWorkflowHistory(context.Background(), execInfo.ID, execInfo.RunID, false, filterpb.HistoryEventFilterTypeAllEvent)
132+
iter := client.GetWorkflowHistory(context.Background(), execInfo.ID, execInfo.RunID, false, filterpb.HistoryEventFilterType_AllEvent)
133133

134134
for iter.HasNext() {
135135
event, err := iter.Next()

canary/visibilityArchival.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func visibilityArchivalActivity(ctx context.Context, scheduledTimeNanos int64) e
9191
}
9292

9393
if resp.Configuration != nil &&
94-
resp.Configuration.GetVisibilityArchivalStatus() == namespacepb.ArchivalStatusDisabled {
94+
resp.Configuration.GetVisibilityArchivalStatus() == namespacepb.ArchivalStatus_Disabled {
9595
return errors.New("namespace not configured for visibility archival")
9696
}
9797

client/matching/loadbalancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (lb *defaultLoadBalancer) pickPartition(
109109
nPartitions dynamicconfig.IntPropertyFnWithTaskListInfoFilters,
110110
) string {
111111

112-
if forwardedFrom != "" || taskList.GetKind() == tasklistpb.TaskListKindSticky {
112+
if forwardedFrom != "" || taskList.GetKind() == tasklistpb.TaskListKind_Sticky {
113113
return taskList.GetName()
114114
}
115115

common/archiver/archivalMetadata.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func NewDisabledArchvialConfig() ArchivalConfig {
146146
staticClusterStatus: ArchivalDisabled,
147147
dynamicClusterStatus: nil,
148148
enableRead: nil,
149-
namespaceDefaultStatus: namespacepb.ArchivalStatusDisabled,
149+
namespaceDefaultStatus: namespacepb.ArchivalStatus_Disabled,
150150
namespaceDefaultURI: "",
151151
}
152152
}
@@ -206,9 +206,9 @@ func getNamespaceArchivalStatus(str string) (namespacepb.ArchivalStatus, error)
206206
str = strings.TrimSpace(strings.ToLower(str))
207207
switch str {
208208
case "", common.ArchivalDisabled:
209-
return namespacepb.ArchivalStatusDisabled, nil
209+
return namespacepb.ArchivalStatus_Disabled, nil
210210
case common.ArchivalEnabled:
211-
return namespacepb.ArchivalStatusEnabled, nil
211+
return namespacepb.ArchivalStatus_Enabled, nil
212212
}
213-
return namespacepb.ArchivalStatusDisabled, fmt.Errorf("invalid archival status of %v for namespace, valid status are: {\"\", \"disabled\", \"enabled\"}", str)
213+
return namespacepb.ArchivalStatus_Disabled, fmt.Errorf("invalid archival status of %v for namespace, valid status are: {\"\", \"disabled\", \"enabled\"}", str)
214214
}

common/archiver/filestore/queryParser.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ func convertStatusStr(statusStr string) (executionpb.WorkflowExecutionStatus, er
245245
statusStr = strings.ToLower(statusStr)
246246
switch statusStr {
247247
case "completed":
248-
return executionpb.WorkflowExecutionStatusCompleted, nil
248+
return executionpb.WorkflowExecutionStatus_Completed, nil
249249
case "failed":
250-
return executionpb.WorkflowExecutionStatusFailed, nil
250+
return executionpb.WorkflowExecutionStatus_Failed, nil
251251
case "canceled":
252-
return executionpb.WorkflowExecutionStatusCanceled, nil
252+
return executionpb.WorkflowExecutionStatus_Canceled, nil
253253
case "continuedasnew":
254-
return executionpb.WorkflowExecutionStatusContinuedAsNew, nil
254+
return executionpb.WorkflowExecutionStatus_ContinuedAsNew, nil
255255
case "timedout":
256-
return executionpb.WorkflowExecutionStatusTimedOut, nil
256+
return executionpb.WorkflowExecutionStatus_TimedOut, nil
257257
default:
258258
return 0, fmt.Errorf("unknown workflow close status: %s", statusStr)
259259
}

common/archiver/filestore/queryParser_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,21 @@ func (s *queryParserSuite) TestParseCloseStatus() {
151151
query: "ExecutionStatus = \"Completed\"",
152152
expectErr: false,
153153
parsedQuery: &parsedQuery{
154-
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatusCompleted),
154+
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatus_Completed),
155155
},
156156
},
157157
{
158158
query: "ExecutionStatus = 'continuedasnew'",
159159
expectErr: false,
160160
parsedQuery: &parsedQuery{
161-
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatusContinuedAsNew),
161+
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatus_ContinuedAsNew),
162162
},
163163
},
164164
{
165165
query: "ExecutionStatus = 'Failed' and ExecutionStatus = \"Failed\"",
166166
expectErr: false,
167167
parsedQuery: &parsedQuery{
168-
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatusFailed),
168+
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatus_Failed),
169169
},
170170
},
171171
{
@@ -296,7 +296,7 @@ func (s *queryParserSuite) TestParse() {
296296
earliestCloseTime: 2000,
297297
latestCloseTime: 9999,
298298
runID: common.StringPtr("random runID"),
299-
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatusFailed),
299+
status: toWorkflowExecutionStatusPtr(executionpb.WorkflowExecutionStatus_Failed),
300300
},
301301
},
302302
{

0 commit comments

Comments
 (0)