fix(amazon/pipeline): sort list of available bake regions #7472
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.
We typically sort the list of available regions in stage configs (e.g.
AccountRegionClusterSelector
), but we don't in the AWS bake stage. This is not only somewhat confusing (we've observed people accidentally select the wrong regions because they were relying on order rather than reading the region name), it also has the side effect of making pipeline JSON 'different' from it's saved state if the API decides to return a different ordering for some reason.That very thing seems to have happened with some of our internal users, who noticed a prompt to save because the order our
checklist
component used stopped matching the saved JSON ordering, resulting in a diff (even though the same regions were selected).This PR does two small things:
application.defaultRegions
from treating it like an array (it's not) to treating it like a map of region strings -> region metadata (which is what it actually is). I guess nobody on AWS actually uses that feature?