-
Notifications
You must be signed in to change notification settings - Fork 63
[reconfigurator] use tabled to display blueprints and diffs #5270
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
[reconfigurator] use tabled to display blueprints and diffs #5270
Conversation
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
nexus/reconfigurator/planning/tests/output/planner_nonprovisionable_1_2.txt
Outdated
Show resolved
Hide resolved
jgallagher
left a comment
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.
Looks great to me!
nexus/reconfigurator/planning/tests/output/planner_nonprovisionable_1_2.txt
Outdated
Show resolved
Hide resolved
nexus/types/src/deployment.rs
Outdated
| // parameters inside changed. We need to add additional text to | ||
| // make that clearer. | ||
| // | ||
| // TODO: also print out the exact bits of configuration that |
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.
Do you want to do this on this PR, in a followup, or file an issue for someone to pick up later? (I have no preference between these - the old format also didn't show the details here, right?)
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.
Definitely in a follow up, will file an issue for this. A question that immediately occurs to me is: why are diffs special, why not display all the configs all the time within blueprints? Maybe we should have an extended mode in the displayer to make that possible.
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
davepacheco
left a comment
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.
Thanks for doing this. I was ambivalent but I think I've come around.
I really like that we're testing the blueprint diff output.
Some parts definitely look nicer.
My complaints are all nitty preference on the output format (but then again, the point of the PR is to change the output format for clarity so hopefully this isn't too out of place). My first reaction was: this looks a lot less like diff(1) output and I find it quite a lot harder to skim and scan it. I had tried to write up why but then took another look at the raw files instead of the GitHub diff and I think it's not so bad.
I do prefer left-aligned (or even right-aligned) columns to center-aligned. I think this is probably just convention burned into my brain more than anything -- I don't think I've seen many terminal tools that center-align columns and I'm not used to searching for tokens (like nexus) in the middle of a column.
nexus/reconfigurator/planning/tests/output/planner_basic_add_sled_2_3.txt
Outdated
Show resolved
Hide resolved
nexus/reconfigurator/planning/tests/output/planner_nonprovisionable_2_2a.txt
Outdated
Show resolved
Hide resolved
nexus/reconfigurator/planning/tests/output/planner_nonprovisionable_bp2.txt
Outdated
Show resolved
Hide resolved
Absolutely! I really want to make things better for all of us, and feedback is really welcome. I've already incorporated some of your feedback. (And yes -- I do think it looks better in the terminal when I'm actually developing against it, the visual separation makes things really easy to parse.) And as always, we can keep iterating on this. Thanks for being so receptive :) |
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
…on enum next to each zone (#5238) 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.
Created using spr 1.3.6-beta.1 [skip ci]
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
|
This ended up being expanded quite substantially after all the feedback was incorporated, but I'm pretty happy overall with the way it generally looks. I'll go over with some final ideas tomorrow morning, then put it up for another round of review.
Ended up agreeing with this in the end -- everything is now left-aligned. This led to:
|
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
|
Showed this to @smklein this morning, who had a bunch of really great suggestions. In particular, we figured out a much better way to show modified zones -- really happy with the current iteration. |
Created using spr 1.3.6-beta.1
| + ├─ in service fd00:1122:3344:105::22 | ||
| * └─ zone type config changed |
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.
I skipped over all the columns that must inherently be the same over here.
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
jgallagher
left a comment
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.
Changes LGTM - just a few questions on some of the output files
nexus/reconfigurator/planning/tests/output/blueprint_builder_initial_diff.txt
Outdated
Show resolved
Hide resolved
nexus/reconfigurator/planning/tests/output/planner_nonprovisionable_2_2a.txt
Outdated
Show resolved
Hide resolved
nexus/reconfigurator/planning/tests/output/planner_nonprovisionable_2_2a.txt
Outdated
Show resolved
Hide resolved
…er use it (#5341) In #5270, we need determinism not just from blueprints but also collections. So move the UuidRng into a common place. As part of that, I also decided to make it its own crate and write some documentation about it, making it more generic along the way. I think this should be a pretty clean representation of what this is trying to do.
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
|
@jgallagher accepted this over chat (doesn't have access to GH right now), so landing. |
While developing #5238, I noticed that the output was getting significantly busier and less aligned. I decided to prototype out using
tabledto 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:
Blueprint::diff_sledsandBlueprint::diff_sleds_from_collectiontoBlueprint::diff_since_blueprintanddiff_since_collectionrecently.diff_since_blueprint's arguments so thatselfis after and the argument is before, to align withdiff_since_collection. (I found that surprising!)OmicronZonesDifftoBlueprintDiff, since it's going to contain a lot more than zones.Depends on #5238 and #5341.
TODO: