Skip to content
Open
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
26 changes: 11 additions & 15 deletions internal/temporalcli/commands.activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,16 +1123,14 @@ func (c *TemporalActivityUnpauseCommand) run(cctx *CommandContext, args []string
}

request := &workflowservice.UnpauseActivityExecutionRequest{
Namespace: c.Parent.Namespace,
WorkflowId: c.WorkflowId,
ActivityId: c.ActivityId,
RunId: c.RunId,
Identity: c.Parent.Identity,
ResetAttempts: c.ResetAttempts,
ResetHeartbeat: c.ResetHeartbeats,
Reason: c.Reason,
Jitter: durationpb.New(c.Jitter.Duration()),
ResourceId: resourceID,
Namespace: c.Parent.Namespace,
WorkflowId: c.WorkflowId,
ActivityId: c.ActivityId,
RunId: c.RunId,
Identity: c.Parent.Identity,
Reason: c.Reason,
Jitter: durationpb.New(c.Jitter.Duration()),
ResourceId: resourceID,
}

_, err = cl.WorkflowService().UnpauseActivityExecution(cctx, request)
Expand All @@ -1141,11 +1139,9 @@ func (c *TemporalActivityUnpauseCommand) run(cctx *CommandContext, args []string
}
} else { // batch operation
unpauseActivitiesOperation := &batch.BatchOperationUnpauseActivities{
Identity: c.Parent.Identity,
ResetAttempts: c.ResetAttempts,
ResetHeartbeat: c.ResetHeartbeats,
Jitter: durationpb.New(c.Jitter.Duration()),
Activity: &batch.BatchOperationUnpauseActivities_MatchAll{MatchAll: true},
Identity: c.Parent.Identity,
Jitter: durationpb.New(c.Jitter.Duration()),
Activity: &batch.BatchOperationUnpauseActivities_MatchAll{MatchAll: true},
}

batchReq.Operation = &workflowservice.StartBatchOperationRequest_UnpauseActivitiesOperation{
Expand Down
3 changes: 1 addition & 2 deletions internal/temporalcli/commands.activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (s *SharedServerSuite) TestActivityPauseUnpause() {
return len(resp.PendingActivities) > 0 && resp.PendingActivities[0].Paused
}, 5*time.Second, 100*time.Millisecond)

res = sendActivityCommand("unpause", run, s, "--activity-id", activityId, "--reset-attempts")
res = sendActivityCommand("unpause", run, s, "--activity-id", activityId)
s.NoError(res.Err)

s.Eventually(func() bool {
Expand Down Expand Up @@ -363,7 +363,6 @@ func (s *SharedServerSuite) TestActivityStandalone_Unpause() {
"activity", "unpause",
"--activity-id", handle.GetID(),
"--run-id", handle.GetRunID(),
"--reset-attempts",
"--address", s.Address(),
)
s.NoError(res.Err)
Expand Down
12 changes: 4 additions & 8 deletions internal/temporalcli/commands.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,8 @@ type TemporalActivityUnpauseCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
SingleActivityOrBatchOptions
ActivityId string
ResetAttempts bool
ResetHeartbeats bool
Jitter cliext.FlagDuration
ActivityId string
Jitter cliext.FlagDuration
}

func NewTemporalActivityUnpauseCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityUnpauseCommand {
Expand All @@ -1004,14 +1002,12 @@ func NewTemporalActivityUnpauseCommand(cctx *CommandContext, parent *TemporalAct
s.Command.Use = "unpause [flags]"
s.Command.Short = "Unpause an Activity"
if hasHighlighting {
s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nUse \x1b[1m--reset-attempts\x1b[0m to reset the number of previous run attempts to\nzero. For example, if an Activity is near the maximum number of attempts\nN specified in its retry policy, \x1b[1m--reset-attempts\x1b[0m will allow the\nActivity to be retried another N times after unpausing.\n\nUse \x1b[1m--reset-heartbeats\x1b[0m to reset the Activity's heartbeats.\n\nEither \x1b[1m--activity-id\x1b[0m (with \x1b[1m--workflow-id\x1b[0m for a workflow Activity, or\nalone for a standalone Activity) or \x1b[1m--query\x1b[0m must be specified.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --reset-attempts \\\n --reset-heartbeats\x1b[0m\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n\x1b[1mtemporal activity unpause \\\n --query 'TemporalPauseInfo IS NOT NULL'\x1b[0m\n\nOmit \x1b[1m--workflow-id\x1b[0m to target a Standalone Activity by Activity ID\nand optional Run ID."
s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nEither \x1b[1m--activity-id\x1b[0m (with \x1b[1m--workflow-id\x1b[0m for a workflow Activity, or\nalone for a standalone Activity) or \x1b[1m--query\x1b[0m must be specified.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\x1b[0m\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n\x1b[1mtemporal activity unpause \\\n --query 'TemporalPauseInfo IS NOT NULL'\x1b[0m\n\nOmit \x1b[1m--workflow-id\x1b[0m to target a Standalone Activity by Activity ID\nand optional Run ID."
} else {
s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nUse `--reset-attempts` to reset the number of previous run attempts to\nzero. For example, if an Activity is near the maximum number of attempts\nN specified in its retry policy, `--reset-attempts` will allow the\nActivity to be retried another N times after unpausing.\n\nUse `--reset-heartbeats` to reset the Activity's heartbeats.\n\nEither `--activity-id` (with `--workflow-id` for a workflow Activity, or\nalone for a standalone Activity) or `--query` must be specified.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --reset-attempts \\\n --reset-heartbeats\n```\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n```\ntemporal activity unpause \\\n --query 'TemporalPauseInfo IS NOT NULL'\n```\n\nOmit `--workflow-id` to target a Standalone Activity by Activity ID\nand optional Run ID."
s.Command.Long = "Re-schedule a previously-paused Activity for execution.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nEither `--activity-id` (with `--workflow-id` for a workflow Activity, or\nalone for a standalone Activity) or `--query` must be specified.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n```\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n```\ntemporal activity unpause \\\n --query 'TemporalPauseInfo IS NOT NULL'\n```\n\nOmit `--workflow-id` to target a Standalone Activity by Activity ID\nand optional Run ID."
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to unpause. Mutually exclusive with `--query`. Set `--workflow-id` to target a workflow Activity, or omit it to target a standalone Activity (the latest run unless `--run-id` is set).")
s.Command.Flags().BoolVar(&s.ResetAttempts, "reset-attempts", false, "Reset the activity attempts.")
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats.")
s.Jitter = 0
s.Command.Flags().Var(&s.Jitter, "jitter", "The activity will start at random a time within the specified duration. Can only be used with --query.")
s.SingleActivityOrBatchOptions.BuildFlags(s.Command.Flags())
Expand Down
17 changes: 1 addition & 16 deletions internal/temporalcli/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,6 @@ commands:
scheduled immediately. Otherwise, it will be scheduled after its retry
timeout expires.

Use `--reset-attempts` to reset the number of previous run attempts to
zero. For example, if an Activity is near the maximum number of attempts
N specified in its retry policy, `--reset-attempts` will allow the
Activity to be retried another N times after unpausing.

Use `--reset-heartbeats` to reset the Activity's heartbeats.

Either `--activity-id` (with `--workflow-id` for a workflow Activity, or
alone for a standalone Activity) or `--query` must be specified.

Expand All @@ -603,9 +596,7 @@ commands:
```
temporal activity unpause \
--activity-id YourActivityId \
--workflow-id YourWorkflowId \
--reset-attempts \
--reset-heartbeats
--workflow-id YourWorkflowId
```

Activities can be unpaused in bulk via a visibility Query list filter:
Expand All @@ -625,12 +616,6 @@ commands:
The Activity ID to unpause. Mutually exclusive with `--query`.
Set `--workflow-id` to target a workflow Activity, or omit it to target
a standalone Activity (the latest run unless `--run-id` is set).
- name: reset-attempts
type: bool
description: Reset the activity attempts.
- name: reset-heartbeats
type: bool
description: Reset the Activity's heartbeats.
- name: jitter
type: duration
description: |
Expand Down