Skip to content

Commit

Permalink
fix(slack): switch to "V2" upload API
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iainlane committed Oct 15, 2024
1 parent 2e1adf7 commit c442a62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/slack/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit c442a62

Please sign in to comment.