integram-org / gitlab

GNU General Public License v3.0
29 stars 21 forks source link

Error sending Pipeline events #7

Open wawan93 opened 4 years ago

wawan93 commented 4 years ago

Error in logs: time="2020-06-07T21:49:16Z" level=error msg="Can't use SetServiceHostFromURL with empty arg" chat=178132 domain= file=/go/src/github.com/integram-org/gitlab/vendor/github.com/requilence/integram/context.go func="github.com/integram-org/gitlab/vendor/github.com/requilence/integram.(*Context).SetServiceBaseURL" ip="10.244.1.122:44514" line=76 service=gitlab url="POST /gitlab/cKTIIaMSlSF"

GitLab 13.0.5-ee (260c6231ed0) Integram docker image: integram/gitlab@sha256:616cf532be9

ilyashatalov commented 3 years ago

same :(

ikennykachun commented 3 years ago

The Source seems not support "object_kind = pipeline"

You have to add your own handler in function webhookHandler Or you give up pipeline, use Job instead.

Furthermore, 1 simple typo need to update too.

@@ -563,13 +595,14 @@ func webhookHandler(c *integram.Context, request *integram.WebhookContext) (err
    if wh.Repository.Homepage != "" {
        c.SetServiceBaseURL(wh.Repository.Homepage)
    } else if wh.ObjectAttributes != nil {
    -   if wh.ObjectAttributes.URL == "" {
    +   if wh.ObjectAttributes.URL != "" {
            c.SetServiceBaseURL(wh.ObjectAttributes.URL)
        } else if wh.Commit != nil {
            c.SetServiceBaseURL(wh.Commit.URL)
        } else {
            raw, _ := request.RAW()
            c.Log().WithField("wh", string(*raw)).Error("gitlab webhook empty url")