Skip to content

Commit 97cc6c2

Browse files
authored
Add fields from extended info to DescribeWorkflow output (#771)
<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> ## What was changed <!-- Describe what has changed in this PR --> Add extended info to the DescribeWorkflow output. ## Why? <!-- Tell your future self why have you made these changes --> Customer request.
1 parent cbf2b52 commit 97cc6c2

1 file changed

Lines changed: 39 additions & 28 deletions

File tree

temporalcli/commands.workflow_view.go

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -102,36 +102,47 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin
102102

103103
cctx.Printer.Println(color.MagentaString("Execution Info:"))
104104
info := resp.WorkflowExecutionInfo
105+
extendedInfo := resp.WorkflowExtendedInfo
105106
_ = cctx.Printer.PrintStructured(struct {
106-
WorkflowId string
107-
RunId string
108-
Type string
109-
Namespace string
110-
TaskQueue string
111-
AssignedBuildId string
112-
StartTime time.Time
113-
CloseTime time.Time `cli:",cardOmitEmpty"`
114-
ExecutionTime time.Time `cli:",cardOmitEmpty"`
115-
Memo map[string]*common.Payload `cli:",cardOmitEmpty"`
116-
SearchAttributes map[string]*common.Payload `cli:",cardOmitEmpty"`
117-
StateTransitionCount int64
118-
HistoryLength int64
119-
HistorySize int64
107+
WorkflowId string
108+
RunId string
109+
Type string
110+
Namespace string
111+
TaskQueue string
112+
AssignedBuildId string
113+
StartTime time.Time
114+
CloseTime time.Time `cli:",cardOmitEmpty"`
115+
ExecutionTime time.Time `cli:",cardOmitEmpty"`
116+
Memo map[string]*common.Payload `cli:",cardOmitEmpty"`
117+
SearchAttributes map[string]*common.Payload `cli:",cardOmitEmpty"`
118+
StateTransitionCount int64
119+
HistoryLength int64
120+
HistorySize int64
121+
ExecutionExpirationTime time.Time `cli:",cardOmitEmpty"`
122+
RunExpirationTime time.Time `cli:",cardOmitEmpty"`
123+
CancelRequested bool
124+
LastResetTime time.Time `cli:",cardOmitEmpty"`
125+
OriginalStartTime time.Time `cli:",cardOmitEmpty"`
120126
}{
121-
WorkflowId: info.Execution.WorkflowId,
122-
RunId: info.Execution.RunId,
123-
Type: info.Type.GetName(),
124-
Namespace: c.Parent.Namespace,
125-
TaskQueue: info.TaskQueue,
126-
AssignedBuildId: info.GetAssignedBuildId(),
127-
StartTime: timestampToTime(info.StartTime),
128-
CloseTime: timestampToTime(info.CloseTime),
129-
ExecutionTime: timestampToTime(info.ExecutionTime),
130-
Memo: info.Memo.GetFields(),
131-
SearchAttributes: info.SearchAttributes.GetIndexedFields(),
132-
StateTransitionCount: info.StateTransitionCount,
133-
HistoryLength: info.HistoryLength,
134-
HistorySize: info.HistorySizeBytes,
127+
WorkflowId: info.Execution.WorkflowId,
128+
RunId: info.Execution.RunId,
129+
Type: info.Type.GetName(),
130+
Namespace: c.Parent.Namespace,
131+
TaskQueue: info.TaskQueue,
132+
AssignedBuildId: info.GetAssignedBuildId(),
133+
StartTime: timestampToTime(info.StartTime),
134+
CloseTime: timestampToTime(info.CloseTime),
135+
ExecutionTime: timestampToTime(info.ExecutionTime),
136+
Memo: info.Memo.GetFields(),
137+
SearchAttributes: info.SearchAttributes.GetIndexedFields(),
138+
StateTransitionCount: info.StateTransitionCount,
139+
HistoryLength: info.HistoryLength,
140+
HistorySize: info.HistorySizeBytes,
141+
ExecutionExpirationTime: timestampToTime(extendedInfo.ExecutionExpirationTime),
142+
RunExpirationTime: timestampToTime(extendedInfo.RunExpirationTime),
143+
CancelRequested: extendedInfo.CancelRequested,
144+
LastResetTime: timestampToTime(extendedInfo.LastResetTime),
145+
OriginalStartTime: timestampToTime(extendedInfo.OriginalStartTime),
135146
}, printer.StructuredOptions{})
136147

137148
staticSummary := resp.GetExecutionConfig().GetUserMetadata().GetSummary()

0 commit comments

Comments
 (0)