This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new a48c5b99af4 Fix tag-providers --dry-run failing to find the push
remote (#71303)
a48c5b99af4 is described below
commit a48c5b99af4c03958a819da6fb1264d688ff04ad
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Oct 18 18:54:01 2026 +0200
Fix tag-providers --dry-run failing to find the push remote (#71303)
A dry run short-circuits every run_command, so the `git remote get-url
--push` lookup that picks the apache/airflow remote came back with empty
stdout for all three candidate names and the command aborted with
"Could not find the remote configured to push to apache/airflow".
That makes --dry-run useless for previewing a provider release's tags,
which is exactly when a release manager wants to check them.
---
.../commands/release_management_commands.py | 3 +++
.../tests/test_release_management_commands.py | 28 ++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git
a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index 76d8497f094..25f000901bc 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -1534,6 +1534,9 @@ def tag_providers(
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True,
+ # Read-only lookup, so run it even in dry-run mode: a dry run
returns empty
+ # stdout for every remote, which would make the search below
find nothing.
+ dry_run_override=False,
)
if "apache/airflow.git" in result.stdout:
found_remote = remote
diff --git a/dev/breeze/tests/test_release_management_commands.py
b/dev/breeze/tests/test_release_management_commands.py
index 777120e15ab..68b42608445 100644
--- a/dev/breeze/tests/test_release_management_commands.py
+++ b/dev/breeze/tests/test_release_management_commands.py
@@ -16,6 +16,7 @@
# under the License.
from __future__ import annotations
+import subprocess
from pathlib import Path
from types import SimpleNamespace
@@ -36,6 +37,7 @@ from airflow_breeze.commands.release_management_commands
import (
is_package_in_dist,
)
from airflow_breeze.global_constants import DEFAULT_PYTHON_MAJOR_MINOR_VERSION
+from airflow_breeze.utils import shared_options
@pytest.mark.parametrize(
@@ -386,3 +388,29 @@ def test_prepare_provider_distributions_skip_git_fetch(
assert exc_info.value.code == 0
assert len(fetches) == expected_fetches
+
+
+def test_tag_providers_detects_push_remote_in_dry_run(monkeypatch, tmp_path):
+ commands: list[list[str]] = []
+
+ def fake_run_command(cmd, **kwargs):
+ commands.append(cmd)
+ if cmd[:4] == ["git", "remote", "get-url", "--push"]:
+ if shared_options.get_dry_run(kwargs.get("dry_run_override")):
+ return SimpleNamespace(returncode=0, stdout="")
+ if cmd[-1] == "upstream":
+ return SimpleNamespace(returncode=0,
stdout="https://github.com/apache/airflow.git\n")
+ raise subprocess.CalledProcessError(2, cmd)
+ return SimpleNamespace(returncode=0, stdout="")
+
+ monkeypatch.setattr(release_management_commands, "run_command",
fake_run_command)
+ monkeypatch.setattr(release_management_commands, "AIRFLOW_DIST_PATH",
tmp_path)
+ (tmp_path /
"apache_airflow_providers_amazon-9.29.0-py3-none-any.whl").touch()
+
+ shared_options.set_dry_run(True)
+ try:
+ release_management_commands.tag_providers.callback(clean_tags=False,
release_date="2026-08-06")
+ finally:
+ shared_options.set_dry_run(False)
+
+ assert ["git", "push", "upstream", "providers-amazon/9.29.0"] in commands