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 a73be521e82 Handling auto classification of providers with longer 
paths (#53810)
a73be521e82 is described below

commit a73be521e824d0605077f010b930b4452963585d
Author: Amogh Desai <[email protected]>
AuthorDate: Mon Jul 28 16:46:24 2025 +0530

    Handling auto classification of providers with longer paths (#53810)
---
 .../airflow_breeze/prepare_providers/provider_documentation.py   | 9 ++++-----
 dev/breeze/tests/test_provider_documentation.py                  | 9 +++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git 
a/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py 
b/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
index e3e86d7c15e..c03a85ac033 100644
--- a/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
+++ b/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
@@ -196,18 +196,17 @@ TYPE_OF_CHANGE_DESCRIPTION = {
 
 
 def classification_result(provider_id, changed_files):
-    provider_path = f"providers/{provider_id}/"
-    changed_files = list(filter(lambda f: f.startswith(provider_path), 
changed_files))
+    changed_files = list(filter(lambda f: provider_id in f, changed_files))
 
     if not changed_files:
         return "other"
 
     def is_doc(f):
-        return re.match(r"^providers/[^/]+/docs/", f) and f.endswith(".rst")
+        return re.match(r"^providers/.+/docs/", f) and f.endswith(".rst")
 
     def is_test_or_example(f):
-        return re.match(r"^providers/[^/]+/tests/", f) or re.match(
-            r"^providers/[^/]+/src/airflow/providers/[^/]+/example_dags/", f
+        return re.match(r"^providers/.+/tests/", f) or re.match(
+            r"^providers/.+/src/airflow/providers/.+/example_dags/", f
         )
 
     all_docs = all(is_doc(f) for f in changed_files)
diff --git a/dev/breeze/tests/test_provider_documentation.py 
b/dev/breeze/tests/test_provider_documentation.py
index 8392a0aba14..9f2d2b098de 100644
--- a/dev/breeze/tests/test_provider_documentation.py
+++ b/dev/breeze/tests/test_provider_documentation.py
@@ -398,9 +398,18 @@ def test_get_most_impactful_change(changes, expected):
     "provider_id, changed_files, expected",
     [
         pytest.param("slack", ["providers/slack/docs/slack.rst"], 
"documentation", id="only_docs"),
+        pytest.param(
+            "flink", ["providers/apache/flink/docs/slack.rst"], 
"documentation", id="only_docs_longer_path"
+        ),
         pytest.param(
             "slack", ["providers/slack/tests/test_slack.py"], 
"test_or_example_only", id="only_tests"
         ),
+        pytest.param(
+            "flink",
+            
["providers/apache/flink/tests/unit/apache/flink/sensors/test_flink_kubernetes.py"],
+            "test_or_example_only",
+            id="only_tests_longer_path",
+        ),
         pytest.param(
             "slack",
             
["providers/slack/src/airflow/providers/slack/example_dags/example_notify.py"],

Reply via email to