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(stepfunctions-tasks): add timeout parameter for EmrCreateCluster #28532

Merged
merged 10 commits into from Jan 2, 2024

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Dec 30, 2023

This PR adds a new parameter timeout as Duration type instead of timeoutDurationMinutes because the timeoutDurationMinutes is a number type.

Originally, timeoutDurationMinutes was a required parameter, but we have made it optional and also made the new parameter optional to avoid breaking change.

Instead, added a validation to ensure that the value is specified.

We discussed this in the following thread: #28529 (comment)


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 December 30, 2023 14:03
@github-actions github-actions bot added distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 labels Dec 30, 2023
@go-to-k go-to-k changed the title feat(stepfunctions-tasks): add parameter as Duration type feat(stepfunctions-tasks): add parameter timeout as Duration type Dec 30, 2023
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.

@go-to-k go-to-k changed the title feat(stepfunctions-tasks): add parameter timeout as Duration type feat(stepfunctions-tasks): add new parameter timeout as Duration type Dec 30, 2023
@go-to-k go-to-k changed the title feat(stepfunctions-tasks): add new parameter timeout as Duration type feat(stepfunctions-tasks): add parameter timeout as Duration type Dec 30, 2023
@go-to-k go-to-k changed the title feat(stepfunctions-tasks): add parameter timeout as Duration type feat(stepfunctions-tasks): add timeout parameter as Duration type Dec 30, 2023
@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 30, 2023

Exemption Request: Since there is no change in the CloudFormation template for integ testing, no change can be created in the snapshot.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Dec 30, 2023
@go-to-k go-to-k changed the title feat(stepfunctions-tasks): add timeout parameter as Duration type feat(stepfunctions-tasks): add timeout parameter as Duration type for EmrCreateCluster Dec 30, 2023
@go-to-k go-to-k changed the title feat(stepfunctions-tasks): add timeout parameter as Duration type for EmrCreateCluster feat(stepfunctions-tasks): add timeout parameter for EmrCreateCluster Dec 30, 2023
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 30, 2023
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Some minor thoughts, thanks for this!

* The value must be between 5 and 1440.
* The value must be between 5 and 1440 minutes.
*
* @default - No timeoutDurationMinutes
Copy link
Contributor

Choose a reason for hiding this comment

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

The default should be to use the value in timeout.

*
* You must specify one of `timeout` and `timeoutDurationMinutes`.
*
* @default - No timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

The default should be that we use the value in timeoutDurationMinutes

if (!cdk.Token.isUnresolved(property.timeoutDurationMinutes) && (property.timeoutDurationMinutes < 5 || property.timeoutDurationMinutes > 1440)) {
throw new Error(`timeoutDurationMinutes must be between 5 and 1440, got ${property.timeoutDurationMinutes}`);

if (!property.timeout && !property.timeoutDurationMinutes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like treating timeout and timeoutDurationMinutes separately here, because that will cause difficulty in the future if we are to add more validation. Instead, I'm looking for:

if ((property.timeout && property.timeoutDurationMinutes) || (!property.timeout && !property.timeoutDurationMinutes)) { throw new Error() }
const timeout = property.timeout.toMinutes() ?? property.timeoutDurationMinutes;
if (!cdk.Token.isUnresolved(timeout) && timeout < 5 || timeout > 1440) { ... }

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 30, 2023
@kaizencc kaizencc added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Dec 30, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 30, 2023 23:38

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

@mergify mergify bot dismissed kaizencc’s stale review December 31, 2023 04:00

Pull request has been modified.

@go-to-k go-to-k force-pushed the feat/sfn-tasks-emr-new-timeout branch from 68ba2c6 to ad29524 Compare December 31, 2023 04:04
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 31, 2023
@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 31, 2023

@kaizencc

Thanks for your review, I changed.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Hopefully my little update doesn't break the build :). Thanks @go-to-k

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 2, 2024
Copy link
Contributor

mergify bot commented Jan 2, 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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 5b49248
  • 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 ca91626 into aws:main Jan 2, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Jan 2, 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).

@go-to-k go-to-k deleted the feat/sfn-tasks-emr-new-timeout branch January 2, 2024 12:10
paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this pull request Jan 5, 2024
…er (aws#28532)

This PR adds a new parameter `timeout` as Duration type instead of `timeoutDurationMinutes` because the `timeoutDurationMinutes` is a number type.

Originally, `timeoutDurationMinutes` was a **required** parameter, but we have made it **optional** and also made the new parameter **optional** to avoid breaking change.

Instead, added a validation to ensure that the value is specified.

We discussed this in the following thread: aws#28529 (comment)

----

*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
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants