-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
CFNV2: correct state modelling of failed stacks #13040
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
Conversation
This makes sure that they appear in the list with the correct status, rather than not being present at all
7b2b868 to
00e725c
Compare
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 1h 42m 58s ⏱️ + 1h 19m 15s Results for commit 5326eb2. ± Comparison against base commit 93a1ec5. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files ± 0 5 suites ±0 2h 21m 9s ⏱️ + 1h 47m 37s Results for commit 5326eb2. ± Comparison against base commit 93a1ec5. ♻️ This comment has been updated with latest results. |
d838141 to
38d98ef
Compare
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.
More parity!! 🎉
Some ideas for the future:
- make the visitor group the fnTransforms and forEachs together so we don't have to add new class attributes every time.
- we will need to start adding tests for rollbacks 🥳
- Implement the staticPreproc
Also added a comment that we should address sooner rather than later.
| if failure_message: | ||
| # TODO: differentiate between update and create | ||
| self._change_set.stack.set_stack_status(StackStatus.ROLLBACK_IN_PROGRESS) | ||
| else: | ||
| # TODO: correct status | ||
| self._change_set.stack.set_stack_status( | ||
| StackStatus.UPDATE_COMPLETE_CLEANUP_IN_PROGRESS | ||
| ) |
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.
Finally rollback support 🎉
| SKIP_TYPE_RE = re.compile(r"^CFNV2\((?P<reason>[^\)]+)\)") | ||
|
|
||
|
|
||
| def skip_if_v2_provider(*types: str, reason: str = ""): |
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.
🎉
| new_stack_status = StackStatus.CREATE_FAILED | ||
|
|
||
| change_set.stack.set_stack_status(new_stack_status) | ||
| # stack status is taken care of in the executor |
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.
Important: We should be more constant on which entity is in charge of updating the stack status. As it is now, sometimes it's the provider, other times it's the executor. This could cause confusion when working in the codebase.
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.
You are absolutely right I'm glad you picked up on that. A good cleanup opportunity
Co-authored-by: Cristopher Pinzón <[email protected]>
Motivation
While implementing the fix for
test_deletion_of_failed_nested_stackI found that our modelling of stack and change set state needed some work, particularly around deletion.Note
This PR is part of a stack building in #13034
Important
This is the final PR to unskip all CloudFormation tests for the new engine in this repo 🎉
Changes
Service changes
failure_message. If this value is present it means the deployment was a failure. Otherwise it was successfulvisit_node_resourceto skip failures to visit and just move on to the properties to coninue traversing the graphExecutor->ChangeSet/Stackafterexecute_change_setcreate_stackon failureTest changes
skip_if_v2_providerdecorator as we don't need it any more 🎉test_create_and_then_update_refreshes_template_metadatatesttest_deletion_of_failed_nested_stacktest_sns_topic_fifo_without_suffix_failstest to move the classification fromneeds_fixingtovalidatedFollow ups
execute_change_setwith those ofcreate_stackandupdate_stack