From 86f72481ce961818fecfbacd7d7f9fd0104ff3ad Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 2 Apr 2026 15:14:06 +0200 Subject: [PATCH] Add `breeze pr stats` command for open PR statistics by area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new `breeze pr stats` command that produces aggregate statistics of open PRs in the Airflow repo, split by area label. The command uses GraphQL to fetch all open PRs and displays two tables: 1. **Triaged PRs — Final State**: Shows triaged PRs that were closed or merged since 2026-03-11, with counts and percentages for closed, merged, and author-responded. 2. **Triaged PRs — Still Open**: Shows all open PRs grouped by area with draft/non-draft counts, contributor counts, triage status, response rates, ready-for-review status, time since triager drafted the PR, and time since the author's last interaction. Features: - Cached interaction data (keyed by updated_at) to avoid re-fetching unchanged PRs on subsequent runs - `--clear-cache` flag to force fresh data - Detects triager draft conversions via GraphQL timeline events - Tracks closed vs merged triaged PRs with area breakdown - Footer header rows on both tables for readability --- dev/breeze/doc/13_pr_tasks.rst | 10 + dev/breeze/doc/images/output_pr.svg | 12 +- dev/breeze/doc/images/output_pr.txt | 2 +- dev/breeze/doc/images/output_pr_stats.svg | 116 +++ dev/breeze/doc/images/output_pr_stats.txt | 1 + ...utput_setup_check-all-params-in-groups.svg | 74 +- ...utput_setup_check-all-params-in-groups.txt | 2 +- ...output_setup_regenerate-command-images.svg | 6 +- ...output_setup_regenerate-command-images.txt | 2 +- .../airflow_breeze/commands/pr_commands.py | 706 ++++++++++++++++++ .../commands/pr_commands_config.py | 13 +- .../src/airflow_breeze/utils/pr_cache.py | 1 + uv.lock | 14 +- 13 files changed, 909 insertions(+), 50 deletions(-) create mode 100644 dev/breeze/doc/images/output_pr_stats.svg create mode 100644 dev/breeze/doc/images/output_pr_stats.txt diff --git a/dev/breeze/doc/13_pr_tasks.rst b/dev/breeze/doc/13_pr_tasks.rst index 4084bee61b83a..d0f411f0703b9 100644 --- a/dev/breeze/doc/13_pr_tasks.rst +++ b/dev/breeze/doc/13_pr_tasks.rst @@ -440,6 +440,16 @@ Example usage # Verbose mode — show individual skip reasons during filtering breeze pr auto-triage --verbose +PR statistics +""""""""""""" + +The ``breeze pr stats`` command produces aggregate statistics of open PRs grouped by area label. + +.. image:: ./images/output_pr_stats.svg + :target: https://raw.githubusercontent.com/apache/airflow/main/dev/breeze/doc/images/output_pr_stats.svg + :width: 100% + :alt: Breeze PR stats + ----- Next step: Follow the `Advanced breeze topics <14_advanced_breeze_topics.rst>`__ instructions to learn how to manage GitHub diff --git a/dev/breeze/doc/images/output_pr.svg b/dev/breeze/doc/images/output_pr.svg index 97cc4d5efe937..1051b307b09ca 100644 --- a/dev/breeze/doc/images/output_pr.svg +++ b/dev/breeze/doc/images/output_pr.svg @@ -1,4 +1,4 @@ - +