Skip to content
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

chore: update logs2notifications to use machinery #3792

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions services/actions-handler/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,6 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/uselagoon/machinery v0.0.24 h1:Kea7eQiwqrlF1NnG4YmV5dMNM1NxuhiY1vhoahEFkQA=
github.com/uselagoon/machinery v0.0.24/go.mod h1:NbgtEofjK2XY0iUpk9aMYazIo+W/NI56+UF72jv8zVY=
github.com/uselagoon/machinery v0.0.29 h1:invFIPv1Z1xCt8/1ilbiNDuAEPrb+AUO21BnNG+CX8c=
github.com/uselagoon/machinery v0.0.29/go.mod h1:X0qguIO9skumMhhT0ap5CKHulKgYzy3TiIn+xlwiFQc=
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
Expand Down
7 changes: 5 additions & 2 deletions services/logs2notifications/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ require (
github.com/aws/aws-sdk-go v1.55.5
github.com/cheshir/go-mq/v2 v2.0.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/machinebox/graphql v0.2.3-0.20181106130121-3a9253180225
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2
github.com/slack-go/slack v0.13.1
github.com/uselagoon/machinery v0.0.29
gopkg.in/mail.v2 v2.3.1
)

require (
github.com/NeowayLabs/wabbit v0.0.0-20210927194032-73ad61d1620e // indirect
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/guregu/null v4.0.0+incompatible // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/matryer/is v1.4.0 // indirect
github.com/machinebox/graphql v0.2.3-0.20181106130121-3a9253180225 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rabbitmq/amqp091-go v1.10.0 // indirect
Expand Down
13 changes: 10 additions & 3 deletions services/logs2notifications/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.55.3 h1:0B5hOX+mIx7I5XPOrjrHlKSDQV/+ypFZpIHOx5LOk3E=
github.com/aws/aws-sdk-go v1.55.3/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
Expand Down Expand Up @@ -414,6 +412,8 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -515,6 +515,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/guregu/null v4.0.0+incompatible h1:4zw0ckM7ECd6FNNddc3Fu4aty9nTlpkkzH7dPn4/4Gw=
github.com/guregu/null v4.0.0+incompatible/go.mod h1:ePGpQaN9cw0tj45IR5E5ehMvsFlLlQZAkkOXZurJ3NM=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand All @@ -531,6 +533,8 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down Expand Up @@ -854,6 +858,8 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/uselagoon/machinery v0.0.29 h1:invFIPv1Z1xCt8/1ilbiNDuAEPrb+AUO21BnNG+CX8c=
github.com/uselagoon/machinery v0.0.29/go.mod h1:X0qguIO9skumMhhT0ap5CKHulKgYzy3TiIn+xlwiFQc=
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
Expand Down Expand Up @@ -1167,8 +1173,9 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (h *Messaging) sendEmailMessage(emoji, color, subject, event, project, emai
}

}
log.Println(fmt.Sprintf("Sent %s message to email for project %s", event, project))
log.Printf("Sent %s message to email for project %s", event, project)
}

