-
Notifications
You must be signed in to change notification settings - Fork 90
feat: Add support for nested Aws StepFunctions service integration #166
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: Add support for nested Aws StepFunctions service integration #166
Conversation
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.
left some feedback of some changes I think we should make and some suggestions to consider. haven't looked at the tests yet.
…xception when more than one flag is enabled
…source that returns a JSON response
not directly related to this PR, but since we are trying to address the suggestion in #74 - any reason we shouldn't follow the same pattern for un-released service integrations we've added recently in #156 and #151 (not in this PR) I feel we should establish that in all service integrations we support, but especially ones we have not released yet. thoughts? - @wong-a @ca-nguyen |
Since these service integrations have not been released yet, it makes sense to follow the same patterns that provide a clearer solution to our customers.
I agree - ideally, we are consistent through all the service integrations |
Changes included in the last commits - Opted to implement an enum instead of having 3 flags
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 I follow this part tradeoffs:
An alternative mentioned by @shivlaks (in the discussion) is to use the existing flags to map to the ServiceIntegrationType and add a note in the docstrings that those flags will be deprecated in v3.0.0 and deprecate them when we are ready to upgrade the major version
I was not suggesting using existing flags to map to service integration type. I was indicating that we should not have default behaviour that a user does not explicitly opt into. The callout was that if a user achieves a certain behaviour, they need to explicitly opt into it.
I don't think this is a design decision at all and really the only tradeoff worth documenting is that we are opting into inconsistency for simplicity. The future consideration worth documenting is what we will do with existing service integrations as well as all future integrations. Will other service integrations now follow the enum pattern or fall back to past patterns?
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.
getting closer and certainly looks a lot nicer with the integration pattern.
take a look at my latest round of feedback and let me know if you have any questions
I have updated the CR summary to only reflect that tradeoff and discuss future considerations |
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.
Almost there!
In the PR description you checked:
integration test added
But no integ tests are in the diff. Did you forget to commit them? What kind of manual testing did you do?
Co-authored-by: Adam Wong <[email protected]>
I added details on the Manual tests that were performed in the
I updated with a Note next to the checked task to avoid confusion |
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.
looking much cleaner. some minor comments for you to take a look at and consider.
We should also resolve the open threads in this review.
Unit tests are failing due to PyYAML upgrade to v6.0.0 |
Added recommended changes in the last commits and addressed comments
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Description
Fixes #125
Why is the change necessary?
This adds support for AWS Step Functions service integration.
Added StartExecution step that allows to start an execution of another state machine
Solution
Provide support for 3 integration patterns by using
IntegrationPattern
enum in the step constructor to determine how to call the integrated service. TheIntegrationPattern
is used to build aResource
arn:See Service Integration Patterns for more details
Omitting support for "arn:aws:states:::states:startExecution.sync" resource that allows to get a string format response.
CDK does not expose a property to configure the response format and there was no demand for one. If there is an ask to get a response in string format, we can easily add the possibility to do so in the future.
Renaming
IntegrationPattern.RequestResponse
toIntegrationPattern.CallAndContinue
Note
Changing the existing
IntegrationPattern
is technically backwards incompatible, but this is acceptable due to the following:IntegrationPattern
was not documented or exposed to any "public" interfaceRequestResponse
was a confusing term as it sounded synchronous and they were not sure what it meant. After lengthy discussion with the team, we settled onCallAndContinue
which indicates clearly that we are not waiting for the state execution to end before continuing to the next state.After the next release,
IntegrationPattern
will be something we need to protect from backwards incompatible changes since it is part of the step constructor args.Trade-offs
Future considerations
To provide customers with an intuitive and consistent experience when using service integrations, I am proposing that we follow this pattern for all future integrations. This includes the services integrations that have not been released yet (EKS and Glue Databrew).
What about existing services?
Once we are ready for a major update, let's change existing service integrations to use the enum pattern to provide a consistent customer experience throughout.
Testing
Test1: WaitForCompletion
Validated that the state machine succeeded after the nested state machine execution succeeded (after 60 s wait time)
Test2: CallAndContinue
Validated that the state machine succeeded without waiting for the nested step machine execution to complete
Test3 : WaitForTaskToken
Validated that the state machine succeeded after the token was returned
Pull Request Checklist
Please check all boxes (including N/A items)
Testing
Documentation
Title and description
Fixes #xxx
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.