diff --git a/internal/temporalcli/commands.activity.go b/internal/temporalcli/commands.activity.go index aac65901d..0abc11aaf 100644 --- a/internal/temporalcli/commands.activity.go +++ b/internal/temporalcli/commands.activity.go @@ -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) @@ -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{ diff --git a/internal/temporalcli/commands.activity_test.go b/internal/temporalcli/commands.activity_test.go index b4552d077..05cbc9382 100644 --- a/internal/temporalcli/commands.activity_test.go +++ b/internal/temporalcli/commands.activity_test.go @@ -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 { @@ -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) diff --git a/internal/temporalcli/commands.gen.go b/internal/temporalcli/commands.gen.go index f1fc16290..ab5ee9748 100644 --- a/internal/temporalcli/commands.gen.go +++ b/internal/temporalcli/commands.gen.go @@ -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 { @@ -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()) diff --git a/internal/temporalcli/commands.yaml b/internal/temporalcli/commands.yaml index 5b8b54c1f..0f96ea4ef 100644 --- a/internal/temporalcli/commands.yaml +++ b/internal/temporalcli/commands.yaml @@ -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. @@ -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: @@ -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: |