Commit da7bd2b
authored
Recognize ssh:// template URLs in bundle init (#5891)
## Changes
`gitUrlPrefixes` in `libs/template/resolver.go` only recognized
`https://` and `git@`, which is incomplete relative to the [git URL
spec](https://git-scm.com/docs/git-clone#_git_urls). This adds `ssh://`
so `databricks bundle init` clones templates from SSH-transport URLs.
`git://`, `http://`, and `ftp[s]://` are deliberately excluded as
deprecated/insecure protocols.
Also renames `IsRepoUrl` to `IsGitRepoUrl` and simplifies it to return
directly on the first matching prefix.
## Why
Closes #5881: SSH-transport template URLs were not recognized and fell
through to the local-path reader. For non `git@` prefixed SSH URLs
customers could not use the command.
## Tests
Unit test `TestBundleInitIsGitRepoUrl` updated to cover the supported
(`https://`, `ssh://`, `git@`) and unsupported (`git://`, `http://`,
`ftp[s]://`, local paths) forms. No acceptance test exercises git-URL
detection.
_This PR was written by Claude Code._1 parent f77764d commit da7bd2b
3 files changed
Lines changed: 25 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | | - | |
17 | | - | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
21 | | - | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
| |||
0 commit comments