-
Notifications
You must be signed in to change notification settings - Fork 132
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
Change code to use subgroup in gitlab #80
Conversation
@Joda89 please run |
bc2256d
to
8e4cf16
Compare
@stefanprodan It's done |
@Joda89 could you also add a test in |
@phillebaba it's done |
Sorry for not thinking about subgroups in GitLab, there are always small detail differences between the different GitHub providers. Thank you for taking the time and fixing it. 🌹 Now when I think about it I don't really remember why I thought it was a good idea to split the path into components. func parseGitAddress(s string) (string, string, error) {
u, err := giturls.Parse(s)
if err != nil {
return "", "", nil
}
id := strings.TrimLeft(u.Path, "/")
id = strings.TrimSuffix(id, ".git")
host := fmt.Sprintf("https://%s", u.Host)
return host, id, nil
} Each provider should be responsible for verifying the repo id they get so that it matches their client. GitHub needs to split it while GitLab does not. I can add that validation tonight to the different providers if you make my suggested changes so we merge this PR. |
Signed-off-by: Johan Lore <[email protected]>
@phillebaba It's push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥇
I will add some tests and then hopefully we can release notification-controller soon so the GitLab notifier works for you.
thanks |
When I use the subgroup of gitlab I get an error "Incorrectly formatted git address"
the id on gitlab can use more than two block
I changed the code to be able to handle two or more blocks in the ID
Can you tell me if this is right for you?