brigadecore / brigade

Event-driven scripting for Kubernetes
https://brigade.sh/
Apache License 2.0
2.4k stars 247 forks source link

bug: cloneUrl not supporting Azure DevOps git clone url #1909

Closed emilwangaa closed 2 years ago

emilwangaa commented 2 years ago

Hi,

While trying to migrate to Brigade v2 we discovered that using a git clone url from an Azure DevOps project doesn't work. The provided url from our Azure DevOps repo looks like this: https://my-organization@dev.azure.com/my-organization/my%20project/_git/my-repo

Looks to be because of a too restrictive regex pattern being used: https://regexr.com/6iu90 not allowing %20 and urls not ending in .git

Output of brig version:

Brigade client: version v2.3.1 -- commit c0c965c
Brigade API server: version v2.3.1 -- commit c0c965c

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1", GitCommit:"86ec240af8cbd1b60bcc4c03c20da9b98005b92e", GitTreeState:"clean", BuildDate:"2021-12-16T11:41:01Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.6", GitCommit:"5963a7a5570a1b8c977c31ced503cb20f0ef6e8c", GitTreeState:"clean", BuildDate:"2022-03-10T07:59:42Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): AKS