Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "submodules/durabletask-protobuf"]
path = submodules/durabletask-protobuf
url = https://github.com/dapr/durabletask-protobuf
branch = main
branch = copilot/rename-protos-to-workflow
22 changes: 11 additions & 11 deletions api/helpers/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func HistoryListSummary(list []*protos.HistoryEvent) string {
return sb.String()
}

func ActionListSummary(actions []*protos.OrchestratorAction) string {
func ActionListSummary(actions []*protos.WorkflowAction) string {
var sb strings.Builder
sb.WriteString("[")
for i, a := range actions {
Expand Down Expand Up @@ -60,9 +60,9 @@ func GetTaskId(e *protos.HistoryEvent) int32 {
return x.TaskScheduledId
} else if x := e.GetTaskFailed(); x != nil {
return x.TaskScheduledId
} else if x := e.GetSubOrchestrationInstanceCompleted(); x != nil {
} else if x := e.GetSubWorkflowInstanceCompleted(); x != nil {
return x.TaskScheduledId
} else if x := e.GetSubOrchestrationInstanceFailed(); x != nil {
} else if x := e.GetSubWorkflowInstanceFailed(); x != nil {
return x.TaskScheduledId
} else if x := e.GetTimerFired(); x != nil {
return x.TimerId
Expand All @@ -73,22 +73,22 @@ func GetTaskId(e *protos.HistoryEvent) int32 {
}
}

func ToRuntimeStatusString(status protos.OrchestrationStatus) string {
name := protos.OrchestrationStatus_name[int32(status)]
return name[len("ORCHESTRATION_STATUS_"):]
func ToRuntimeStatusString(status protos.WorkflowStatus) string {
name := protos.WorkflowStatus_name[int32(status)]
return name[len("WORKFLOW_STATUS_"):]
}

func FromRuntimeStatusString(status string) protos.OrchestrationStatus {
runtimeStatus := "ORCHESTRATION_STATUS_" + status
return protos.OrchestrationStatus(protos.OrchestrationStatus_value[runtimeStatus])
func FromRuntimeStatusString(status string) protos.WorkflowStatus {
runtimeStatus := "WORKFLOW_STATUS_" + status
return protos.WorkflowStatus(protos.WorkflowStatus_value[runtimeStatus])
}

func getHistoryEventTypeName(e *protos.HistoryEvent) string {
// PERFORMANCE: Replace this with a switch statement or a map lookup to avoid this use of reflection
return reflect.TypeOf(e.EventType).Elem().Name()[len("HistoryEvent_"):]
}

func getActionTypeName(a *protos.OrchestratorAction) string {
func getActionTypeName(a *protos.WorkflowAction) string {
// PERFORMANCE: Replace this with a switch statement or a map lookup to avoid this use of reflection
return reflect.TypeOf(a.OrchestratorActionType).Elem().Name()[len("OrchestratorAction_"):]
return reflect.TypeOf(a.WorkflowActionType).Elem().Name()[len("WorkflowAction_"):]
}
2 changes: 1 addition & 1 deletion api/helpers/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func StartNewRunOrchestrationSpan(
ctx context.Context, es *protos.ExecutionStartedEvent, startedTime time.Time,
) (context.Context, trace.Span) {
name := es.Name
instanceID := es.OrchestrationInstance.InstanceId
instanceID := es.WorkflowInstance.InstanceId
version := es.Version.GetValue()
attributes := []attribute.KeyValue{
{Key: "durabletask.type", Value: attribute.StringValue("orchestration")},
Expand Down
2 changes: 1 addition & 1 deletion api/orchestration.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func WithInstanceID(id InstanceID) NewOrchestrationOptions {
func WithOrchestrationIdReusePolicy(policy *protos.OrchestrationIdReusePolicy) NewOrchestrationOptions {
return func(req *protos.CreateInstanceRequest) error {
// initialize CreateInstanceOption
req.OrchestrationIdReusePolicy = &protos.OrchestrationIdReusePolicy{
req.WorkflowIdReusePolicy = &protos.WorkflowIdReusePolicy{
OperationStatus: policy.OperationStatus,
Action: policy.Action,
}
Expand Down
Loading
Loading