func getEmailEvent(msgEvent string) (string, string, string, error) {
Expand Down
23 changes: 10 additions & 13 deletions services/logs2notifications/internal/handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (

mq "github.com/cheshir/go-mq/v2"
"github.com/matryer/try"
"github.com/uselagoon/lagoon/services/logs2notifications/internal/lagoon"
lclient "github.com/uselagoon/lagoon/services/logs2notifications/internal/lagoon/client"
"github.com/uselagoon/lagoon/services/logs2notifications/internal/lagoon/jwt"
"github.com/uselagoon/lagoon/services/logs2notifications/internal/schema"

"github.com/uselagoon/machinery/api/lagoon"
lclient "github.com/uselagoon/machinery/api/lagoon/client"
"github.com/uselagoon/machinery/api/schema"
"github.com/uselagoon/machinery/utils/jwt"
)

// RabbitBroker .
Expand All @@ -31,6 +32,7 @@ type LagoonAPI struct {
TokenSigningKey string `json:"tokenSigningKey"`
JWTSubject string `json:"subject"`
JWTIssuer string `json:"issuer"`
Version string `json:"version"`
}

// Action is the structure of an action that is received via the message queue.
Expand All @@ -40,11 +42,6 @@ type Action struct {
Data map[string]interface{} `json:"data"` // contains the payload for the action, this could be any json so using a map
}

type messaging interface {
Consumer()
Publish(string, []byte)
}

// Messaging is used for the config and client information for the messaging queue.
type Messaging struct {
Config mq.Config
Expand Down Expand Up @@ -204,7 +201,7 @@ func (h *Messaging) Consumer() {

go func() {
for err := range messageQueue.Error() {
log.Println(fmt.Sprintf("Caught error from message queue: %v", err))
log.Printf("Caught error from message queue: %v", err)
}
}()

Expand All @@ -217,7 +214,7 @@ func (h *Messaging) Consumer() {
message.Ack(false) // ack to remove from queue
})
if err != nil {
log.Println(fmt.Sprintf("Failed to set handler to consumer `%s`: %v", "items-queue", err))
log.Printf("Failed to set handler to consumer `%s`: %v", "items-queue", err)
}
<-forever
}
Expand Down Expand Up @@ -282,7 +279,7 @@ func (h *Messaging) processMessage(message []byte) {
}

func (h *Messaging) getProjectNotifictions(ctx context.Context, projectName string) (*schema.Project, error) {
token, err := jwt.OneMinuteAdminToken(h.LagoonAPI.TokenSigningKey, h.LagoonAPI.JWTAudience, h.LagoonAPI.JWTSubject, h.LagoonAPI.JWTIssuer)
token, err := jwt.GenerateAdminToken(h.LagoonAPI.TokenSigningKey, h.LagoonAPI.JWTAudience, h.LagoonAPI.JWTSubject, h.LagoonAPI.JWTIssuer, time.Now().Unix(), 60)
if err != nil {
// the token wasn't generated
if h.EnableDebug {
Expand All @@ -291,7 +288,7 @@ func (h *Messaging) getProjectNotifictions(ctx context.Context, projectName stri
return nil, err
}
// get all notifications for said project
l := lclient.New(h.LagoonAPI.Endpoint, token, "logs2notifications", false)
l := lclient.New(h.LagoonAPI.Endpoint, "actions-handler", h.LagoonAPI.Version, &token, false)
projectNotifications, err := lagoon.NotificationsForProject(ctx, projectName, l)
if err != nil {
log.Println(err)
Expand Down
13 changes: 0 additions & 13 deletions services/logs2notifications/internal/handler/main_test.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
package handler

import (
"bytes"
"encoding/json"
"io/ioutil"
"reflect"
"testing"

mq "github.com/cheshir/go-mq/v2"
)

func checkEqual(t *testing.T, got, want interface{}, msgs ...interface{}) {
if !reflect.DeepEqual(got, want) {
buf := bytes.Buffer{}
buf.WriteString("got:\n[%v]\nwant:\n[%v]\n")
for _, v := range msgs {
buf.WriteString(v.(string))
}
t.Errorf(buf.String(), got, want)
}
}

func TestProcessing(t *testing.T) {
config := mq.Config{}
graphQLConfig := LagoonAPI{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func (h *Messaging) sendMicrosoftTeamsMessage(emoji, color, webhook, event, proj

teamsPayloadBytes, _ := json.Marshal(teamsPayload)
req, err := http.NewRequest("POST", webhook, bytes.NewBuffer(teamsPayloadBytes))
if err != nil {
log.Printf("Error sending message to microsoft teams for project %s: %v", project, err)
return
}
req.Header.Set("Content-Type", "application/json")

client := &http.Client{}
Expand All @@ -124,7 +128,7 @@ func (h *Messaging) sendMicrosoftTeamsMessage(emoji, color, webhook, event, proj
return
}
defer resp.Body.Close()
log.Println(fmt.Sprintf("Sent %s message to microsoft teams for project %s", event, project))
log.Printf("Sent %s message to microsoft teams for project %s", event, project)
}

func getMicrosoftTeamsEvent(msgEvent string) (string, string, string, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func (h *Messaging) sendRocketChatMessage(emoji, color, appID, channel, webhook,
}
jsonBytes, _ := json.Marshal(data)
req, err := http.NewRequest("POST", webhook, bytes.NewBuffer(jsonBytes))
if err != nil {
log.Printf("Error sending message to rocketchat channel %s for project %s: %v", channel, project, err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Content-Length", fmt.Sprintf("%d", len(jsonBytes)))

Expand All @@ -130,7 +134,7 @@ func (h *Messaging) sendRocketChatMessage(emoji, color, appID, channel, webhook,
return
}
defer resp.Body.Close()
log.Println(fmt.Sprintf("Sent %s message to rocketchat channel %s for project %s", event, channel, project))
log.Printf("Sent %s message to rocketchat channel %s for project %s", event, channel, project)
}

func getRocketChatEvent(msgEvent string) (string, string, string, error) {
Expand Down
10 changes: 4 additions & 6 deletions services/logs2notifications/internal/handler/s3_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/uselagoon/lagoon/services/logs2notifications/internal/helpers"
"github.com/uselagoon/machinery/utils/namespace"
)

// MessageType .
Expand Down Expand Up @@ -41,7 +41,7 @@ func (h *Messaging) SendToS3(notification *Notification, msgType MessageType) {
if notification.Meta.Environment != "" {
filePath = fmt.Sprintf("tasklogs/%s/%s/%s-%s.txt",
notification.Project,
helpers.ShortenEnvironment(notification.Project, helpers.MakeSafe(notification.Meta.Environment)),
namespace.ShortenEnvironment(notification.Project, namespace.MakeSafe(notification.Meta.Environment)),
notification.Meta.Task.ID,
notification.Meta.RemoteID,
)
Expand All @@ -56,8 +56,7 @@ func (h *Messaging) SendToS3(notification *Notification, msgType MessageType) {

// UploadFileS3
func (h *Messaging) uploadFileS3(message, fileName string) {
var forcePath bool
forcePath = true
forcePath := true
session, err := session.NewSession(&aws.Config{
Region: aws.String(h.S3FilesRegion),
Endpoint: aws.String(h.S3FilesOrigin),
Expand All @@ -81,6 +80,5 @@ func (h *Messaging) uploadFileS3(message, fileName string) {
if err != nil {
log.Println(err)
}
log.Println(fmt.Sprintf("Uploaded file %s", fileName))
return
log.Printf("Uploaded file %s\n", fileName)
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (h *Messaging) sendSlackMessage(emoji, color, appID, channel, webhook, even
log.Printf("Error sending message to slack channel %s for project %s: %v", channel, project, err)
return
}
log.Println(fmt.Sprintf("Sent %s message to slack channel %s for project %s", event, channel, project))
log.Printf("Sent %s message to slack channel %s for project %s", event, channel, project)
}

func getSlackEvent(msgEvent string) (string, string, string, error) {
Expand Down
18 changes: 8 additions & 10 deletions services/logs2notifications/internal/handler/webhook_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"strings"

"github.com/uselagoon/lagoon/services/logs2notifications/internal/schema"
"github.com/uselagoon/machinery/api/schema"
)

// WebhookData .
Expand All @@ -24,17 +24,21 @@ type WebhookData struct {
}

// SendToWebhook .
func (h *Messaging) SendToWebhook(notification *Notification, webhook schema.NotificationWebhook) {
func (h *Messaging) SendToWebhook(notification *Notification, webhook schema.AddNotificationWebhookInput) {
message, err := h.processWebhookTemplate(notification)
if err != nil {
return
}
h.sendWebhookMessage(notification.Meta.ProjectName, *message, webhook)
}

func (h *Messaging) sendWebhookMessage(project string, data WebhookData, webhook schema.NotificationWebhook) {
func (h *Messaging) sendWebhookMessage(project string, data WebhookData, webhook schema.AddNotificationWebhookInput) {
message, _ := json.Marshal(data)
req, err := http.NewRequest("POST", webhook.Webhook, bytes.NewBuffer(message))
if err != nil {
log.Printf("Error sending message to webhook: %v", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Content-Length", fmt.Sprintf("%d", len(message)))

Expand All @@ -45,13 +49,7 @@ func (h *Messaging) sendWebhookMessage(project string, data WebhookData, webhook
return
}
defer resp.Body.Close()
log.Println(fmt.Sprintf("Sent %s message to webhook", data.Event))
if err != nil {
log.Printf("Error sending message to webhook for project %s: %v", project, err)
return
}
defer resp.Body.Close()
log.Println(fmt.Sprintf("Sent %s message to webhook for project %s", data.Event, project))
log.Printf("Sent %s message to webhook for project %s", data.Event, project)
}

// processWebhookTemplate .
Expand Down
Loading