Skip to content

Conversation

@sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Mar 15, 2024

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.

TODO:

  • blueprints
  • diffs
  • show warning for modified sleds without a generation bump
  • move metadata to end
  • show DNS metadata in a table?
  • update PR summary above

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
@sunshowers sunshowers marked this pull request as ready for review March 15, 2024 06:12
Copy link
Contributor

@jgallagher jgallagher left a 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!

// parameters inside changed. We need to add additional text to
// make that clearer.
//
// TODO: also print out the exact bits of configuration that
Copy link
Contributor

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?)

Copy link
Contributor Author

@sunshowers sunshowers Mar 15, 2024

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
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Copy link
Collaborator

@davepacheco davepacheco left a 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.

@sunshowers
Copy link
Contributor Author

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).

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
sunshowers added a commit that referenced this pull request Mar 24, 2024
…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.
rcgoodfellow and others added 3 commits March 26, 2024 12:26
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
@sunshowers sunshowers changed the base branch from sunshowers/spr/main.reconfigurator-use-tabled-to-display-blueprints-and-diffs to main March 26, 2024 19:49
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers
Copy link
Contributor Author

sunshowers commented Mar 27, 2024

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.

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.

Ended up agreeing with this in the end -- everything is now left-aligned. This led to:

  • I noticed that with left-aligned text, it looked better if all the zones were together.
  • So I sorted the output by (zone type, zone id) rather than just zone id.
  • After discussing this with Dave, we decided that we should move the zone type to the left of the zone ID.

Created using spr 1.3.6-beta.1
@sunshowers
Copy link
Contributor Author

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.

Comment on lines 83 to 84
+ ├─ in service fd00:1122:3344:105::22
* └─ zone type config changed
Copy link
Contributor Author

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
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the base branch from main to sunshowers/spr/main.reconfigurator-use-tabled-to-display-blueprints-and-diffs-1 March 28, 2024 07:16
Copy link
Contributor

@jgallagher jgallagher left a 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

sunshowers added a commit that referenced this pull request Mar 28, 2024
…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

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the base branch from sunshowers/spr/main.reconfigurator-use-tabled-to-display-blueprints-and-diffs-1 to main March 28, 2024 22:49
@sunshowers sunshowers requested a review from jgallagher March 29, 2024 01:21
@sunshowers
Copy link
Contributor Author

@jgallagher accepted this over chat (doesn't have access to GH right now), so landing.

@sunshowers sunshowers merged commit e5094dc into main Mar 29, 2024
@sunshowers sunshowers deleted the sunshowers/spr/reconfigurator-use-tabled-to-display-blueprints-and-diffs branch March 29, 2024 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants