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

ephraimbuddy 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 3c0c6a7bacd Fix GitDagBundle source link for SSH repos with .git in 
the name (#76949)
3c0c6a7bacd is described below

commit 3c0c6a7bacd1dd0505c845a51f6ac77e8f307fe8
Author: Harsh Thakur <[email protected]>
AuthorDate: Wed Nov 18 12:17:25 2026 +0530

    Fix GitDagBundle source link for SSH repos with .git in the name (#76949)
    
    The SSH-to-https conversion behind the bundle's view URL removed ".git"
    anywhere in the repository path, so the source link of a repository such
    as org/org.github.io pointed to org/orghub.io, which does not exist.
---
 providers/git/src/airflow/providers/git/bundles/git.py | 2 +-
 providers/git/tests/unit/git/bundles/test_git.py       | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/providers/git/src/airflow/providers/git/bundles/git.py 
b/providers/git/src/airflow/providers/git/bundles/git.py
index 375f3146a72..45024666235 100644
--- a/providers/git/src/airflow/providers/git/bundles/git.py
+++ b/providers/git/src/airflow/providers/git/bundles/git.py
@@ -516,7 +516,7 @@ class GitDagBundle(BaseDagBundle):
             raise ValueError(f"Invalid git SSH URL: {url}")
         parts = url.split(":")
         domain = parts[0].replace("git@", "https://";)
-        repo_path = parts[1].replace(".git", "")
+        repo_path = parts[1].removesuffix(".git")
         return f"{domain}/{repo_path}"
 
     def view_url(self, version: str | None = None) -> str | None:
diff --git a/providers/git/tests/unit/git/bundles/test_git.py 
b/providers/git/tests/unit/git/bundles/test_git.py
index 6a05910bd63..90f85637c7f 100644
--- a/providers/git/tests/unit/git/bundles/test_git.py
+++ b/providers/git/tests/unit/git/bundles/test_git.py
@@ -1083,6 +1083,11 @@ class TestGitDagBundle:
         [
             ("[email protected]:apache/airflow.git", None, 
"https://github.com/apache/airflow/tree/0f0f0f";),
             ("[email protected]:apache/airflow", None, 
"https://github.com/apache/airflow/tree/0f0f0f";),
+            (
+                "[email protected]:apache/airflow.github.io.git",
+                None,
+                "https://github.com/apache/airflow.github.io/tree/0f0f0f";,
+            ),
             ("https://github.com/apache/airflow";, None, 
"https://github.com/apache/airflow/tree/0f0f0f";),
             ("https://github.com/apache/airflow.git";, None, 
"https://github.com/apache/airflow/tree/0f0f0f";),
             ("[email protected]:apache/airflow.git", None, 
"https://gitlab.com/apache/airflow/-/tree/0f0f0f";),

Reply via email to