Blueprint execution: Split up top-level cleanup implementation #9512
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.
Before this change, the high-level structure of this was "for each ready-for-cleanup zone in the blueprint, match on its type and then maybe perform some cleanup action depending on the type". After this change, this is inverted: "for each zone type we care about, for each ready-for-cleanup zone of that type in the blueprint, perform the relevant cleanup action".
On its face this is a little worse: we now loop over the zones in the blueprint twice (currently, because we have two zone types we care about for cleanup, although a third is implemented and compiled out for now) instead of once. The intent here is that we're going to attach a
reasonfor why a given caller wants to act on expunged zones, and it's much clearer if it's broken out this way. For example, in future work we'll change this:to something like
and it's harder to express some kind of "composite reason" if we were to keep the original structure.