Skip to content

Commit 49bbde8

Browse files
committed
Cancel Plan Preview Command RFC
Signed-off-by: Harshit Gupta <[email protected]>
1 parent 3a40be6 commit 49bbde8

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
- Start Date: 2025-09-17
2+
- Target Version: 0.x
3+
4+
# Summary
5+
6+
Cancel Plan Preview Command is a command to cancel plan preview commands that have not been picked up by a piped agent.
7+
8+
# Motivation
9+
10+
Currently, users can start plan preview commands but cannot cancel them. Therefore, we have the following two motivations to introduce a cancel plan preview command:
11+
12+
- Plan preview commands, especially terraform related plan preview commands, can be long running. This becomes a bottleneck specially when there are large number of commands but only a few number of piped agents to execute them. Cancelling the plan preview commands will shorten the queue of commands.
13+
- In the future we would like to have a generic way to cancel all types of commands. Exploring how to cancel plan preview command helps us developers to explore how to build a cancel command feature which could be extended to other commands.
14+
15+
# Detailed design
16+
17+
In this iteration of the cancel plan preview command, we limit ourselves to only trigger the cancel plan preview comman using a github action. The following points describe how each component will handle the cancel plan preview command:
18+
19+
- Github Action: A new cancel-plan-preview github action will call pipecdctl to cancel a plan preview command. This will contain the detail necessary to find the plan preview command to cancel.
20+
21+
- PipecdCtl: Makes a blocking call the control plane to cancel the plan preview command.
22+
23+
- Control Plane:
24+
- Finds all the commands generated by the plan preview command to cancel.
25+
- If no commandds have been picked up by the piped agents yet, the control plan cancels the commands by setting the status to cancel and update the database/filestore. Rreturn message that plan preview command was cancelled
26+
- If at least one command has been picked up by piped agent then control plane return a message that the command cannot be cancelled because a piped agent has already started executing the command.
27+
28+
# Alternatives
29+
30+
- We rejected an idea to have a UI page to list all the currently running plan preview commands and let the users cancel the plan preview commands from there. The main motivation behind this idea was to address the difficulty in finding the PRs which are currently running the plan preview commands. This idea is not completely rejected, we want to first address how the plan preview is mostly used. We would possibly revisit this idea in the future in the context of a generic cancel command.
31+
32+
- We rejected an idea where the user would have to manually specificy details of the plan preview comman so that the cancel plan preview command could find the plan preview command to cancel it. We rejected this idea in favour of using github actions because github actions already provide us with this detail making it the most efficient method for users to trigger a cancel plan preview command.
33+
34+
# Unresolved questions
35+
36+
In this iteration, we do not cancel commands that have already been picked up by a piped agent. In a future iteration we would explore how to cancel commands that have been already picked up by a piped agent.

0 commit comments

Comments
 (0)