From 6769d2473aa7fc2cbd0e7651e5b11996d034ce08 Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 27 Feb 2025 12:31:39 -0800 Subject: [PATCH 1/2] Add fields from extended info to DescribeWorkflow output --- temporalcli/commands.workflow_view.go | 67 ++++++++++++++++----------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/temporalcli/commands.workflow_view.go b/temporalcli/commands.workflow_view.go index 70c25dda..4f082800 100644 --- a/temporalcli/commands.workflow_view.go +++ b/temporalcli/commands.workflow_view.go @@ -102,36 +102,47 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin cctx.Printer.Println(color.MagentaString("Execution Info:")) info := resp.WorkflowExecutionInfo + extendedInfo := resp.WorkflowExtendedInfo _ = cctx.Printer.PrintStructured(struct { - WorkflowId string - RunId string - Type string - Namespace string - TaskQueue string - AssignedBuildId string - StartTime time.Time - CloseTime time.Time `cli:",cardOmitEmpty"` - ExecutionTime time.Time `cli:",cardOmitEmpty"` - Memo map[string]*common.Payload `cli:",cardOmitEmpty"` - SearchAttributes map[string]*common.Payload `cli:",cardOmitEmpty"` - StateTransitionCount int64 - HistoryLength int64 - HistorySize int64 + WorkflowId string + RunId string + Type string + Namespace string + TaskQueue string + AssignedBuildId string + StartTime time.Time + CloseTime time.Time `cli:",cardOmitEmpty"` + ExecutionTime time.Time `cli:",cardOmitEmpty"` + Memo map[string]*common.Payload `cli:",cardOmitEmpty"` + SearchAttributes map[string]*common.Payload `cli:",cardOmitEmpty"` + StateTransitionCount int64 + HistoryLength int64 + HistorySize int64 + ExecutionExpirationTime time.Time + RunExpirationTime time.Time + CancelRequested bool + LastResetTime time.Time + OriginalStartTime time.Time }{ - WorkflowId: info.Execution.WorkflowId, - RunId: info.Execution.RunId, - Type: info.Type.GetName(), - Namespace: c.Parent.Namespace, - TaskQueue: info.TaskQueue, - AssignedBuildId: info.GetAssignedBuildId(), - StartTime: timestampToTime(info.StartTime), - CloseTime: timestampToTime(info.CloseTime), - ExecutionTime: timestampToTime(info.ExecutionTime), - Memo: info.Memo.GetFields(), - SearchAttributes: info.SearchAttributes.GetIndexedFields(), - StateTransitionCount: info.StateTransitionCount, - HistoryLength: info.HistoryLength, - HistorySize: info.HistorySizeBytes, + WorkflowId: info.Execution.WorkflowId, + RunId: info.Execution.RunId, + Type: info.Type.GetName(), + Namespace: c.Parent.Namespace, + TaskQueue: info.TaskQueue, + AssignedBuildId: info.GetAssignedBuildId(), + StartTime: timestampToTime(info.StartTime), + CloseTime: timestampToTime(info.CloseTime), + ExecutionTime: timestampToTime(info.ExecutionTime), + Memo: info.Memo.GetFields(), + SearchAttributes: info.SearchAttributes.GetIndexedFields(), + StateTransitionCount: info.StateTransitionCount, + HistoryLength: info.HistoryLength, + HistorySize: info.HistorySizeBytes, + ExecutionExpirationTime: timestampToTime(extendedInfo.ExecutionExpirationTime), + RunExpirationTime: timestampToTime(extendedInfo.RunExpirationTime), + CancelRequested: extendedInfo.CancelRequested, + LastResetTime: timestampToTime(extendedInfo.LastResetTime), + OriginalStartTime: timestampToTime(extendedInfo.OriginalStartTime), }, printer.StructuredOptions{}) staticSummary := resp.GetExecutionConfig().GetUserMetadata().GetSummary() From 86b0705469dbba5384a0ff5d84aaed2170c6d737 Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 27 Feb 2025 12:40:17 -0800 Subject: [PATCH 2/2] comments - add cardOmitEmpty --- temporalcli/commands.workflow_view.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/temporalcli/commands.workflow_view.go b/temporalcli/commands.workflow_view.go index 4f082800..75f1db34 100644 --- a/temporalcli/commands.workflow_view.go +++ b/temporalcli/commands.workflow_view.go @@ -118,11 +118,11 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin StateTransitionCount int64 HistoryLength int64 HistorySize int64 - ExecutionExpirationTime time.Time - RunExpirationTime time.Time + ExecutionExpirationTime time.Time `cli:",cardOmitEmpty"` + RunExpirationTime time.Time `cli:",cardOmitEmpty"` CancelRequested bool - LastResetTime time.Time - OriginalStartTime time.Time + LastResetTime time.Time `cli:",cardOmitEmpty"` + OriginalStartTime time.Time `cli:",cardOmitEmpty"` }{ WorkflowId: info.Execution.WorkflowId, RunId: info.Execution.RunId,