Skip to content

Commit 0ffb5a6

Browse files
Implement prioritized job pattern checking
This commit introduces a prioritized, cascading job pattern checking feature to the `print_workflow_run_errors.py` script. Key changes: - The `--job-pattern` argument now uses `action='append'`, allowing users to specify multiple patterns. These are checked in the order provided. - If no `--job-pattern` is specified by the user, a default prioritized sequence is used: `['^build.*', '^test.*', '.*']`. - The script iterates through the determined list of patterns: - For the first pattern that matches jobs AND has failures among those matched jobs, the script processes and displays logs for those failures. - It then stops checking subsequent patterns. - If a pattern results in no matching jobs, or if all matching jobs succeeded, the script moves to the next pattern in the sequence. - Informative messages are printed to stderr indicating which pattern is being checked, the outcome for that pattern, and if subsequent patterns are skipped. - The main log processing loop has been refactored into a helper function `_process_and_display_logs_for_failed_jobs` for better organization. - Handles invalid regular expressions within the pattern list by warning the user and skipping the invalid pattern.
1 parent 4c2fb08 commit 0ffb5a6

File tree

1 file changed

+195
-206
lines changed

1 file changed

+195
-206
lines changed

0 commit comments

Comments
 (0)