From 2e1adf7d975cd6bdc6f932b69ba02c5c7bff8a95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:55:09 +0000 Subject: [PATCH 1/2] chore(deps): bump github.com/slack-go/slack from 0.14.0 to 0.15.0 Bumps [github.com/slack-go/slack](https://github.com/slack-go/slack) from 0.14.0 to 0.15.0. - [Release notes](https://github.com/slack-go/slack/releases) - [Changelog](https://github.com/slack-go/slack/blob/master/CHANGELOG.md) - [Commits](https://github.com/slack-go/slack/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: github.com/slack-go/slack dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a426008..64c4761 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/uuid v1.6.0 github.com/prometheus/client_golang v1.20.4 github.com/sirupsen/logrus v1.9.3 - github.com/slack-go/slack v0.14.0 + github.com/slack-go/slack v0.15.0 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.27.5 k8s.io/api v0.31.1 diff --git a/go.sum b/go.sum index 84884a3..dc32ed9 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/slack-go/slack v0.14.0 h1:6c0UTfbRnvRssZUsZ2qe0Iu07VAMPjRqOa6oX8ewF4k= -github.com/slack-go/slack v0.14.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= +github.com/slack-go/slack v0.15.0 h1:LE2lj2y9vqqiOf+qIIy0GvEoxgF1N5yLGZffmEZykt0= +github.com/slack-go/slack v0.15.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From c442a62ab045c84f67c07f651ff9f2b3df4c6ff6 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Tue, 15 Oct 2024 10:25:32 +0100 Subject: [PATCH 2/2] fix(slack): switch to "V2" upload API As can be seen [when updating `slack-go`][run], the current API is deprecated and we need to update to continue working beyond May 2025. [run]: https://github.com/grafana/flagger-k6-webhook/actions/runs/11342664073/job/31543572688?pr=203 --- pkg/slack/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/slack/client.go b/pkg/slack/client.go index 91960d2..fbf28af 100644 --- a/pkg/slack/client.go +++ b/pkg/slack/client.go @@ -45,13 +45,13 @@ func (w *slackClientWrapper) UpdateMessages(slackMessages map[string]string, tex func (w *slackClientWrapper) AddFileToThreads(slackMessages map[string]string, fileName, content string) error { for channelID, ts := range slackMessages { - fileParams := slack.FileUploadParameters{ + fileParams := slack.UploadFileV2Parameters{ Title: fileName, Content: content, - Channels: []string{channelID}, + Channel: channelID, ThreadTimestamp: ts, } - if _, err := w.client.UploadFile(fileParams); err != nil { + if _, err := w.client.UploadFileV2(fileParams); err != nil { return fmt.Errorf("error while uploading output to %s in slack channel %s: %w", ts, channelID, err) } }