You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix activity command flag bugs and help text inconsistencies (#974)
## What was changed
- activity pause silently ignored the `--identity` flag, always sending
the global client identity instead of the per-command one
- activity pause had no `--reason` flag despite the server-side
`PauseActivityRequest` accepting one
- `--activity-type` showed `activity-id` as its value placeholder in
pause, unpause, and reset help output
- `--reset-heartbeats` on unpause and reset incorrectly claimed it only
works with `--reset-attempts`
- activity complete and activity fail lacked the `-a` shorthand for
`--activity-id` that the other activity subcommands already had
## Why?
These were found during an internal bug bash as either bugs or
inconsistencies.
## Checklist
1. Closes NA
2. How was this tested: Manually
3. Any docs updates needed? No
s.Command.Long="Complete an Activity, marking it as successfully finished. Specify the\nActivity ID and include a JSON result for the returned value:\n\n```\ntemporal activity complete \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --result '{\"YourResultKey\": \"YourResultVal\"}'\n```"
448
448
}
449
449
s.Command.Args=cobra.NoArgs
450
-
s.Command.Flags().StringVar(&s.ActivityId, "activity-id", "", "Activity ID to complete. Required.")
450
+
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID to complete. Required.")
s.Command.Long="Fail an Activity, marking it as having encountered an error. Specify the\nActivity and Workflow IDs:\n\n```\ntemporal activity fail \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n```"
482
482
}
483
483
s.Command.Args=cobra.NoArgs
484
-
s.Command.Flags().StringVar(&s.ActivityId, "activity-id", "", "Activity ID to fail. Required.")
484
+
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID to fail. Required.")
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to pause. Either `activity-id` or `activity-type` must be provided, but not both.")
519
-
s.Command.Flags().StringVar(&s.ActivityType, "activity-type", "", "All activities of the Activity Type will be paused. Either `activity-id` or `activity-type` must be provided, but not both. Note: Pausing Activity by Type is an experimental feature and may change in the future.")
520
+
s.Command.Flags().StringVar(&s.ActivityType, "activity-type", "", "Activities of the given `activity-type` will be paused. Mutually exclusive with `activity-id`. Note: Pausing Activity by Type is an experimental feature and may change in the future.")
520
521
s.Command.Flags().StringVar(&s.Identity, "identity", "", "The identity of the user or client submitting this request.")
522
+
s.Command.Flags().StringVar(&s.Reason, "reason", "", "Reason for pausing the Activity.")
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to reset. Mutually exclusive with `--query`, `--match-all`, and `--activity-type`. Requires `--workflow-id` to be specified.")
557
-
s.Command.Flags().StringVar(&s.ActivityType, "activity-type", "", "Activities of this Type will be reset. Mutually exclusive with `--match-all` and `activity-id`. Note: Resetting Activity by Type is an experimental feature and may change in the future.")
559
+
s.Command.Flags().StringVar(&s.ActivityType, "activity-type", "", "Activities of the given `activity-type` will be reset. Mutually exclusive with --match-all and `activity-id`. Note: Resetting Activity by Type is an experimental feature and may change in the future.")
558
560
s.Command.Flags().BoolVar(&s.KeepPaused, "keep-paused", false, "If the activity was paused, it will stay paused.")
559
561
s.Command.Flags().BoolVar(&s.ResetAttempts, "reset-attempts", false, "Reset the activity attempts.")
560
-
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats. Only works with --reset-attempts.")
562
+
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats.")
561
563
s.Command.Flags().BoolVar(&s.MatchAll, "match-all", false, "Every activity should be reset. Every activity should be updated. Mutually exclusive with `--activity-id` and `--activity-type`. Note: This is an experimental feature and may change in the future.")
562
564
s.Jitter=0
563
565
s.Command.Flags().Var(&s.Jitter, "jitter", "The activity will reset at random a time within the specified duration. Can only be used with --query.")
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to unpause. Mutually exclusive with `--query`, `--match-all`, and `--activity-type`. Requires `--workflow-id` to be specified.")
599
-
s.Command.Flags().StringVar(&s.ActivityType, "activity-type", "", "Activities of this Type will unpause. Can only be used without --match-all. Either `activity-id` or `activity-type` must be provided, but not both. Note: Unpausing Activity by Type is an experimental feature and may change in the future.")
601
+
s.Command.Flags().StringVar(&s.ActivityType, "activity-type", "", "Activities of the given `activity-type` will be unpaused. Mutually exclusive with `activity-id` and --match-all. Note: Unpausing Activity by Type is an experimental feature and may change in the future.")
600
602
s.Command.Flags().BoolVar(&s.ResetAttempts, "reset-attempts", false, "Reset the activity attempts.")
601
-
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats. Only works with --reset-attempts.")
603
+
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats.")
602
604
s.Command.Flags().BoolVar(&s.MatchAll, "match-all", false, "Every paused activity should be unpaused. This flag is ignored if activity-type is provided. Note: This is an experimental feature and may change in the future.")
603
605
s.Jitter=0
604
606
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.")
0 commit comments