[reconfigurator] replace Blueprint::zones_in_service with a disposition enum next to each zone#5238
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
jgallagher
left a comment
There was a problem hiding this comment.
Thanks, this is much cleaner. And my apologies that most of my comments apply to the existing code this PR touches 😬.
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
|
I've put in the changes we discussed today in this PR:
I also have a question: Should I think this will benefit from another round of review since the changes are substantial. GitHub code review change tracking is completely useless, so here's an interdiff generated by Jujutsu of the changes since last review. |
After reading the changes, I think I would very strongly vote "yes", and at that point we could probably drop |
Depends, I think some of the users want the full |
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
While developing #5238, I noticed that the output was getting significantly busier and less aligned. I decided to prototype out using `tabled` to display outputs, and I really liked the results. Examples that cover all of the cases are included in the PR. In the future I'd also like to add color support on the CLI, and expand it to inventory and `omdb` (it's similar except it doesn't have the zone policy table). Some other changes that are bundled into this PR: * Sort by (zone type, zone ID) rather than zone ID, to keep zones of the same type grouped together. * Moved unchanged data to the top to allow users to see less scrollback. * Moved metadata to the bottom for the same reason. * Add information about the zone config being changed. * Change `Blueprint::diff_sleds` and `Blueprint::diff_sleds_from_collection` to `Blueprint::diff_since_blueprint` and `diff_since_collection` recently. * Reordered `diff_since_blueprint`'s arguments so that `self` is after and the argument is before, to align with `diff_since_collection`. (I found that surprising!) * Renamed the diff type from `OmicronZonesDiff` to `BlueprintDiff`, since it's going to contain a lot more than zones. * Return an error from the diff methods, specifically if the before and after have the same zone ID but different types. Depends on #5238 and #5341.
This greatly simplifies the handling of the expunged disposition in #5211. It also is more understandable, and less prone to making mistakes.
This PR only changes the in-memory representation of what is currently
zones_in_service. I've skipped doing the DB migration in this PR because it'll be easier to just do it wholesale in #5211.There are some small differences in diff output that I think make sense. But I took a bigger swing at it in #5270, which depends on this.
TODO:
Blueprint'sDebugimpl into adisplay_detailed()method (done in [reconfigurator] improvements to blueprint displays and tests #5248)