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

fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeout #31446

Merged
merged 20 commits into from
Sep 24, 2024

Conversation

michelle-wangg
Copy link
Contributor

@michelle-wangg michelle-wangg commented Sep 13, 2024

Issue # (if applicable)

Closes #30052

Reason for this change

When specifiying both resourceSignalTimeout and initOptions.timeout in the options for creating an EC2 Instance, only the value from resourceSignalTimeout is used.

Description of changes

  • If both initOptions.timeout and resourceSignalTimeout are set, timeout consisting of the sum of the values and a warning suggesting that only one field should be specified
  • Else, timeout is set to field specified, else defaults to 5 min

Description of how you validated changes

  • Update integration test for instance-init.js with both fields and verify that warning is logged
  • Add unit tests:
    • initOptions.timeout and resourceSignalTimeout are both not set, timeout is set to default of 5 min
    • initOptions.timeout set and resourceSignalTimeout not set, timeout is set to initOptions.timeout
    • initOptions.timeout not set and resourceSignalTimeout is set, timeout is set to resourceSignalTimeout
    • initOptions.timeout and resourceSignalTimeout are both set, timeout is set to sum of timeouts and warning is logged

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team September 13, 2024 22:11
@github-actions github-actions bot added the p2 label Sep 13, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 13, 2024
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort labels Sep 13, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@michelle-wangg michelle-wangg changed the title fix(ec2): Instance resourceSignalTimeout overwrites initOptions.timeout fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeout Sep 16, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 16, 2024 17:14

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@michelle-wangg michelle-wangg marked this pull request as ready for review September 16, 2024 21:03
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 16, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Nice Michelle! Left some comments.

I see your fix would now be summing the two values up. This would mean that users (who haven't changed their template) would have the values updated in their next deployment if they upgrade their CDK version. This is generally a sign of breaking change, however, in this case it's extending the timeout value. I think this can be argued to be a non-breaking change. Can you include @moelasmar in the review and get his though?

packages/aws-cdk-lib/aws-ec2/lib/instance.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ec2/lib/instance.ts Show resolved Hide resolved
packages/aws-cdk-lib/aws-ec2/lib/instance.ts Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 16, 2024
@michelle-wangg michelle-wangg force-pushed the overwriting-timeout branch 2 times, most recently from 563f7fe to 40dbdd2 Compare September 19, 2024 22:03
Copy link
Contributor

@moelasmar moelasmar left a comment

Choose a reason for hiding this comment

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

left minor comments, and you need to rerun the integration test cases with --update-on-failed flag

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@GavinZZ
Copy link
Contributor

GavinZZ commented Sep 23, 2024

@mergify update

Copy link
Contributor

mergify bot commented Sep 23, 2024

update

☑️ Nothing to do

  • #commits-behind > 0 [📌 update requirement]
  • -closed [📌 update requirement]
  • -conflict [📌 update requirement]
  • queue-position = -1 [📌 update requirement]

@GavinZZ GavinZZ dismissed moelasmar’s stale review September 24, 2024 00:13

Dismissing Mohamed's review since it's all addressed.

Copy link
Contributor

mergify bot commented Sep 24, 2024

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 a29bf19 into aws:main Sep 24, 2024
14 of 16 checks passed
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-ec2): Instance resourceSignalTimeout overwrites initOptions.timeout
5 participants