This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch fix-ci-passed-cancelled-runs
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 89a0f621675f50d93fcf47edb7e3da9a65fcdeb0
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Oct 24 20:47:47 2026 +0200

    Accept the cancelled-run CI passed name in the fork CI tampering check
    
    A cancelled ci-amd.yml run now reports its CI passed job as "CI passed (run
    cancelled)". Without the name in the gated-run jobs, a run of a gated pull
    request that a newer push cancelled would be taken for project CI work and
    close the pull request as tampering with the gate.
    
    Generated-by: Claude Opus 5
---
 dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py |  9 +++++----
 dev/breeze/tests/test_fork_ci_reconcile.py               | 10 ++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py 
b/dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py
index 35189f1a8f4..3c4eeafb70d 100644
--- a/dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py
+++ b/dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py
@@ -79,12 +79,13 @@ GATE_JOB_NAME = "Fork CI gate"
 # Jobs that also run, without needing the gate, in a run the gate left to fork 
CI: main's
 # check-run-needed (no steps outside schedule and push runs) and the "CI 
passed" gate job of the
 # merge ruleset, which reports as "CI passed (project CI not run)" when 
project CI was skipped and
-# as "CI passed" when a newer push cancelled the run before build-info 
started. Like the gate, each
-# must finish within GATE_MAX_DURATION, so project CI work moved under one of 
these names counts.
-# Each runs once, so the names of one job are grouped: repeating short jobs 
under them counts too.
+# as "CI passed (run cancelled)" when a newer push cancelled the run before 
build-info started --
+# "CI passed" in a workflow from before that name. Like the gate, each must 
finish within
+# GATE_MAX_DURATION, so project CI work moved under one of these names counts. 
Each runs once, so
+# the names of one job are grouped: repeating short jobs under them counts too.
 GATED_RUN_JOBS = (
     frozenset({"Check if the run is needed"}),
-    frozenset({"CI passed (project CI not run)", "CI passed"}),
+    frozenset({"CI passed (project CI not run)", "CI passed (run cancelled)", 
"CI passed"}),
 )
 GATED_RUN_JOB_NAMES = frozenset[str]().union(*GATED_RUN_JOBS)
 BOT_LOGINS = frozenset({"github-actions", "github-actions[bot]"})
diff --git a/dev/breeze/tests/test_fork_ci_reconcile.py 
b/dev/breeze/tests/test_fork_ci_reconcile.py
index be4e1dcb15f..3f7d56f7c14 100644
--- a/dev/breeze/tests/test_fork_ci_reconcile.py
+++ b/dev/breeze/tests/test_fork_ci_reconcile.py
@@ -719,6 +719,16 @@ def _job(
             False,
             id="cancelled-before-the-gate-started",
         ),
+        pytest.param(
+            [
+                _job("Check if the run is needed", "cancelled", started=False),
+                _job("Fork CI gate", "cancelled", started=False),
+                _job("Build info", "cancelled", started=False),
+                _job("CI passed (run cancelled)", "success"),
+            ],
+            False,
+            id="cancelled-run-reporting-ci-passed-run-cancelled",
+        ),
         pytest.param(
             [_job("Fork CI gate", "cancelled", minutes=30, started=False)],
             False,

Reply via email to