Skip to content

Conversation

@liamcervante
Copy link
Member

During Stacks destroy operations each component does a refresh operation before calling destroy. This was actually causing the number of resources to be double-counted by the stacks progress events as the refresh operation was triggering the pre- and post- diff hooks to be counted by Stacks.

This PR updates the stacks component planning so the hook implementations are taken out of the code shared by the refresh and planning operations, and are instead called directly by the stack graph nodes where they are needed. This ensures the destroy-refresh operation doesn't emit status updates for resources anymore.

I've added a big testing helper function to help test the stacks hooks implementation, and added a test that uses it to expose the problem fixed here. Because most of the tests share the same core testing code, this implementation does also ensure that many additional tests are also validating the hooks process is adding things in the right order even if they're not all directly validating the exact hooks that are being called.

@liamcervante liamcervante requested a review from a team as a code owner May 14, 2025 08:08
@liamcervante liamcervante added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label May 14, 2025
dsa0x
dsa0x previously approved these changes May 14, 2025
Base automatically changed from liamcervante/diff-hook-destroy to main May 15, 2025 06:33
@liamcervante liamcervante dismissed dsa0x’s stale review May 15, 2025 06:33

The base branch was changed.

@liamcervante liamcervante force-pushed the liamcervante/stacks/refresh-and-destroy-hooks branch 2 times, most recently from 7ab94a7 to 781a068 Compare May 15, 2025 06:36
@liamcervante liamcervante enabled auto-merge (squash) May 15, 2025 06:40
@liamcervante liamcervante merged commit 3d43918 into main May 15, 2025
7 of 8 checks passed
@liamcervante liamcervante deleted the liamcervante/stacks/refresh-and-destroy-hooks branch May 15, 2025 06:41
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants