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

potiuk pushed a commit to branch fork-ci-test-merge-commit
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 2291f5b07f3007f46cca83911861ad6555d6ede2
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Nov 16 02:14:03 2026 +0900

    Retry when the fork run's merge report cannot be read
    
    An unreadable job list looked like a run that merged nothing, so its
    head commit could be compared as tested as it is and the result kept
    in the marker, although its jobs may have tested a merge.
    
    Generated-by: Claude Opus 5
    Claude-Session: https://claude.ai/code/session_01NyQq9U7i5HhjDgrQ9qd3gq
---
 .../src/airflow_breeze/utils/fork_ci_reconcile.py     | 19 +++++++++++++++----
 dev/breeze/tests/test_fork_ci_reconcile.py            | 11 ++++++++++-
 2 files changed, 25 insertions(+), 5 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 b4b96d7eb2e..4bd11898f3f 100644
--- a/dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py
+++ b/dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py
@@ -1963,9 +1963,15 @@ def read_tested_merge(
     fork: ForkObservation,
     read_jobs: ReadJobs,
 ) -> ForkRunMerge | None:
-    """``find_tested_merge`` of the pull request's fork run; None when its 
jobs cannot be read."""
+    """
+    ``find_tested_merge`` of the pull request's fork run.
+
+    :raises GitHubError: when its jobs cannot be read, which says nothing 
about whether it merged.
+    """
     jobs = read_run_jobs(client, pr, fork, read_jobs)
-    return None if jobs is None else find_tested_merge(jobs)
+    if jobs is None:
+        raise GitHubError(f"could not read the jobs of {fork.run_url}")
+    return find_tested_merge(jobs)
 
 
 class JobStatusReporter:
@@ -2664,9 +2670,14 @@ def compare_with_base(
     ``per_page`` does not limit): a pull request with more is listed with the 
files endpoint instead,
     while a base branch that changed more cannot be checked until the branch 
is rebased.
 
-    :param find_tested_merge: the merge the fork run reports it tested, None 
when it reports none.
+    :param find_tested_merge: the merge the fork run reports it tested, None 
when it reports none;
+        raises GitHubError when the report cannot be read.
     """
-    tested = find_tested_merge()
+    try:
+        tested = find_tested_merge()
+    except GitHubError as e:
+        console_print(f"[warning]#{pr.number}: could not read which merge the 
fork run tested: {e}[/]")
+        return None
     if tested is not None:
         # The jobs tested that merge, not the head commit as it is, so the 
head commit's own base
         # says nothing about what was tested.
diff --git a/dev/breeze/tests/test_fork_ci_reconcile.py 
b/dev/breeze/tests/test_fork_ci_reconcile.py
index 507f7d83947..fd9fd897884 100644
--- a/dev/breeze/tests/test_fork_ci_reconcile.py
+++ b/dev/breeze/tests/test_fork_ci_reconcile.py
@@ -3079,7 +3079,16 @@ def test_read_tested_merge_reads_the_jobs_once(client):
 def test_read_tested_merge_without_readable_jobs(client):
     client.get_run_jobs.side_effect = GitHubError("gh api failed: HTTP 502")
 
-    assert read_tested_merge(client, _pr(), COMPLETED_RUN, {}) is None
+    with pytest.raises(GitHubError):
+        read_tested_merge(client, _pr(), COMPLETED_RUN, {})
+
+
+def test_compare_with_base_waits_for_a_readable_merge_report(client):
+    def unreadable():
+        raise GitHubError("could not read the jobs")
+
+    assert compare_with_base(client, REPO, _pr(), 
find_tested_merge=unreadable) is None
+    client.rest_get.assert_not_called()
 
 
 def _fork_job(name, status="completed", conclusion="success", url=None):

Reply via email to