Skip to content

fix(ecs): setting updatePolicy results in error due to updateType having default value #21025

Merged
mergify[bot] merged 2 commits intoaws:mainfrom
richarddotcodes:main
Aug 3, 2022
Merged

fix(ecs): setting updatePolicy results in error due to updateType having default value #21025
mergify[bot] merged 2 commits intoaws:mainfrom
richarddotcodes:main

Conversation

@richarddotcodes
Copy link
Copy Markdown
Contributor

@richarddotcodes richarddotcodes commented Jul 6, 2022

Currently, providing an updatePolicy always results in an error
since updateType is always set. This change fixes that.

closes #11581


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • 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

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Jul 6, 2022

@github-actions github-actions bot added the p2 label Jul 6, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team July 6, 2022 23:23
rix0rrr
rix0rrr previously requested changes Jul 7, 2022
Copy link
Copy Markdown
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

PRs with changes that are not statically guaranteed by the type system must have tests to make sure that (a) the new behavior works as intended and (b) it is not accidentally undone by future changes (See Contributing Guide, Work Your Magic).

vpc: this.vpc,
machineImage,
updateType: options.updateType || autoscaling.UpdateType.REPLACING_UPDATE,
updateType: !!options.updatePolicy ? undefined : options.updateType || autoscaling.UpdateType.REPLACING_UPDATE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This behavior change should also be reflected in the @default docstring of the updateType field.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this really changing the default for the field, or am I just changing what gets passed in?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

`updatePolicy` takes precedence over `updateType`.

@default UpdateType.REPLACING_UPDATE, unless updatePolicy has been set

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I've updated this PR to reflect the requested changes.

@mergify mergify bot dismissed rix0rrr’s stale review July 8, 2022 15:40

Pull request has been modified.

@richarddotcodes
Copy link
Copy Markdown
Contributor Author

@rix0rrr Can I get a review? Thanks!

Copy link
Copy Markdown
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Looks good!

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 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).

@TheRealAmazonKendra
Copy link
Copy Markdown
Contributor

@richarddotcodes In order for Mergify to merge in your change you'll need to allow changes to your branch.

@TheRealAmazonKendra TheRealAmazonKendra changed the title fix(ecs): don't set updateType if updatePolicy present fix(ecs): setting updatePolicy results in error due to updateType having default value Aug 3, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 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).

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review August 3, 2022 16:09

Pull request has been modified.

…ing default value

Currently, providing an updatePolicy always results in an error
since updateType is always set. This change fixes that.
@richarddotcodes
Copy link
Copy Markdown
Contributor Author

@TheRealAmazonKendra Thanks for the info. I've followed the instructions in the link you'd sent. I also merged in changes from main; can I have another review?

@TheRealAmazonKendra
Copy link
Copy Markdown
Contributor

@Mergifyio update

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 2022

update

✅ Branch has been successfully updated

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 and removed p2 labels Aug 3, 2022
@TheRealAmazonKendra
Copy link
Copy Markdown
Contributor

https://github.com/Mergifyio update

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 2022

update

☑️ Nothing to do

Details
  • -closed [:pushpin: update requirement]
  • #commits-behind>0 [:pushpin: update requirement]

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

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

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

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 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).

@mergify mergify bot merged commit 3103784 into aws:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ecs] unable to specify update policy when adding ASG capacity to ECS cluster

4 participants