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

Slack API files.upload v1 deprecation #28353

Open
3 tasks done
asaf400 opened this issue May 6, 2024 · 3 comments
Open
3 tasks done

Slack API files.upload v1 deprecation #28353

asaf400 opened this issue May 6, 2024 · 3 comments
Assignees

Comments

@asaf400
Copy link
Contributor

asaf400 commented May 6, 2024

Bug description

The API superset uses for slack reports has been deprecated, and needs to be replaced with the new API:

As described here
files.upload is deprecated and will stop functioning on March 11, 2025. Use [files.getUploadURLExternal](https://api.slack.com/methods/files.getUploadURLExternal) and [files.completeUploadExternal](https://api.slack.com/methods/files.completeUploadExternal) to upload files instead. Newly created apps will be unable to use files.upload beginning May 8, 2024. See [Uploading files](https://api.slack.com/messaging/files#uploading_files) for more details on the process and [this changelog](https://api.slack.com/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay) for more on the deprecation.

Seems like new slack-sdk version required minimum is v3.19.0
Which Superset already uses

"slack_sdk>=3.19.0, <4",

[root@LAPTOP-ASAF-T14 ~]# pip install 'slack_sdk>=3.19.0, <4'
Collecting slack_sdk<4,>=3.19.0
...
Installing collected packages: slack_sdk
Successfully installed slack_sdk-3.27.1

additional resources:
slackapi/python-slack-sdk#1272

How to reproduce the bug

Deprecation

Screenshots/recordings

As a slack organization administrator I received the following message by email:

2024-05-06 12_40_45-Gmail - Upcoming changes to support for the files upload API method - asaf levy@

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@asaf400
Copy link
Contributor Author

asaf400 commented May 8, 2024

I'm guessing in the meantime it might be a good idea updating the docs:
https://github.com/apache/superset/blob/master/docs/docs/configuration/alerts-reports.mdx#slack-integration

Because if slack are true to their word, New superset deployment cannot create the slack integration (assuming operator creates new app in slack console..)

Copy link

dosubot bot commented May 8, 2024

Updating the Apache Superset documentation to reflect the Slack API changes is indeed a crucial step. The deprecation of files.upload necessitates a shift to files.getUploadURLExternal and files.completeUploadExternal for file uploads. This change should be clearly documented to guide new Superset deployments in setting up Slack integrations correctly.

For the codebase, transitioning involves:

  1. Replacing files.upload with files.getUploadURLExternal to obtain an upload URL.
  2. Uploading the file to this URL, then calling files.completeUploadExternal to finalize the upload.

This process requires adjustments in error handling and response validation to align with the new Slack API methods. It's essential to ensure the Slack SDK version is compatible and to update any relevant configuration settings in Superset.

Contributors can update the documentation by:

  1. Setting up a local development environment and making changes in the ./docs directory.
  2. Building and serving a production build of the documentation site for verification.
  3. Submitting pull requests with the docs: prefix to propose changes.

For testing changes to the Slack integration, unit tests with mock objects can verify the functionality without actual Slack API interaction. This approach ensures the integration works as expected under controlled conditions.

Finally, notifying Superset users about these important changes involves updating CHANGELOG.md and UPDATING.md, utilizing community channels like Slack for announcements, and encouraging regular review of the documentation for updates. GitHub can also be used to track issues and updates related to these changes.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

mistercrunch added a commit that referenced this issue May 10, 2024
Randomly caught #28353 and
decided to propose a fix. Unclear if this is unit tested properly or not
but thought I'd put it out there as it seemed straightforward when I
looked at the docs here
https://github.com/slackapi/python-slack-sdk/releases/tag/v3.19.0
@mistercrunch
Copy link
Member

#28423 should do it, not sure how to test/validate though

mistercrunch added a commit that referenced this issue May 13, 2024
Randomly caught #28353 and
decided to propose a fix. Unclear if this is unit tested properly or not
but thought I'd put it out there as it seemed straightforward when I
looked at the docs here
https://github.com/slackapi/python-slack-sdk/releases/tag/v3.19.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants