-
Notifications
You must be signed in to change notification settings - Fork 46
Enhance provider help output with Rich formatting #443
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
Conversation
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.
Pull request overview
This PR enhances the provider help output by integrating Rich library formatting across three providers (Beaker, Container, and Foreman). The changes replace simple logging-based output with formatted tables and syntax-highlighted displays, improving readability and user experience.
Key Changes
- Replaced
logging.info()calls with Rich Console for formatted, colored output in provider help methods - Added syntax highlighting for XML (Beaker job definitions) and YAML (container configurations) using
rich.syntax.Syntax - Converted list outputs to Rich tables using helper functions (
dictlist_to_table,dict_to_table) - Removed the
results_limitparameter across providers in favor of Rich tables managing display
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| broker/providers/foreman.py | Updated hostgroups and hostgroup display to use Rich tables with error handling for empty results |
| broker/providers/container.py | Enhanced image info display with tables and syntax-highlighted YAML configs; added container_app parameter support |
| broker/providers/beaker.py | Converted job listings to Rich tables and added XML syntax highlighting for individual job displays |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Features: - Beaker provider help: - Display individual job XML with syntax highlighting using `rich.syntax.Syntax`. - Format lists of available jobs into `rich` tables. - Container provider help: - Present detailed image information in `rich` tables. - Display image configuration as syntax-highlighted YAML. - Convert lists of available host and app images into `rich` tables. - Add support for the `container_app` parameter to retrieve details for a specific container application. - Foreman provider help: - Render lists of hostgroups and individual hostgroup details in `rich` tables. Refactoring: - Replaced direct `logging.info` calls for user-facing output in `provider_help` methods with `rich.console.Console` for improved presentation. - Removed the `results_limit` parameter, as `rich` tables manage display and filtering more effectively. Configuration: - Integrated `_settings.less_colors` to control color output in the `rich` console, allowing users to disable colors.
|
@JacobCallahan - I just had a try. Looks nice, it works and it contains the same information as before. Thank you! |
|
@knoppi thanks for testing! This is aligned to 0.8, which I'm hoping to release late this month. Also, this outputs to stdout do you can do what you will with that. |
Features:
rich.syntax.Syntax.richtables.richtables.richtables.container_appparameter to retrieve details for a specific container application.richtables.Refactoring:
logging.infocalls for user-facing output inprovider_helpmethods withrich.console.Consolefor improved presentation.results_limitparameter, asrichtables manage display and filtering more effectively.Configuration:
_settings.less_colorsto control color output in therichconsole, allowing users to disable colors.