(cli): cdk watch
should stop after synth
and not move to deploy
if more changes are made during synth
#29441
Labels
@aws-cdk/core
Related to core CDK functionality
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
package/tools
Related to AWS CDK Tools or CLI
Describe the feature
If
Change A
is being queued and starts deployment by thecdk watch
command, a second change (Change B
) coming in during that deployment process has to wait for the WHOLE synth + deploy cycle to complete, beforeChange B
starts to be deployed. We could easily skip thedeploy
step here and implement a killswitch that skips thedeploy
after thesynth
has completed IF there was another change pushed to the queue during thesynth
phase.Use Case
Iterating (live development) on a larger CDK project with multiple Stacks and a large number of resources to be synthesized
Proposed Solution
When the
cdk watch
command is left running in a terminal, and I make a change inside the project, to oversimplify - it goes through a two-step process:cdk synth
andcdk deploy
. Let's assume that for a relatively large project with multiple stacks both of these steps take 1 minute each.When
cdk watch
starts the process, the whole 2 minutes are pretty much non-interruptable and any chance I make within these 2 minutes are queued and will start deployment exactly 2 minutes after the first change. Assuming I queue a second change at the 25 seconds mark, after the first one started the non-interruptable process - I will have to wait at least 35 seconds more for the two-step process to complete, before the second change starts deploying.My suggested solution is to quickly check after the
cdk synth
if the deployment (second step) is still valid or is now stale and should be skipped (because another change has been queued). This essentially means that the second change that I did in the 25 seconds mark, will have to wait for just 5 more seconds for thecdk synth
to complete, andcdk deploy
will be skipped.Other Information
No response
Acknowledgements
CDK version used
2.122.0 (build 7e77e02)
Environment details (OS name and version, etc.)
MacOS
The text was updated successfully, but these errors were encountered: