jenkinsci / slack-plugin

A Jenkins plugin for posting notifications to a Slack channel
https://plugins.jenkins.io/slack/
MIT License
670 stars 413 forks source link

Use `file.upload v2` in `slackUploadFile` #961

Closed timja closed 4 months ago

timja commented 4 months ago

Fixes https://github.com/jenkinsci/slack-plugin/issues/884

see https://github.com/slackapi/java-slack-sdk/pull/1065 and https://api.slack.com/messaging/files#uploading_files

From tomorrow slack will prevent new apps from using the current API which would stop any new users as they have to setup their own app.

💥 Breaking changes

Testing done

Tested with simple single and multiple files in a public channel. I've not exhaustively tested all potentials.

This may be slower on large workspaces as we now have to use channel IDs which SLACK DOES NOT PROVIDE A METHOD TO LOOKUP -.-. You have to list every single channel...

If this causes problems we can probably introduce a cache.

### Submitter checklist
- [ ] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [ ] Ensure that the pull request title represents the desired changelog entry
- [ ] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue