Skip to content

Commit

Permalink
Allow on prem Azure DevOps Server pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Bowie committed Oct 1, 2024
1 parent d11e11d commit e78ea01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/commands/hosting_service/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var azdoServiceDef = ServiceDefinition{
regexStrings: []string{
`^[email protected].*/(?P<org>.*)/(?P<project>.*)/(?P<repo>.*?)(?:\.git)?$`,
`^https://.*@dev.azure.com/(?P<org>.*?)/(?P<project>.*?)/_git/(?P<repo>.*?)(?:\.git)?$`,
`^https://.*/(?P<org>.*?)/(?P<project>.*?)/_git/(?P<repo>.*?)(?:\.git)?$`,
},
repoURLTemplate: "https://{{.webDomain}}/{{.org}}/{{.project}}/_git/{{.repo}}",
}
Expand Down
13 changes: 13 additions & 0 deletions pkg/commands/hosting_service/hosting_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ func TestGetPullRequestURL(t *testing.T) {
assert.Equal(t, "https://dev.azure.com/myorg/myproject/_git/myrepo/pullrequestcreate?sourceRef=feature%2Fnew&targetRef=dev", url)
},
},
{
testName: "Opens a link to new pull request on Azure DevOps Server (HTTP)",
from: "feature/new",
remoteUrl: "https://mycompany.azuredevops.com/collection/myproject/_git/myrepo",
configServiceDomains: map[string]string{
// valid configuration for a azure devops server URL
"mycompany.azuredevops.com": "azuredevops:mycompany.azuredevops.com",
},
test: func(url string, err error) {
assert.NoError(t, err)
assert.Equal(t, "https://mycompany.azuredevops.com/collection/myproject/_git/myrepo/pullrequestcreate?sourceRef=feature%2Fnew", url)
},
},
{
testName: "Opens a link to new pull request on Bitbucket Server (SSH)",
from: "feature/new",
Expand Down

0 comments on commit e78ea01

Please sign in to comment.