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

jason810496 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 70913ba9727 Let area:kubernetes-tests label force the Kubernetes tests 
job (#69519)
70913ba9727 is described below

commit 70913ba9727683e83af61039eec9e7d54d77fa5f
Author: Jason(Zhe-You) Liu <[email protected]>
AuthorDate: Wed Jul 8 16:24:58 2026 +0900

    Let area:kubernetes-tests label force the Kubernetes tests job (#69519)
    
    * Let area:kubernetes-tests label force the Kubernetes tests job
    
    Contributors validating a change whose impact selective-checks'
    file-path heuristics miss previously had to reach for `full tests
    needed`, which pulls in the entire test matrix. Reusing the existing
    `area:kubernetes-tests` triage label lets them force just the
    Kubernetes tests job instead.
    
    * Add a test for the kubernetes-tests label with no changed files
    
    Covers a label-only trigger (e.g. added after the fact to an existing
    PR) to confirm the forced job doesn't depend on the file-based
    heuristics also matching.
---
 dev/breeze/doc/ci/04_selective_checks.md           |  1 +
 .../src/airflow_breeze/utils/selective_checks.py   |  7 ++++++
 dev/breeze/tests/test_selective_checks.py          | 27 ++++++++++++++++++++++
 3 files changed, 35 insertions(+)

diff --git a/dev/breeze/doc/ci/04_selective_checks.md 
b/dev/breeze/doc/ci/04_selective_checks.md
index 1f6c9ef2bb0..13a7e39f66f 100644
--- a/dev/breeze/doc/ci/04_selective_checks.md
+++ b/dev/breeze/doc/ci/04_selective_checks.md
@@ -627,6 +627,7 @@ This table summarizes the labels you can use on PRs to 
control the selective che
 
|----------------------------------|----------------------------------|-------------------------------------------------------------------------------------------|
 | all versions                     | all-versions, *-versions-*       | Run 
tests for all python and k8s versions.                                          
      |
 | allow suspended provider changes | allow-suspended-provider-changes | Allow 
changes to suspended providers.                                                 
    |
+| area:kubernetes-tests            | run-kubernetes-tests             | If 
set, the Kubernetes tests job is run regardless of changed files (does not 
force the full test matrix). |
 | canary                           | is-canary-run                    | If 
set, the PR run from apache/airflow repo behaves as `canary` run.               
       |
 | debug ci resources               | debug-ci-resources               | If 
set, then debugging resources is enabled during parallel tests and you can see 
them.   |
 | default versions only            | all-versions, *-versions-*       | If 
set, the number of Python and Kubernetes, DB versions are limited to the 
default ones. |
diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py 
b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
index 1cb4ded1496..89baca95145 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -92,6 +92,7 @@ UPGRADE_TO_NEWER_DEPENDENCIES_LABEL = "upgrade to newer 
dependencies"
 USE_PUBLIC_RUNNERS_LABEL = "use public runners"
 ALLOW_PROVIDER_DEPENDENCY_BUMP_LABEL = "allow provider dependency bump"
 SKIP_COMMON_COMPAT_CHECK_LABEL = "skip common compat check"
+AREA_KUBERNETES_TESTS_LABEL = "area:kubernetes-tests"
 ALL_CI_SELECTIVE_TEST_TYPES = "API Always CLI Core Other Serialization"
 
 ALL_PROVIDERS_SELECTIVE_TEST_TYPES = (
@@ -1079,6 +1080,12 @@ class SelectiveChecks:
 
     @cached_property
     def run_kubernetes_tests(self) -> bool:
+        if AREA_KUBERNETES_TESTS_LABEL in self._pr_labels:
+            console_print(
+                "[warning]Running Kubernetes tests because "
+                f"label '{AREA_KUBERNETES_TESTS_LABEL}' is in 
{self._pr_labels}[/]"
+            )
+            return True
         return self._should_be_run(FileGroupForCi.KUBERNETES_FILES)
 
     @cached_property
diff --git a/dev/breeze/tests/test_selective_checks.py 
b/dev/breeze/tests/test_selective_checks.py
index 694ecdbc301..43a5e0081bc 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -3556,6 +3556,33 @@ def 
test_individual_providers_excludes_platform_excluded_on_arm():
         assert "Providers[ibm.mq]" in amd_output
 
 
+def test_run_kubernetes_tests_forced_by_label():
+    """`area:kubernetes-tests` forces the Kubernetes tests job without pulling 
in
+    the full test matrix, unlike `full tests needed`."""
+    checks = SelectiveChecks(
+        files=("INTHEWILD.md",),
+        commit_ref=NEUTRAL_COMMIT,
+        github_event=GithubEvents.PULL_REQUEST,
+        default_branch="main",
+        pr_labels=("area:kubernetes-tests",),
+    )
+    assert checks.run_kubernetes_tests is True
+    assert checks.full_tests_needed is False
+
+
+def test_run_kubernetes_tests_forced_by_label_with_no_changed_files():
+    """The label still forces the Kubernetes tests job even when no files 
changed."""
+    checks = SelectiveChecks(
+        files=(),
+        commit_ref=NEUTRAL_COMMIT,
+        github_event=GithubEvents.PULL_REQUEST,
+        default_branch="main",
+        pr_labels=("area:kubernetes-tests",),
+    )
+    assert checks.run_kubernetes_tests is True
+    assert checks.full_tests_needed is False
+
+
 def test_filter_platform_excluded_test_types_handles_all_shapes():
     """Direct unit check of the in-place filter for the three Providers[...] 
shapes."""
     checks = SelectiveChecks(

Reply via email to