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): Merge --hotswap-fallback behavior to --hotswap CLI flag #26802

Open
1 of 2 tasks
Dzhuneyt opened this issue Aug 18, 2023 · 2 comments
Open
1 of 2 tasks

(cli): Merge --hotswap-fallback behavior to --hotswap CLI flag #26802

Dzhuneyt opened this issue Aug 18, 2023 · 2 comments
Labels
documentation This is a problem with documentation. feature-request A feature should be added or improved. p1 package/tools Related to AWS CDK Tools or CLI

Comments

@Dzhuneyt
Copy link
Contributor

Describe the feature

As a team of engineers, using the cdk watch command often, I find that people who are relatively new to CDK often make the mistake of assuming that the cdk watch --all --hotswap --require-approval=never --concurrency=5 will "just work".

However, my teammates are often surprised when I tell them that the CLI will just "print" (with red text) when non-hotswap compatible resources are found and skip them, and carry on with other Stacks' successful deployments (because of the concurrency flag). This leads to lots of frustration and lost engineering/debugging time, wondering why a new API Gateway endpoint is not working, or whatever the skipped non-hotswappable change was.

Since I have deeper expertise with CDK, I know that the workaround is to use the --hotswap-fallback flag, which works intuitively - hotswap what you can, but fallback to ChangeSet based deployment. In the end, the changes are ALWAYS deployed and the end user doesn't have to care about this implementation detail.

So I was wondering would it make sense to introduce this intuitive behavior to the normal --hotswap flag and deprecate the poorly named and "very limited user case" (in my opinion) --hostwap-fallback?

Use Case

cdk watch --hotswap should "just work", rather than forcing users to dig deeper and find out about the --hotswap-fallback flag.

Proposed Solution

Fold --hotswap-fallback behavior into --hotswap.

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.89.0

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 Aug 18, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Aug 18, 2023
@peterwoodworth
Copy link
Contributor

I'm not really familiar with our hotswap implementation, but if this proves to be too difficult another solution would be to have better documentation.

@peterwoodworth peterwoodworth added p1 documentation This is a problem with documentation. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 18, 2023
@tmokmss
Copy link
Contributor

tmokmss commented Aug 19, 2023

I agree with this. Tbh I haven't found many use cases for the current --hotswap behavior since it was introduced. It's troublesome to use --hotswap and sometimes disable it when I want to deploy unhotswappable changes. With --hotswap-fallback, we can just always use it to deploy changes without thinking anything.

I think the current --hotswap-fallback should be the default hotswap behavior, so how about just renaming --hotswap -> --hotswap-alt (or whatever 😄 ) and --hotswap-fallback -> --hotswap?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. feature-request A feature should be added or improved. p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

3 participants