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 d728644f535 Handle commas in provider Project-URL metadata (#67064)
d728644f535 is described below

commit d728644f535e49071f029c146391928805c6f287
Author: leon.jeon <[email protected]>
AuthorDate: Mon May 18 05:45:11 2026 +0900

    Handle commas in provider Project-URL metadata (#67064)
---
 .../providers_discovery/providers_discovery.py     |  4 +--
 .../test_providers_discovery.py                    | 36 +++++++++++++++++++++-
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git 
a/shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
 
b/shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
index f0b698dea42..0242eb42f4d 100644
--- 
a/shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
+++ 
b/shared/providers_discovery/src/airflow_shared/providers_discovery/providers_discovery.py
@@ -337,9 +337,9 @@ def discover_all_providers_from_packages(
         if project_urls:
             for entry in project_urls:
                 if "," in entry:
-                    name, url = entry.split(",")
+                    name, url = entry.split(",", 1)
                     if name.strip().lower() == "documentation":
-                        documentation_url = url
+                        documentation_url = url.strip()
                         break
 
         provider_info["documentation-url"] = documentation_url
diff --git 
a/shared/providers_discovery/tests/providers_discovery/test_providers_discovery.py
 
b/shared/providers_discovery/tests/providers_discovery/test_providers_discovery.py
index 87f97a3e5a2..3c9504cf809 100644
--- 
a/shared/providers_discovery/tests/providers_discovery/test_providers_discovery.py
+++ 
b/shared/providers_discovery/tests/providers_discovery/test_providers_discovery.py
@@ -17,9 +17,16 @@
 # under the License.
 from __future__ import annotations
 
+from email.message import Message
+from unittest.mock import Mock
+
 import pytest
 
-from airflow_shared.providers_discovery import LazyDictWithCache
+from airflow_shared.providers_discovery import (
+    LazyDictWithCache,
+    discover_all_providers_from_packages,
+    providers_discovery as providers_discovery_module,
+)
 
 
 @pytest.mark.parametrize(
@@ -110,3 +117,30 @@ def test_lazy_cache_dict_clear():
     assert len(lazy_cache_dict) == 0
     assert not lazy_cache_dict._raw_dict
     assert not lazy_cache_dict._resolved
+
+
+def test_discover_all_providers_preserves_commas_in_project_url(monkeypatch):
+    provider_info = {
+        "package-name": "apache-airflow-providers-test",
+        "name": "Test",
+        "description": "Test provider",
+        "versions": ["1.0.0"],
+    }
+    metadata = Message()
+    metadata["Name"] = "apache-airflow-providers-test"
+    metadata["Project-URL"] = " Documentation , 
https://example.invalid/docs?query=a,b "
+    dist = Mock(metadata=metadata, version="1.0.0")
+    entry_point = Mock()
+    entry_point.load.return_value = lambda: provider_info
+    monkeypatch.setattr(
+        providers_discovery_module,
+        "entry_points_with_dist",
+        lambda group: [(entry_point, dist)],
+    )
+
+    providers = {}
+    discover_all_providers_from_packages(providers, Mock())
+
+    assert 
providers["apache-airflow-providers-test"].data["documentation-url"] == (
+        "https://example.invalid/docs?query=a,b";
+    )

Reply via email to