-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
Missing root path in GitLab webhook #2534
Comments
Yep, this patch fixes it for me: diff --git a/server/forge/gitlab/gitlab.go b/server/forge/gitlab/gitlab.go
index 8f2593c7..fa0fc4ea 100644
--- a/server/forge/gitlab/gitlab.go
+++ b/server/forge/gitlab/gitlab.go
@@ -447,7 +447,7 @@ func (g *GitLab) getTokenAndWebURL(link string) (token, webURL string, err error
return "", "", err
}
token = uri.Query().Get("access_token")
- webURL = fmt.Sprintf("%s://%s/api/hook", uri.Scheme, uri.Host)
+ webURL = fmt.Sprintf("%s://%s/ci/api/hook", uri.Scheme, uri.Host)
return token, webURL, nil
} |
Thanks for the fix @qwerty287. I also observed that in the GitLab pipelines (https://gitlab.example.com/user/repo/-/pipelines/123), the link to the Woodpecker pipeline is also missing the root path: Links to Rather than |
Seem to be coming from here: woodpecker/server/forge/common/status.go Lines 75 to 81 in 4e0b0bd
|
Yes, but your |
- closes #2534 - remove `IsConfigured` func from config extension. If `server.Config.Services.ConfigService != nil` it is always configured
Component
server
Describe the bug
When enabling a new GitLab repository, the webhook is set in GitLab with the API address
https://example.com/api/hook
. However, the server has theWOODPECKER_ROOT_PATH=/ci
, and it should behttps://example.com/ci/api/hook
in my case.Changing it manually in the GitLab configuration fails because the GitLab webhook token gets erased and I don't know where to get it from, so I cannot use the webhook.
I suspect the problem is here: https://github.com/woodpecker-ci/woodpecker/blob/931af16d14e94fbf6fbb94a167251fc2d6bedded/server/forge/gitlab/gitlab.go#L450C57-L450C57
System Info
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: