From 6263b549fab76f193b58f7bb283d6fc85e187ef4 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Mon, 16 Nov 2026 04:30:49 +0900 Subject: [PATCH] Add breeze commands to move a pull request between project and fork CI Adding `use project ci` by hand left the pull request mergeable on its fork result until the next monitor run, and did not start project CI. The pull_request_target revoke that closed the gap was dropped because that trigger is being disabled, so the maintainer's own command now withholds the result before adding the label, then restarts the pull request. Generated-by: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NyQq9U7i5HhjDgrQ9qd3gq --- dev/breeze/doc/08_ci_tasks.rst | 37 ++++ dev/breeze/doc/images/output_ci.svg | 28 ++- dev/breeze/doc/images/output_ci.txt | 2 +- .../doc/images/output_ci_use-fork-ci.svg | 112 +++++++++++ .../doc/images/output_ci_use-fork-ci.txt | 1 + .../doc/images/output_ci_use-project-ci.svg | 124 ++++++++++++ .../doc/images/output_ci_use-project-ci.txt | 1 + .../airflow_breeze/commands/ci_commands.py | 51 +++++ .../commands/ci_commands_config.py | 19 ++ .../airflow_breeze/utils/fork_ci_github.py | 7 + .../airflow_breeze/utils/fork_ci_pr_move.py | 118 ++++++++++++ dev/breeze/tests/test_fork_ci_github.py | 18 ++ dev/breeze/tests/test_fork_ci_pr_move.py | 177 ++++++++++++++++++ 13 files changed, 686 insertions(+), 9 deletions(-) create mode 100644 dev/breeze/doc/images/output_ci_use-fork-ci.svg create mode 100644 dev/breeze/doc/images/output_ci_use-fork-ci.txt create mode 100644 dev/breeze/doc/images/output_ci_use-project-ci.svg create mode 100644 dev/breeze/doc/images/output_ci_use-project-ci.txt create mode 100644 dev/breeze/src/airflow_breeze/utils/fork_ci_pr_move.py create mode 100644 dev/breeze/tests/test_fork_ci_pr_move.py diff --git a/dev/breeze/doc/08_ci_tasks.rst b/dev/breeze/doc/08_ci_tasks.rst index c4001b658c00e..571237b0454ae 100644 --- a/dev/breeze/doc/08_ci_tasks.rst +++ b/dev/breeze/doc/08_ci_tasks.rst @@ -226,6 +226,43 @@ These are all available flags of ``approve-workflow-runs`` command: :width: 100% :alt: Breeze ci approve-workflow-runs +Moving a pull request between project CI and fork CI +---------------------------------------------------- + +A maintainer moves a single pull request to project CI with the ``use project ci`` label, and back +to fork CI with ``use fork ci`` (AIP-120). The fork CI monitor reacts to the labels only on its next +run, so a fork ``CI passed`` success posted before ``use project ci`` was added still lets the pull +request merge until then, and the label alone does not start project CI. ``use-project-ci`` does both +in order, with your own ``gh`` credentials: it sets a fork ``CI passed`` success on the head commit +to ``pending`` first, then adds ``use project ci`` (removing ``use fork ci``), and closes and reopens +the pull request to start project CI (``--no-restart`` leaves that to the author's next push). A +``CI passed`` success that project CI earned is kept. + +.. code-block:: bash + + breeze ci use-project-ci 12345 + +These are all available flags of ``use-project-ci`` command: + +.. image:: ./images/output_ci_use-project-ci.svg + :target: https://raw.githubusercontent.com/apache/airflow/main/dev/breeze/images/output_ci_use-project-ci.svg + :width: 100% + :alt: Breeze ci use-project-ci + +``use-fork-ci`` labels the pull request ``use fork ci`` instead of ``use project ci``. The monitor +gates it on its next run, and fork CI runs on the author's next push to their fork. + +.. code-block:: bash + + breeze ci use-fork-ci 12345 + +These are all available flags of ``use-fork-ci`` command: + +.. image:: ./images/output_ci_use-fork-ci.svg + :target: https://raw.githubusercontent.com/apache/airflow/main/dev/breeze/images/output_ci_use-fork-ci.svg + :width: 100% + :alt: Breeze ci use-fork-ci + ----- Next step: Follow the `Release management tasks <09_release_management_tasks.rst>`_ guide to learn how diff --git a/dev/breeze/doc/images/output_ci.svg b/dev/breeze/doc/images/output_ci.svg index f0dfe263de90e..700d0402d1088 100644 --- a/dev/breeze/doc/images/output_ci.svg +++ b/dev/breeze/doc/images/output_ci.svg @@ -1,4 +1,4 @@ - +