-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FullNameByRepoURL util function doesn't work for gitlab nested projects urls #13570
Comments
Also looks If trying to use notification webhook for gitlab commit api , gitlab requires the path to be sent as url encoded and there is no easy way to generate that with the use of notification functions or templating , has anyone successfully tried integration with gitlab commit status api ? |
I opened #16234 to address this issue. @riteshnanda09 If you're not using any special characters to your repository name, you can use |
As @janschumann suggested, both text/template and html/template have default apis to urlencode :
I'm not sure which one ArgoCD uses in this context. |
Please consider #16343. Instead of adding the function to the repo package, it could also be added to the strings package. Would that make sense? I recognised that there are no tests in the repo package. That is due to the argued.Service dependency, correct? Can't that be mocked for the tests? |
@janschumann please check https://go.dev/play/p/eGKR5wfI-UN, these functions are already available as builtins in the template context. Can you give a try within argocd-notifications? |
confirming ArgoCD v2.10.4 is still affected by this issue |
argocd version : v2.7.0
.Describe the bug
When using
FullNameByRepoURL
function in notification template to get the repo full name this returns only first two nesting. Now in case of gitlab repo url where gitlab allows to have multiple nesting by projects in repos .eg.
https://gitlab.example.com/project1/project2/project3/argocd-demo.git
This returns
project1/project2
but expected is to getproject1/project2/project3/argocd-demo
Looking at code here https://github.com/argoproj/argo-cd/blob/master/util/notification/expression/repo/repo.go#L73
this will always return first 2 elements. Not sure on the history and motivation for this , but for me the fix would removing the condition checking for greater than.
The text was updated successfully, but these errors were encountered: