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 prepare_payload_for_reinvocation in invoke #1027

Conversation

mircealam
Copy link
Member

Description of changes:

This is for the use case where we are leveraging cfn invoke.
Before the fix only the callbackContext was passedin leading to a situation where if the model is updated and the handler emits a progress event we would end up losing recoding the updates that were made (and making the handler fail for those instances).
One such example is when we are creating a resources and there are multiple API calls needed to materialize this resource with a progress event being emitted between this API calls and one of the later API calls needed info returned by the earlier calls and persisted in the model.

Validation:
seed isort known_third_party.............................................Passed
isort....................................................................Passed
black....................................................................Passed
check for case conflicts.................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
pretty format json...................................(no files to check)Skipped
check for merge conflicts................................................Passed
flake8...................................................................Passed
check blanket noqa.......................................................Passed
check for not-real mock methods..........................................Passed
use logger.warning(......................................................Passed
bandit...................................................................Passed
pylint-local.............................................................Passed
pytest-local.............................................................Passed

In addition ran the cfn invoke and verified that the model is correctly passed back in

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

This is for the use case where we are leveraging cfn invoke.
Before the fix only the callbackContext was passedin leading to a situation where if the model is updated and the handler emits a progress event we would end up losing recoding the updates that were made (and making the handler fail for those instances). One such example is when we are creating a resources and there are multiple API calls needed to materialize this resource with a progress event being emitted between this API calls and one of the later API calls needed info returned by the earlier calls and persisted in the model.

Validation:
seed isort known_third_party.............................................Passed
isort....................................................................Passed
black....................................................................Passed
check for case conflicts.................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
pretty format json...................................(no files to check)Skipped
check for merge conflicts................................................Passed
flake8...................................................................Passed
check blanket noqa.......................................................Passed
check for not-real mock methods..........................................Passed
use logger.warning(......................................................Passed
bandit...................................................................Passed
pylint-local.............................................................Passed
pytest-local.............................................................Passed

In addition ran the cfn invoke and verified that the model is correctly passed back in
src/rpdk/core/invoke.py Show resolved Hide resolved
@ammokhov ammokhov merged commit 78d153e into aws-cloudformation:master Oct 3, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants