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

vatsrahul1001 pushed a commit to branch skip-unreleased-current-version-compat
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to 
refs/heads/skip-unreleased-current-version-compat by this push:
     new fc2c263b73e Exclude the current unreleased branch version from the 
providers compatibility matrix
fc2c263b73e is described below

commit fc2c263b73e89c76b8bac4e60eb69a45ab1dcf23
Author: Rahul Vats <[email protected]>
AuthorDate: Sun Oct 18 17:10:24 2026 +0530

    Exclude the current unreleased branch version from the providers 
compatibility matrix
    
    The version-bump commit that opens a vX-Y-test branch adds the new X.Y.0 to 
PROVIDERS_COMPATIBILITY_TESTS_MATRIX, but that version is not released until 
GA. Until then the OpenLineage and provider compatibility jobs try to pull 
apache/airflow:X.Y.0 (image and PyPI package) and fail for the whole beta and 
RC phase, leaving the branch CI red when it needs to be green to cut the RC.
    
    Drop the matrix entry whose airflow-version equals the current branch 
version so those jobs skip it while unreleased. The entry runs again once the 
branch bumps to the next patch and X.Y.0 is a real release, so no coverage is 
lost on main or on released versions.
---
 dev/breeze/doc/ci/04_selective_checks.md           |  2 +-
 .../src/airflow_breeze/utils/selective_checks.py   | 14 +++++++-
 dev/breeze/tests/test_selective_checks.py          | 38 +++++++++++++++++++++-
 3 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/dev/breeze/doc/ci/04_selective_checks.md 
b/dev/breeze/doc/ci/04_selective_checks.md
index f2955c32214..2f788e669f4 100644
--- a/dev/breeze/doc/ci/04_selective_checks.md
+++ b/dev/breeze/doc/ci/04_selective_checks.md
@@ -635,7 +635,7 @@ GitHub Actions to pass the list of parameters to a command 
to execute
 | postgres-exclude                                        | Which versions of 
Postgres to exclude for tests as JSON array                                     
      | []                                       |      |
 | postgres-versions                                       | Which versions of 
Postgres to use for tests as JSON array                                         
      | \['12'\]                                 |      |
 | prod-image-build                                        | Whether PROD image 
build is needed                                                                 
     | true                                     |      |
-| providers-compatibility-tests-matrix                    | Matrix of 
providers compatibility tests: (python_version, airflow_version, 
removed_providers)           | \[{}\]                                   |      |
+| providers-compatibility-tests-matrix                    | Matrix of 
providers compatibility tests: (python_version, airflow_version, 
removed_providers). Excludes unbuilt python versions and the entry whose 
airflow_version equals the current branch version (unreleased on a vX-Y-test 
branch until GA) | \[{}\]                                   |      |
 | providers-test-types-list-as-strings-in-json            | Which test types 
should be run for unit tests for providers                                      
       | Providers Providers\[-google\]           | *    |
 | pyproject-toml-changed                                  | When 
pyproject.toml changed in the PR.                                               
                   | false                                    |      |
 | python-versions                                         | List of python 
versions to use for that build                                                  
         | \['3.11'\]                               |      |
diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py 
b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
index 511ebc96e01..82f18b2df9d 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -66,6 +66,7 @@ from airflow_breeze.global_constants import (
     SelectiveTestType,
     all_helm_test_packages,
     all_selective_core_test_types,
+    get_airflow_version,
     providers_test_type,
 )
 from airflow_breeze.utils.console import console_print, get_console
@@ -2132,12 +2133,23 @@ class SelectiveChecks:
 
     @cached_property
     def providers_compatibility_tests_matrix(self) -> str:
