Add batch cancel, terminate and delete operators for standalone activities#1100
Draft
ks-temporal wants to merge 6 commits into
Draft
Add batch cancel, terminate and delete operators for standalone activities#1100ks-temporal wants to merge 6 commits into
ks-temporal wants to merge 6 commits into
Conversation
Add a new --query and related flags for cancel, terminate and delete. Add a new delete subcommand for standalone activity.
There was a problem hiding this comment.
Pull request overview
Adds experimental standalone Activity operators to the Temporal CLI, including a new temporal activity delete command and batch-mode support (--query, confirmation/rate limiting flags) for activity cancel, activity terminate, and activity delete.
Changes:
- Introduces
temporal activity deletefor deleting standalone activity executions (single and batch via--query). - Extends
activity cancel/terminateto support batch operations driven by a visibility query, including confirmation prompts and--rps. - Adds SharedServerSuite functional tests covering single delete and batch cancel/terminate/delete behaviors.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/temporalcli/commands.yaml | Updates help text and adds the new delete command + shared option-set for activity single-or-batch flags |
| internal/temporalcli/commands.workflow.go | Extends override struct used by single-or-batch option handling |
| internal/temporalcli/commands.gen.go | Adds generated flag struct for activity single-or-batch mode and wires in the new delete command |
| internal/temporalcli/commands.activity.go | Implements single vs batch execution logic for activity cancel/terminate/delete |
| internal/temporalcli/commands.activity_test.go | Adds functional tests for delete and batch cancel/terminate/delete |
| go.mod | Updates Go/tooling/module requirements and adds local replace directives |
| go.sum | Updates dependency checksums consistent with the module changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+9
| replace ( | ||
| go.temporal.io/api => ../api-go-saa-batch-cmds | ||
| go.temporal.io/sdk => ../sdk-go | ||
| go.temporal.io/server => ../orig-temporal | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Add new activity delete subcommand for deleting a standalone activity, and
add support for --query and related flags for batch operations in activity
cancel, terminate and delete for standalone activities. These are marked
experimental. Exactly one of --activity-id or --query is required for these
activity operators.
Checklist
Stability
-o json/-o jsonl) are treated as breaking changesDesign
temporal <noun> <verb>structure (e.g.temporal workflow start)--search-attribute, bad:--index-field)(Experimental)incommands.yamlHelp text (see style guide at the top of
commands.yaml)--namespace, not-n), one flag per lineYourXxxform (YourWorkflowId,YourNamespace)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableManual tests
Setup
Start N=5 activities replacing
{N}with 1, 2, ... and so on.Start a worker with type YourActivityType to listen to task queue of YourTaskQueue,
that either sleeps for 2 minutes, or returns activity pending error.
Repeat the setup step for each of the tests below.
Happy path
First, test batch cancellation, as follows, and enter
ywhen prompted.Check the RunState of these activities using describe, replacing
{N}with 1,2,... and so on.Also check the status in the list as follows.
Next, test batch deletion, as follows, and enter
ywhen prompted.Now, listing the activities should not show any.
To test, batch termination, start the activities again using the setup step
mentioned above. Then test batch termination as follows. Here
--yesisused to avoid the prompt.
Now, listing the activities should show Status of Terminated for all.
Delete the activities to cleanup.
Error case
The following can be repeated by replacing
cancelwithterminateordelete.The following can be repeated by replacing
cancelwithterminateordelete.Composition