Skip to content

[omdb] TUI for inspecting support bundles #8034

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

Merged
merged 48 commits into from
May 7, 2025
Merged

[omdb] TUI for inspecting support bundles #8034

merged 48 commits into from
May 7, 2025

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Apr 23, 2025

Adds the omdb nexus sb inspect command, which includes a dashboard that can be used inspect support bundles.

  • dev-tools/omdb/src/bin/omdb/nexus.rs includes the integration of this command. Support bundles may be accessed by: UUID, path, or by "most recently created".
  • dev-tools/support-bundle-reader-lib exposes a dashboard for actually running a TUI. This TUI acts on a dynamic SupportBundleAccessor trait, which can implement a file-opening and file-reader interface, regardless of where the support bundle is stored.
  • dev-tools/support-bundle-reader-lib/src/dashboard.rs actually implements the ratatui interface, which allows users to inspect parts of the support bundle, and optionally dump the contents of the bundles to stdout.

image

smklein added 30 commits April 11, 2025 10:33
Fmt
Base automatically changed from omdb-sb to main April 29, 2025 18:41
@smklein smklein marked this pull request as ready for review April 30, 2025 20:01
}
}

// Access for: The nexus internal API
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might need to refactor this crate a bit, but I'm expecting we'll also add one of these for ExternalApiAccess if we want to re-use this crate in the CLI

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for ExternalApiAccess would be a tool consuming the support-bundle-reader-lib that a customer could use rather than omdb?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am expecting that:

  • The CLI can add an implementation using "ExternalApiAccess" (or we can add one in this crate; I don't really care strongly where it lives).
  • The CLI will depend on support-bundle-reader-lib. We could use feature flags to let them avoid building against the internal API at all.
  • Customers aren't really supposed to be using omdb -- it's a support staff binary which exists in the switch zone, and requires techport access to use.

@smklein
Copy link
Collaborator Author

smklein commented May 6, 2025

Friendly ping, could I get eyes on this?

}
}

// Access for: The nexus internal API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for ExternalApiAccess would be a tool consuming the support-bundle-reader-lib that a customer could use rather than omdb?


async fn select_up(&mut self, count: usize) -> Result<()> {
self.selected = self.selected.saturating_sub(count);
if matches!(self.file, FileState::Open { .. }) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm maybe I am missing something, but if a file is in the "open" state, why do we proceed to open_and_buffer? Unless the naming is weird wouldn't we be opening the file if it's currently closed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand now that I read some more of the code, but doesn't navigating around cause us to call open_and_buffer again on a potentially already opened file that the toggle method has already setup for us? It seems like maybe we want to check if the access is also None?

Copy link
Collaborator Author

@smklein smklein May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is implemented intentionally, but maybe I can make it more clear in the code:

  • When the TUI starts, you see the index of files
  • When you move up/down, you're selecting a different file. The files are still closed though
  • If you press enter, you'll open a file - this is where we buffer the contents
  • If you now move up/down, you're selecting a different file. In this case: the file was open, but you're picking a new file. We want to buffer the new contents, in this case.

I'll add some comments here to make this more clear, and trigger explicitly when self.selected changes

@smklein smklein merged commit 70534c9 into main May 7, 2025
18 checks passed
@smklein smklein deleted the omdb-sb-polish branch May 7, 2025 21:52
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.

None yet

2 participants