stacks: allow removed blocks to target components in nested stacks #36727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates removed blocks in stacks so that you can target components within nested stacks. This means that users can change input values into embedded stacks that might edit the number of components internally, and add removed blocks within the root stack that target any components removed by the change.
Unfortunately, this is a very complicated change - so perhaps I can sit down with anyone who wants to review this and go through it with them.
The general approach is that the
from
attribute of removed blocks now resolves to a full absolute address. Stack instances are now initialised with any external removed blocks in the constructor. So parent stacks pass in any removed blocks they have that target child stacks directly into the child stack. Then the removed blocks are still processed by the stack that actually contains the components that they target, this allows us to ensure that component and removed blocks don't target the same instance easily, and that removed blocks defined locally don't clash with removed blocks defined externally.There is a "very large ™️" change to the plan_test file, that involves moving tests around to group similar tests into the same execution block to simplify things overall. For that, I am sorry.