-
Notifications
You must be signed in to change notification settings - Fork 4k
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): map state validation fix #4382
fix(stepfunctions): map state validation fix #4382
Conversation
…e, added synth unit tests
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Why is maxConcurrency mandatory? It should be optional with a default to like 10 or 100 if the user doesn’t supply it. |
It is not mandatory, is number | undefined , in this way you have to provide a number or not set a value. null is not permitted , in this way the check if the value is set is easier |
…at has to be a positive integer
be89962
to
3eaf502
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@rhboyd The default value for maxConcurrency (if not provided is 0 from the step functions)
https://aws.amazon.com/blogs/aws/new-step-functions-support-for-dynamic-parallelism/ |
Awesome. Thanks for clarifying it. I was trying to read the PR on mobile and I confused myself. +1 |
Also, tagging @rix0rrr since he shepherded the original release into production. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
I tried sync'ing a graph using this branch (only updating node-aws-cdk with m = sfn.Map(
self,
logical_name,
input_path=input_path,
output_path=output_path,
max_concurrency=10,
**kwargs,
)
m.iterator(sfn.Pass(self, "Pass in Map")) This error'd for the same reason. I figure this is likely because I didn't also upgrade the python packages I import (cdk is only at runtime). I'm going through that now, running the |
@@ -150,10 +150,30 @@ export class Map extends State implements INextable { | |||
* Validate this state | |||
*/ | |||
protected validate(): string[] { | |||
if (!!this.iterator) { | |||
return ['Map state must have a non-empty iterator']; | |||
const validateMaxConcurrency = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this needs to be an inner function? I'd rather you extract the logic to test that a number is a positive integer to a function isPositiveInteger()
and call that inline in this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i will move the function outside Map and export it for the test, I will add tests for the function (the samecases I added) but I would like to leave the tests on synth to take care about regressions
@rix0rrr It should be ok now |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@rix0rrr Do you think that, is the review it's ok, there is any chance that this will go in the next release? We are waiting for this to complete a feature in one of our projects and it would be great |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Is this working for you? |
Should |
Closes #4137, #4417
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license