Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cli): cdk watch should stop after synth and not move to deploy if more changes are made during synth #29441

Open
2 tasks
Dzhuneyt opened this issue Mar 11, 2024 · 1 comment
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

Comments

@Dzhuneyt
Copy link
Contributor

Describe the feature

If Change A is being queued and starts deployment by the cdk watch command, a second change (Change B) coming in during that deployment process has to wait for the WHOLE synth + deploy cycle to complete, before Change B starts to be deployed. We could easily skip the deploy step here and implement a killswitch that skips the deploy after the synth has completed IF there was another change pushed to the queue during the synth 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 and cdk 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 the cdk synth to complete, and cdk deploy will be skipped.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.122.0 (build 7e77e02)

Environment details (OS name and version, etc.)

MacOS

@Dzhuneyt Dzhuneyt added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 11, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Mar 11, 2024
@Dzhuneyt Dzhuneyt changed the title (cli): cdk watch should stop after synth and not move to deploy if changes are detected during synth (cli): cdk watch should stop after synth and not move to deploy if more changes are made during synth Mar 11, 2024
@pahud
Copy link
Contributor

pahud commented Mar 11, 2024

Thank you for the feedback. This makes sense to me.

@pahud pahud added p2 effort/medium Medium work item – several days of effort @aws-cdk/core Related to core CDK functionality and removed needs-triage This issue or PR still needs to be triaged. labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants