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

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

commit 7d6364146e7f14e3af2f7ab3c4c00287d908ca08
Author: Shahar Epstein <[email protected]>
AuthorDate: Tue Oct 27 19:41:15 2026 +0200

    Keep breeze verify working when dry-run is on (#75713)
    
    With dry-run on, run_command skips every command and returns empty
    output. breeze verify only reads git state to list the checks a change
    needs, so skipping those queries made it crash with an IndexError
    instead of answering.
    
    (cherry picked from commit a5ff71dffd38c4697b2e2321a5bc9f1529ba553a)
---
 dev/breeze/src/airflow_breeze/commands/verify_commands.py | 10 +++++++++-
 dev/breeze/tests/test_verify_commands.py                  | 15 +++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/dev/breeze/src/airflow_breeze/commands/verify_commands.py 
b/dev/breeze/src/airflow_breeze/commands/verify_commands.py
index 0dc8555a8cc..7233e202def 100644
--- a/dev/breeze/src/airflow_breeze/commands/verify_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/verify_commands.py
@@ -42,7 +42,15 @@ APACHE_AIRFLOW_URL = 
re.compile(r"github\.com[:/]apache/airflow(\.git)?/?$")
 
 
 def _run_git(*args: str) -> CompletedProcess:
-    return run_command(["git", *args], capture_output=True, text=True, 
check=False, cwd=AIRFLOW_ROOT_PATH)
+    # Read-only queries: dry-run would skip them and return empty output.
+    return run_command(
+        ["git", *args],
+        capture_output=True,
+        text=True,
+        check=False,
+        cwd=AIRFLOW_ROOT_PATH,
+        dry_run_override=False,
+    )
 
 
 def find_default_base_ref() -> str | None:
diff --git a/dev/breeze/tests/test_verify_commands.py 
b/dev/breeze/tests/test_verify_commands.py
index 0aebf5f219b..005f9962086 100644
--- a/dev/breeze/tests/test_verify_commands.py
+++ b/dev/breeze/tests/test_verify_commands.py
@@ -32,6 +32,7 @@ from airflow_breeze.commands.verify_commands import (
     has_merged_commits_missing_from,
     verify,
 )
+from airflow_breeze.utils.shared_options import set_dry_run
 
 ANSI = re.compile(r"\x1b\[[0-9;]*m")
 
@@ -360,3 +361,17 @@ def 
test_merged_commits_missing_from_the_base_are_warned_about(mock_files, mock_
     assert warning in " ".join(ANSI.sub("", stream).split())
     if as_json:
         assert json.loads(result.stdout)["base_ref"] == "upstream/main"
+
+
+@patch(
+    "airflow_breeze.utils.run_utils.subprocess.run",
+    autospec=True,
+    side_effect=[
+        CompletedProcess(args=[], returncode=0, stdout="abc123\n", stderr=""),
+        CompletedProcess(args=[], returncode=0, stdout="file.py\n", stderr=""),
+        CompletedProcess(args=[], returncode=0, stdout="", stderr=""),
+    ],
+)
+def test_changed_files_are_computed_in_dry_run(mock_subprocess_run):
+    set_dry_run(True)
+    assert get_changed_files_against("main") == ("file.py",)

Reply via email to