This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 5a94a01e0c6a5e7506ef0eab875e83da852878f9
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Apr 20 18:41:56 2026 +0200
[v3-2-test] Only fail provider dependency checks on main (#65551) (#65552)
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.
(cherry picked from commit 3dd2ba09ec6766d3996ac9615aaf224d98f7a5cc)
Co-authored-by: Jarek Potiuk <[email protected]>
---
.../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 ca7fbef3a3d..aae6965dcff 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -1776,6 +1776,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,
@@ -2003,6 +2008,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 3838f779e4c..725e77ee399 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -3128,6 +3128,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."""
@@ -3459,6 +3495,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."""