refactor: show table headers in console and handle exits #1216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR restructures the console rendering code to show table headers of
verify-policycommand, centralize table creation, add per-dependency rendering, move check-summary updates to the analyzer, clean up progress handling, and ensure the console output is checked for anyProcessingand marked asFailedbefore stopping or exiting.Description of changes
Component ID,PURL,Policy Nameforverify-policycommand.TableBuilderto centralize table construction and avoid repetitive table-building code. Many smaller helper methods were added (e.g._make_checks_table,_make_failed_checks_table,_make_summary_table,mark_failed).Dependencyclass to represent and render per-dependency analysis sections (description, progress, failed checks, and summary) and allow rendering for dependency lists.RichConsoleHandlerwas refactored to compose the live layout from reusable tables and dependencymake_layout().update_checks_summary()calls now happen fromsrc/macaron/slsa_analyzer/analyzer.pyfor both the main record and dependency records so the console UI receives updates as analysis completes.remove_progress_bar()is called when checks complete to ensure the progress task is removed from the live progress bar.mark_failed()method was added/extended to convert any in-progressStatusentries to a failed state and is invoked when stopping or exiting.docs/source/pages/developers_guide/style_guide.rstthat documents themacaron.consoleuse and how to interact with the rich handler.Related issues
N/A
Checklist
verifiedlabel should appear next to all of your commits on GitHub.