Skip to content

Commit 7a11cce

Browse files
authored
Merge pull request #1578 from acroca/workflow-versioning
Adds support for workflow versioning new types
2 parents dbf9958 + fc11e9c commit 7a11cce

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

pkg/workflow/history.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide
165165
if len(t.ExecutionStarted.Tags) > 0 {
166166
row.addAttr("tags", flatTags(t.ExecutionStarted.Tags, 6))
167167
}
168+
case *protos.HistoryEvent_ExecutionStalled:
169+
row.addAttr("reason", t.ExecutionStalled.GetReason().String())
170+
if t.ExecutionStalled.Description != nil {
171+
row.addAttr("description", trim(wrapperspb.String(t.ExecutionStalled.GetDescription()), 120))
172+
}
168173
case *protos.HistoryEvent_TaskScheduled:
169174
if row.EventID == nil {
170175
row.EventID = ptr.Of(int32(0))
@@ -183,6 +188,16 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide
183188
if t.TaskCompleted.Result != nil {
184189
row.addAttr("output", trim(t.TaskCompleted.Result, 120))
185190
}
191+
case *protos.HistoryEvent_OrchestratorStarted:
192+
if t.OrchestratorStarted.Version != nil {
193+
version := t.OrchestratorStarted.GetVersion()
194+
if version.Name != nil {
195+
row.addAttr("versionName", *version.Name)
196+
}
197+
if len(version.Patches) > 0 {
198+
row.addAttr("versionPatches", strings.Join(version.Patches, ","))
199+
}
200+
}
186201
case *protos.HistoryEvent_SubOrchestrationInstanceCreated:
187202
if t.SubOrchestrationInstanceCreated.Input != nil {
188203
row.addAttr("input", trim(t.SubOrchestrationInstanceCreated.Input, 120))
@@ -291,6 +306,8 @@ func eventTypeName(h *protos.HistoryEvent) string {
291306
return "ExecutionSuspended"
292307
case *protos.HistoryEvent_ExecutionResumed:
293308
return "ExecutionResumed"
309+
case *protos.HistoryEvent_ExecutionStalled:
310+
return "ExecutionStalled"
294311
case *protos.HistoryEvent_EntityOperationSignaled:
295312
return "EntitySignaled"
296313
case *protos.HistoryEvent_EntityOperationCalled:
@@ -346,6 +363,8 @@ func deriveStatus(h *protos.HistoryEvent) string {
346363
return "SUSPENDED"
347364
case *protos.HistoryEvent_ExecutionResumed:
348365
return "RESUMED"
366+
case *protos.HistoryEvent_ExecutionStalled:
367+
return "STALLED"
349368
default:
350369
return "RUNNING"
351370
}

0 commit comments

Comments
 (0)