Skip to content

Commit 5e6f828

Browse files
authored
Show pause information in "workflow describe" command (#899)
<!--- 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 --> `temporal workflow describe` now shows pause information if the workflow is paused. ## Why? When a workflow is paused we need to show the relevant pause information like paused time, identity & reason. ## Checklist <!--- add/delete as needed ---> 1. Closes <!-- add issue number here --> 2. How was this tested: Tested manually 3. Any docs updates needed? N/A
1 parent a211263 commit 5e6f828

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

temporalcli/commands.workflow_pause.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ func (c *TemporalWorkflowPauseCommand) run(cctx *CommandContext, args []string)
1313

1414
_, err = cl.WorkflowService().PauseWorkflowExecution(cctx, &workflowservice.PauseWorkflowExecutionRequest{
1515
Namespace: c.Parent.Namespace,
16-
Reason: c.Reason,
1716
WorkflowId: c.WorkflowId,
1817
RunId: c.RunId,
1918
Identity: c.Parent.Identity,
19+
Reason: c.Reason,
2020
})
2121
if err != nil {
2222
return err

temporalcli/commands.workflow_view.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ func (c *TemporalWorkflowDescribeCommand) run(cctx *CommandContext, args []strin
161161
OriginalStartTime: timestampToTime(extendedInfo.OriginalStartTime),
162162
}, printer.StructuredOptions{})
163163
}
164+
if extendedInfo != nil && extendedInfo.PauseInfo != nil {
165+
cctx.Printer.Println(color.MagentaString("Pause Info:"))
166+
_ = cctx.Printer.PrintStructured(struct {
167+
Identity string `cli:",cardOmitEmpty"`
168+
Reason string `cli:",cardOmitEmpty"`
169+
PausedTime time.Time `cli:",cardOmitEmpty"`
170+
}{
171+
Identity: extendedInfo.PauseInfo.GetIdentity(),
172+
Reason: extendedInfo.PauseInfo.GetReason(),
173+
PausedTime: timestampToTime(extendedInfo.PauseInfo.GetPausedTime()),
174+
}, printer.StructuredOptions{})
175+
}
164176

165177
staticSummary := resp.GetExecutionConfig().GetUserMetadata().GetSummary()
166178
staticDetails := resp.GetExecutionConfig().GetUserMetadata().GetDetails()

0 commit comments

Comments
 (0)