Add Tier2 Quarantine Status Dashboard Generator#1
Closed
rnetser wants to merge 24 commits into
Closed
Conversation
Rewrite quarantine stats dashboard generator with support for: - Multi-repo scanning (RedHatQE/openshift-virtualization-tests, RedHatQE/cnv-tests) - Per-version quarantine statistics across all branches (main, cnv-X.Y) - CLI table output with version and team breakdowns - HTML dashboard with tabbed interface for quarantined test details - JSON output option via --json flag - Repo-specific team mappings and branch filtering Also add Path and relative_to to flake8 fcn_exclude_functions.
- Combine both repos into single Version Summary table with Repository column - Combine team breakdowns into unified table with all repo/version columns - Add "compute" -> "virt" folder mapping for team grouping - Remove unused format_repo_version_table() function (now format_unified_version_table) - Add --workdir and --output-dir CLI arguments for flexibility - Write JSON output to file instead of stdout
Address 9 review comments: - Add ClassVar annotations to mutable class attributes (DEFAULT_EXCLUDED_FOLDERS, DEFAULT_FOLDER_MAPPINGS) - Add return type annotations to __init__ methods (TestScanner, DashboardGenerator) - Change bare Exception to specific types (SyntaxError, OSError, UnicodeDecodeError) - Add error logging for branch restore failures in scan_branch - Use timezone-aware datetime (timezone.utc) for timestamps - Make boolean args keyword-only in run_multi_repo_mode - Merge multiple startswith/endswith calls into tuple form
- cleanup_workdir: Remove ignore_errors=True and add proper error handling with logging and re-raise for visibility - is_valid_branch: Change bool() wrapper to explicit 'is not None' check
- Replace print() with structured logging (simple_logger) - Change to specific function imports instead of module imports - Use tempfile.gettempdir() for WORKDIR instead of hardcoded path - Fix FCN001 by adding keyword arguments to function calls - Remove unused code (format_stats_table, _generate_team_rows) - Remove "Breakdown by Team" section from dashboard - Add container run example to help text - Use SystemExit instead of exit() for proper exit handling
- Add logging for SyntaxError in file parsing - Rename single-letter loop variable 'i' to 'line_idx' - Rename single-letter lambda variable 't' to 'test'
Use pyhelper_utils.shell.run_command instead of subprocess.run for git operations in generate_dashboard.py to follow repo standards.
- Fix variable shadowing: rename line to stripped_line in loop - Replace single-letter 't' with descriptive names in lambdas - Add HTML escaping for user-controlled strings (defense in depth) - Extract duplicate path logic to get_display_path utility function
Git outputs progress messages to stderr even on success. run_command has verify_stderr=True by default, causing successful git operations to be treated as failures.
- Add MAX_DECORATOR_SEARCH_LINES class constant for decorator search range - Extract CSS/HTML from generate() into _render_css(), _render_header(), _render_footer() helpers - Make generate() a thin orchestrator for better maintainability
float('4.10') equals 4.1, causing 4.10 < 4.9 in sorting.
Fixed by parsing version into integer tuple (major, minor) for
correct semantic version ordering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds a quarantine dashboard generator that scans both RedHatQE/openshift-virtualization-tests and RedHatQE/cnv-tests repositories to generate a comprehensive HTML dashboard showing quarantine statistics per version and team.
Changes Made
scripts/quarantine_stats/generate_dashboard.py- main dashboard generator scriptpyproject.toml- add console script entry pointquarantine-dashboard.flake8- configuration adjustmentsFeatures
CLI Options
--keep-clones- Keep cloned repositories after processing--json- Output JSON instead of HTML--workdir- Specify working directory for clones--output-dir- Specify output directory for dashboard--github-token- GitHub token for API accessUsage
Test Plan
uv run quarantine-dashboardand verify HTML output is generateduv run quarantine-dashboard --jsonand verify JSON output