-
Notifications
You must be signed in to change notification settings - Fork 10.1k
stacks: allow removed blocks to target components in nested stacks #36787
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
stacks: allow removed blocks to target components in nested stacks #36787
Conversation
ffa57f4 to
4881ea2
Compare
internal/rpcapi/stacks.go
Outdated
| cProto := &stacks.FindStackConfigurationComponents_Removed_Block{ | ||
| SourceAddr: rc.FinalSourceAddr.String(), | ||
| ComponentAddr: stackaddrs.Config(stackAddr, stackaddrs.Component{Name: rc.FromComponent.Name}).String(), | ||
| ComponentAddr: stackaddrs.Config(stackAddr, stackaddrs.Component{Name: rc.From.ConfigComponent().String()}).String(), |
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.
not correct! we need to combine the addresses properly
stackaddrs.ConfigComponent{
Stack: append(stackAddr, rc.From.ConfigComponent().Stack)
Component: rc.From.ConfigComponent().Component
}
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.
Or simply c.From.ConfigComponent().String()? The definition already contains the stack string
func (ist InStackConfig[T]) String() string {
...
return ist.Stack.String() + "." + ist.Item.String()
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 do need to combine it with the other stack address as the from address is relative, and we want to provide the absolute address here.
…te/stacks/removed-chain-1/remove-embedded-components
47fdf49 to
3780e70
Compare
3780e70 to
dd7b3ba
Compare
|
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. |
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.
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.