Skip to content

(cli): I think cdk watch should deploy first #17776

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

Closed
2 tasks
eladb opened this issue Nov 30, 2021 · 2 comments · Fixed by #18057
Closed
2 tasks

(cli): I think cdk watch should deploy first #17776

eladb opened this issue Nov 30, 2021 · 2 comments · Fixed by #18057
Assignees
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@eladb
Copy link
Contributor

eladb commented Nov 30, 2021

Description

cdk watch should start with a cdk deploy to make sure my account and my source code are in sync before watching for changes.

Use Case

The point of cdk watch is to keep a developer account in sync with your source code as you develop. To that end, I expected that the CLI will first deploy the current version to my account before beginning to monitor files.

This surprising behavior is emphasized when running cdk deploy --watch (which even sends a stronger semantic signal that I want to deploy).

Proposed Solution

Just kick off a cdk deploy before watching.

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@eladb eladb added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 30, 2021
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Nov 30, 2021
@skinny85
Copy link
Contributor

skinny85 commented Dec 1, 2021

I thought of this too. The counter-argument I've had is that it's very easy to trigger a deploy with watch without any big change (for example, just add an empty line, or a comment), so it's not a huge deal that it doesn't start with a deployment.

Thoughts on this?

@skinny85 skinny85 added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 1, 2021
@kaizencc kaizencc self-assigned this Dec 16, 2021
@mergify mergify bot closed this as completed in #18057 Dec 17, 2021
mergify bot pushed a commit that referenced this issue Dec 17, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Similar to `tsc -w`, `cdk watch` should trigger an initial deployment instead
of waiting for a file change event. We achieve this by pulling out the callback
function for `'all'` and calling that function during the `'ready'` callback.

Closes #17776.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Similar to `tsc -w`, `cdk watch` should trigger an initial deployment instead
of waiting for a file change event. We achieve this by pulling out the callback
function for `'all'` and calling that function during the `'ready'` callback.

Closes aws#17776.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item – less than a day 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

Successfully merging a pull request may close this issue.

4 participants