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 3dd2ba09ec6 Only fail provider dependency checks on main (#65551)
3dd2ba09ec6 is described below
commit 3dd2ba09ec6766d3996ac9615aaf224d98f7a5cc
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Apr 20 17:56:29 2026 +0200
Only fail provider dependency checks on main (#65551)
The provider_dependency_bump and common_compat_changed_without_next_version
checks in selective_checks are meant to guard the main branch from
accidental
release-manager-only changes. On release branches (v3-X-test), those same
changes are expected during cherry-picks, and forcing contributors to set
override labels on every backport adds friction without value.
Skip both checks when the target branch is not main so release-branch PRs
no longer need the override labels.
---
.../src/airflow_breeze/utils/selective_checks.py | 10 ++++
dev/breeze/tests/test_selective_checks.py | 67 ++++++++++++++++++++++
2 files changed, 77 insertions(+)
diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
index 44896190c55..47f84bbb28e 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -1838,6 +1838,11 @@ class SelectiveChecks:
@cached_property
def provider_dependency_bump(self) -> bool:
"""Check for apache-airflow-providers dependency bumps in
pyproject.toml files."""
+ # Only enforce on PRs targeting main. On release branches (e.g.
v3-X-test)
+ # cherry-picks routinely bump provider dependency lower bounds, and the
+ # override label is meant for that flow on main.
+ if self._default_branch != "main":
+ return False
pyproject_files = self._matching_files(
FileGroupForCi.ALL_PYPROJECT_TOML_FILES,
CI_FILE_GROUP_MATCHES,
@@ -2065,6 +2070,11 @@ class SelectiveChecks:
"""
if self._github_event != GithubEvents.PULL_REQUEST:
return False
+ # Only enforce on PRs targeting main. On release branches (e.g.
v3-X-test)
+ # cherry-picked common.compat changes don't follow the '# use next
version'
+ # convention, and the override label is meant for that flow on main.
+ if self._default_branch != "main":
+ return False
if not self._has_common_compat_changed():
return False
diff --git a/dev/breeze/tests/test_selective_checks.py
b/dev/breeze/tests/test_selective_checks.py
index cf402d8818f..21296618fe0 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -3301,6 +3301,42 @@ dependencies = [
).provider_dependency_bump
+@patch("airflow_breeze.utils.selective_checks.run_command")
+def
test_provider_dependency_bump_check_skipped_on_release_branch(mock_run_command):
+ """Test that provider dependency bump check is a no-op on release branches
(v3-X-test)."""
+ old_toml = """
+[project]
+dependencies = [
+ "apache-airflow-providers-common-sql>=1.0.0",
+]
+"""
+ new_toml = """
+[project]
+dependencies = [
+ "apache-airflow-providers-common-sql>=1.1.0",
+]
+"""
+
+ def side_effect(*args, **kwargs):
+ result = Mock()
+ result.returncode = 0
+ if "^:" in args[0][2]:
+ result.stdout = old_toml
+ else:
+ result.stdout = new_toml
+ return result
+
+ mock_run_command.side_effect = side_effect
+
+ assert not SelectiveChecks(
+ files=("providers/amazon/pyproject.toml",),
+ commit_ref=NEUTRAL_COMMIT,
+ pr_labels=(),
+ github_event=GithubEvents.PULL_REQUEST,
+ default_branch="v3-2-test",
+ ).provider_dependency_bump
+
+
@patch("airflow_breeze.utils.selective_checks.run_command")
def test_provider_dependency_bump_check_passes_with_label(mock_run_command):
"""Test that provider dependency bump check passes when label is set."""
@@ -3632,6 +3668,37 @@ dependencies = [
assert result is False
+@patch("airflow_breeze.utils.selective_checks.run_command")
+def
test_common_compat_changed_without_next_version_skipped_on_release_branch(mock_run_command):
+ """Test that common.compat next-version check is a no-op on release
branches (v3-X-test)."""
+ provider_toml = """
+[project]
+dependencies = [
+ "apache-airflow>=2.11.0",
+ "apache-airflow-providers-common-compat>=1.8.0",
+]
+"""
+
+ def side_effect(*args, **kwargs):
+ result = Mock()
+ result.returncode = 0
+ result.stdout = provider_toml
+ return result
+
+ mock_run_command.side_effect = side_effect
+
+ assert not SelectiveChecks(
+ files=(
+
"providers/common/compat/src/airflow/providers/common/compat/file.py",
+ "providers/ftp/src/airflow/providers/ftp/hooks/ftp.py",
+ ),
+ commit_ref=NEUTRAL_COMMIT,
+ pr_labels=(),
+ github_event=GithubEvents.PULL_REQUEST,
+ default_branch="v3-2-test",
+ ).common_compat_changed_without_next_version
+
+
@patch("airflow_breeze.utils.selective_checks.run_command")
def
test_common_compat_changed_without_next_version_bypassed_with_label(mock_run_command):
"""Test that check can be bypassed with 'skip common compat check'
label."""