-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
add implementation of DeleteChangeSet for CFnV2 #12876
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
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 23m 35s ⏱️ - 1h 18m 53s Results for commit c5ae9f1. ± Comparison against base commit 9bd5851. This pull request removes 4034 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files ± 0 5 suites ±0 34m 29s ⏱️ - 1h 46m 28s Results for commit c5ae9f1. ± Comparison against base commit 9bd5851. This pull request removes 4369 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
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.
My only question is around the error message. We should clear up if the message has changed and the snapshots need updating, or if it changes based on the operation
Also can you make sure to update the stack change set ids
| ) | ||
|
|
||
| change_set.stack.change_set_ids.remove(change_set.change_set_id) | ||
| state.change_sets.pop(change_set.change_set_id) |
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.
We also need to remove the change set from stack.change_set_ids I think
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.
This comment is actually an error and I did not read the code properly
simonrw
left a comment
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.
Pair-reviewed with @pinzon
| state = get_cloudformation_store(context.account_id, context.region) | ||
|
|
||
| if is_changeset_arn(change_set_name): | ||
| change_set = state.change_sets.get(change_set_name) |
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.
We need to early return if the change set cannot be found
| change_set = state.change_sets.get(change_set_name) | |
| change_set = state.change_sets.get(change_set_name) | |
| if change_set is None: | |
| # AWS does not raise an error if it cannot find the change set | |
| return |
| if is_changeset_arn(change_set_name): | ||
| change_set = state.change_sets.get(change_set_name) | ||
| elif not is_changeset_arn(change_set_name) and stack_name: | ||
| change_set = find_change_set_v2(state, change_set_name, stack_name) |
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.
We need to early return if the change set cannot be found
| change_set = find_change_set_v2(state, change_set_name, stack_name) | |
| change_set = find_change_set_v2(state, change_set_name, stack_name) | |
| if change_set is None: | |
| # AWS does not raise an error if it cannot find the change set | |
| return |
| state.stacks_v2.get(change_set.stack.stack_id).change_set_ids.remove( | ||
| change_set.change_set_id | ||
| ) |
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.
This should not be needed
| state.stacks_v2.get(change_set.stack.stack_id).change_set_ids.remove( | |
| change_set.change_set_id | |
| ) |
| ) | ||
|
|
||
| change_set.stack.change_set_ids.remove(change_set.change_set_id) | ||
| state.change_sets.pop(change_set.change_set_id) |
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.
This comment is actually an error and I did not read the code properly
Motivation
This PR implements the DeleteChangeSet for Cloudformation v2 provider.
Changes
Testing
tests.aws.services.cloudformation.api.test_changesets.test_delete_change_set_exception.