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

feat(cli): re-introduce --concurrency option #21681

Merged
merged 9 commits into from
Aug 25, 2022

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Aug 19, 2022

Re-rolls #20345, after it had to be reverted in #21664.

Includes the fix necessary to make sure that --exclusively works (#21663), and includes cdk watch --concurrency as well (#21598).

Closes #21663.

@rix0rrr rix0rrr requested a review from a team August 19, 2022 09:33
@rix0rrr rix0rrr self-assigned this Aug 19, 2022
@gitpod-io
Copy link

gitpod-io bot commented Aug 19, 2022

@github-actions github-actions bot added the p2 label Aug 19, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team August 19, 2022 09:33
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 19, 2022
misterjoshua and others added 3 commits August 19, 2022 11:34
This PR adds #20345's `--concurrency` to `cdk watch` mode. Given that `cdk watch` is a wrapper around `deploy`, this is a simple matter of passing the `concurrency` option along.

Fixes #21597

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The new concurrency logic introduced in #20345 was checking for all
dependencies to a stack to have been deployed previously for the stack
to be unblocked, but if not all stacks are selected, they will never
become unblocked.

Because there was no check on being "complete" at the end, this silently
leads to no stacks being deployed and the CLI no-opping.

Fix by only waiting for selected stacks among the dependencies, and
adding a safeguard at the end to make sure we deployed all stacks
successfully (or failed halfway through).
deploymentStates[stack.id] = 'deploying';

await deployStack(stack).catch((err) => {
deploymentStates[stack.id] = 'failed';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point: wouldn't it be better to have this assignment inside the catch block? This way, no matter where an error happens, we're sure that it will set the state to failed and not block the queue.

@Naumel
Copy link
Contributor

Naumel commented Aug 21, 2022

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Aug 21, 2022

update

✅ Branch has been successfully updated

@corymhall corymhall added the pr/do-not-merge This PR should not be merged at this time. label Aug 22, 2022
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding do-not-merge in case you want to address @otaviomacedo's comment

@rix0rrr rix0rrr removed the pr/do-not-merge This PR should not be merged at this time. label Aug 22, 2022
@Naumel
Copy link
Contributor

Naumel commented Aug 23, 2022

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Aug 23, 2022

update

✅ Branch has been successfully updated

@mergify
Copy link
Contributor

mergify bot commented Aug 25, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 57ea2f3
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit f001f7e into main Aug 25, 2022
@mergify mergify bot deleted the revert-21664-revert-20345-relm/concurrent-deploys2 branch August 25, 2022 13:51
@mergify
Copy link
Contributor

mergify bot commented Aug 25, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

josephedward pushed a commit to josephedward/aws-cdk that referenced this pull request Aug 30, 2022
Re-rolls aws#20345, after it had to be reverted in aws#21664.

Includes the fix necessary to make sure that `--exclusively` works (aws#21663), and includes `cdk watch --concurrency` as well (aws#21598).

Closes aws#21663.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants