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

dabla 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 ff0ac285658 Run check-provider-yaml-valid when prek scripts or 
providers config change (#70230)
ff0ac285658 is described below

commit ff0ac28565815a155925ffd304a6b2c2dbe8ed77
Author: David Blain <[email protected]>
AuthorDate: Thu Jul 23 07:20:51 2026 +0200

    Run check-provider-yaml-valid when prek scripts or providers config change 
(#70230)
---
 dev/breeze/doc/ci/04_selective_checks.md           |  7 +++--
 .../src/airflow_breeze/utils/selective_checks.py   |  8 ++++--
 dev/breeze/tests/test_selective_checks.py          | 31 ++++++++++++++++++++++
 3 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/dev/breeze/doc/ci/04_selective_checks.md 
b/dev/breeze/doc/ci/04_selective_checks.md
index 5e3c231b5fe..f8e27582ee9 100644
--- a/dev/breeze/doc/ci/04_selective_checks.md
+++ b/dev/breeze/doc/ci/04_selective_checks.md
@@ -508,8 +508,11 @@ when some files are not changed. Those are the rules 
implemented:
     skipped (it regenerates and diffs the generated ts-sdk file; a change to 
the supervisor
     wire schema alone deliberately does not trigger it - regenerating the 
ts-sdk types is
     the ts-sdk follow-up PR's job, not the schema author's)
-  * if no `All Providers Python files` and no `All Providers Yaml files` are 
changed -
-    `check-provider-yaml-valid` check is skipped
+  * `check-provider-yaml-valid` is skipped unless at least one of these 
changed:
+    `All Providers Python files`, `All Providers Distribution Config files`
+    (which includes `provider.yaml`, `pyproject.toml`, and 
`providers/.pre-commit-config.yaml`),
+    or `Prek files` (`scripts/ci/prek/`). The last condition ensures the check 
runs
+    when the check script itself is modified.
 
 ## Suspended providers
 
diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py 
b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
index f03d468e7ca..95fe83b0e38 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -399,6 +399,7 @@ CI_FILE_GROUP_MATCHES: HashableDict[FileGroupForCi] = 
HashableDict(
         FileGroupForCi.ALL_PROVIDERS_DISTRIBUTION_CONFIG_FILES: [
             r"^providers/.*/pyproject\.toml$",
             r"^providers/.*/provider\.yaml$",
+            r"^providers/\.pre-commit-config\.yaml$",
         ],
         FileGroupForCi.ALL_DEV_PYTHON_FILES: [
             r"^dev/.*\.py$",
@@ -1696,9 +1697,12 @@ class SelectiveChecks:
                 FileGroupForCi.ALL_PROVIDERS_DISTRIBUTION_CONFIG_FILES, 
CI_FILE_GROUP_MATCHES
             )
             or self._matching_files(FileGroupForCi.ALL_PROVIDERS_PYTHON_FILES, 
CI_FILE_GROUP_MATCHES)
+            or self._matching_files(FileGroupForCi.PREK_FILES, 
CI_FILE_GROUP_MATCHES)
         ):
-            # only skip provider validation if none of the provider.yaml and 
provider
-            # python files changed because validation also walks through all 
the provider python files
+            # Skip provider validation only when none of these changed:
+            # - provider.yaml / pyproject.toml / 
providers/.pre-commit-config.yaml
+            # - provider Python files (validation walks all provider Python 
files)
+            # - prek scripts (the check script itself may have changed)
             prek_hooks_to_skip.add("check-provider-yaml-valid")
         # Non-provider mypy checks run as prek hooks in static checks.
         # Skip them when their relevant files haven't changed, unless 
devel-common
diff --git a/dev/breeze/tests/test_selective_checks.py 
b/dev/breeze/tests/test_selective_checks.py
index 8b215ba4dd8..1dac0e3dd83 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -2014,6 +2014,37 @@ def test_full_test_needed_when_scripts_changes(files: 
tuple[str, ...], expected_
     assert_outputs_are_printed(expected_outputs, str(stderr))
 
 
[email protected](
+    "files",
+    [
+        pytest.param(
+            ("scripts/ci/prek/check_provider_yaml_files.py",),
+            id="provider yaml check script changed",
+        ),
+        pytest.param(
+            ("providers/.pre-commit-config.yaml",),
+            id="providers prek config changed",
+        ),
+        pytest.param(
+            (
+                "scripts/ci/prek/check_provider_yaml_files.py",
+                "providers/.pre-commit-config.yaml",
+            ),
+            id="provider yaml check script and providers prek config changed 
together",
+        ),
+    ],
+)
+def test_provider_yaml_check_not_skipped_when_check_scripts_change(files: 
tuple[str, ...]):
+    stderr = SelectiveChecks(
+        files=files,
+        github_event=GithubEvents.PULL_REQUEST,
+        commit_ref=NEUTRAL_COMMIT,
+        default_branch="main",
+    )
+    skip_prek_hooks = str(stderr).split("skip-prek-hooks=")[1].split("\n")[0]
+    assert "check-provider-yaml-valid" not in skip_prek_hooks.split(",")
+
+
 @pytest.mark.parametrize(
     ("files", "expected_outputs"),
     [

Reply via email to