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(stepfunctions): no validation on state machine name #13387

Merged
merged 4 commits into from
Mar 9, 2021

Conversation

jonnekaunisto
Copy link
Contributor

closes #13289


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

gitpod-io bot commented Mar 4, 2021

@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Mar 4, 2021
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

@jonnekaunisto thanks for submitting a fix for this! I've left a couple of minor suggestions.

packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts Outdated Show resolved Hide resolved
@shivlaks shivlaks changed the title fix(aws-stepfunctions): Validate StateMachine name fix(stepfunctions): no validation on state machine names Mar 4, 2021
@shivlaks shivlaks changed the title fix(stepfunctions): no validation on state machine names fix(stepfunctions): no validation on state machine name Mar 4, 2021
@mergify mergify bot dismissed shivlaks’s stale review March 5, 2021 04:40

Pull request has been modified.

Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

@jonnekaunisto looks great! one minor test case to add and we're good to go here.
thanks for turning it around so quickly!!

Comment on lines +81 to +83
expect(() => {
createStateMachine(tooLongName);
}).toThrow(`State Machine name must be between 1 and 80 characters. Received: ${tooLongName}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

let's also add one more expect for a blank string to cover the other side of the bounds.

Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

left 1 minor comment - add a test (expect statement) for lower bound in length validation.

@mergify mergify bot dismissed shivlaks’s stale review March 6, 2021 23:48

Pull request has been modified.

Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

@jonnekaunisto thanks for the contribution!!

@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2021

Thank you for contributing! Your pull request will be updated from master 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: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 6ee989a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2021

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

This was referenced Mar 15, 2021
jstrese added a commit to jstrese/aws-cdk that referenced this pull request Apr 3, 2021
Name validation for state machines was added in aws#13387. The validation did not take into consideration that the name may contain an unresolved token. This change skips name validation if there is an unresolved token as it does not make sense to attempt to validate something that is unknown. This change also allows a few more special characters as they are allowed through the AWS Console.

fixes aws#13946
mergify bot pushed a commit that referenced this pull request Apr 8, 2021
…re used. (#13970)

Name validation for state machines was added in #13387. The validation added was not considering that the name may contain an unresolved token. This change skips name validation if there is an unresolved token as it does not make sense to attempt to validate something that is unknown. This change also allows a few more special characters as they are allowed through the AWS Console.

fixes #13946 #13912


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…re used. (aws#13970)

Name validation for state machines was added in aws#13387. The validation added was not considering that the name may contain an unresolved token. This change skips name validation if there is an unresolved token as it does not make sense to attempt to validate something that is unknown. This change also allows a few more special characters as they are allowed through the AWS Console.

fixes aws#13946 aws#13912


----

*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
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-stepfunctions): Validate StateMachine name
3 participants