-        """Provider compatibility input matrix for the current run. Filter out 
python versions not built"""
+        """Provider compatibility input matrix for the current run.
+
+        Filters out python versions that are not built. Also drops the entry 
whose
+        ``airflow-version`` matches the current branch version: on a 
``vX-Y-test``
+        branch the just-bumped ``X.Y.0`` is added to the matrix by the 
version-bump
+        commit before it is released, so compat jobs that pull the released
+        ``apache/airflow:X.Y.0`` image/package would fail until GA. The entry 
starts
+        running again once the branch bumps to the next patch (``X.Y.1``) and 
``X.Y.0``
+        is a real release.
+        """
+        current_airflow_version = get_airflow_version()
         return json.dumps(
             [
                 check
                 for check in PROVIDERS_COMPATIBILITY_TESTS_MATRIX
                 if check["python-version"] in self.python_versions
+                and check["airflow-version"] != current_airflow_version
             ]
         )
 
diff --git a/dev/breeze/tests/test_selective_checks.py 
b/dev/breeze/tests/test_selective_checks.py
index a4846a09756..98ba954c4d7 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -38,6 +38,7 @@ from airflow_breeze.global_constants import (
     NUMBER_OF_LOW_DEP_SLICES,
     PROVIDERS_COMPATIBILITY_TESTS_MATRIX,
     GithubEvents,
+    get_airflow_version,
 )
 from airflow_breeze.utils.functools_cache import clearable_cache
 from airflow_breeze.utils.packages import get_available_distributions
@@ -3524,6 +3525,7 @@ def test_has_migrations(files: tuple[str, ...], 
has_migrations: bool):
                         check
                         for check in PROVIDERS_COMPATIBILITY_TESTS_MATRIX
                         if check["python-version"] == 
DEFAULT_PYTHON_MAJOR_MINOR_VERSION
+                        and check["airflow-version"] != get_airflow_version()
                     ]
                 ),
             },
@@ -3531,7 +3533,15 @@ def test_has_migrations(files: tuple[str, ...], 
has_migrations: bool):
         ),
         pytest.param(
             ("all versions",),
-            {"providers-compatibility-tests-matrix": 
json.dumps(PROVIDERS_COMPATIBILITY_TESTS_MATRIX)},
+            {
+                "providers-compatibility-tests-matrix": json.dumps(
+                    [
+                        check
+                        for check in PROVIDERS_COMPATIBILITY_TESTS_MATRIX
+                        if check["airflow-version"] != get_airflow_version()
+                    ]
+                )
+            },
             id="full tests",
         ),
     ],
@@ -3547,6 +3557,32 @@ def test_provider_compatibility_checks(labels: 
tuple[str, ...], expected_outputs
     assert_outputs_are_printed(expected_outputs, str(stderr))
 
 
+@patch("airflow_breeze.utils.selective_checks.get_airflow_version")
+def 
test_provider_compatibility_matrix_excludes_current_unreleased_version(mock_get_airflow_version):
+    # The current branch's own version is added to the matrix by the 
version-bump commit before it is
+    # released; it must be excluded so compat jobs don't try to pull an 
image/package that is not published yet.
+    current_version = 
PROVIDERS_COMPATIBILITY_TESTS_MATRIX[-1]["airflow-version"]
+    mock_get_airflow_version.return_value = current_version
+    stderr = SelectiveChecks(
+        files=(),
+        commit_ref=NEUTRAL_COMMIT,
+        github_event=GithubEvents.PULL_REQUEST,
+        pr_labels=("all versions",),
+        default_branch="main",
+    )
+    expected = json.dumps(
+        [
+            check
+            for check in PROVIDERS_COMPATIBILITY_TESTS_MATRIX
+            if check["airflow-version"] != current_version
+        ]
+    )
+    assert_outputs_are_printed({"providers-compatibility-tests-matrix": 
expected}, str(stderr))
+    assert f'"airflow-version": "{current_version}"' not in 
get_outputs_from_stderr(str(stderr)).get(
+        "providers-compatibility-tests-matrix", ""
+    )
+
+
 @pytest.mark.parametrize(
     ("files", "expected_outputs", "default_branch", "pr_labels"),
     [

Reply via email to