-
Notifications
You must be signed in to change notification settings - Fork 613
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
Support for slack events #1451
base: master
Are you sure you want to change the base?
Support for slack events #1451
Conversation
@AgarFu Nice work, thanks for taking the initiative on creating this PR. Slack seems to be in a state of disorder with regard to the Python SDK, Application Authorisation model and API access. From what I can tell, the current situation is as follows: Python SDK
Slack API
Application Authentication
This is situation is causing a lot of confusion for users. What the Slack backend needs to do is have a way for the user to express the type of token they're using ("Classic" or "Fine grain") and then adapt it's behaviour accordingly. In the case of the Event API, the errbot webserver will probably need to used for the Slack server to connection. From what I understand, the event API events and RTM API events should be handled in the same way by errbot so we could probably mutalise code for these 2 use cases. @sijis @AgarFu What do you think about attempting to merge RTM/Event/Web API support into a single Slack backend? |
Here is the list of events with the RTM/Event API method indicated as reference. https://api.slack.com/events |
Fully agree on all that you said @nzlosh, I'm actually using errbot webserver to listen to posts from Slack. I can refactor Is there a strong opposition to create a backends.slack module with all shared classes between both backends? |
I'm open to combining it into the SlackRTM backend. I think it logically makes sense. |
Just refactored My new class now only overrides the There are no unit test for |
I will try to look into the details of this PR within the next week. I can provide feedback and more comments then. |
Hi it seems that Slack is deprecating more and more APIs, and there is interest in the community to support the slack event api. I can devote some more time if you consider that the PR needs rework. I've rebased my branch with the latest changes in the main branch and also fixed some errors due to these deprecations. Also the new slack_sdk python module is close to be ready, I think errbot should migrate to the new sdk sooner rather than later but that may have implications in the RTM support. |
…k_event_api_support
Fixed rendering issue in docs
fix: merging configs via --storage-merge cli
* Added email property for slack backend * Updated TestPerson with email property * Updated core_plugin whoami command with email * Added missing blank line * fix: whoami format output Co-authored-by: Sijis Aviles <[email protected]>
This should provide equal behavior as travisci.
This will allow the package to be uploaded to pypi, as it was failing checks.
This should ensure that existing and external backends do not break with when this property is not defined.
* fix: username to userid method signature * Fix username_to_userid and raise when username not uniquely identified (errbotio#1447) * style: fix codestyle warnings Co-authored-by: Carlos <[email protected]>
Sure thing let me take a look, thx @nzlosh |
I'll integrate the changes in a different branch for now, will add some tests and then push the changes to my branch I just want to make sure the latest changes that I applied to fix deprecation errors are still in place. I didn't add the proper tests two weeks ago but this PR is substantially more aggressive and still there are no tests for the backend. For now the changes are https://github.com/AgarFu/errbot/tree/slack_event_api_refactor I honestly don't like to have a file with 1.4k lines of code and this many classes in it, I'd like to add a new module inside backends, |
…ack_event_api_refactor
@AgarFu I agree with you, but I'd like to see this PR merged as a MVP so we can start iterating on refactoring/unit tests/bug fixes and documentation for this new backend. A deprecation plan has been proposed here #1480, which I hope shows why multiple slack backends is harming errbot's user experience. The SlackRTM backend was meant to be the successor, but with slack events and the slack client bump to v3, it lacked the features to cover all use cases. |
Ok let me confirm that my team is using a different branch and I'll merge your changes, I'd like to coordinate with you for the next iterations I'd like to at least add the testing as I said before to make sure we do not have regressions and we also have a path going forward to update to the latest versions of slack sdk |
Slack event api refactor
@nzlosh your changes are merged in my branch feel free to merge them into mainstream, THX! |
…rrbot into slack_event_api_support
@AgarFu would you mind merging the latest changes from my repository https://github.com/nzlosh/errbot/tree/slack_event_api_support into your @sijis Once the changes have been merged into @AgarFu's repository, the The |
will do |
This is needing a rebase after the latest release. sorry folks. |
@AgarFu I've merged master and pushed to my branch. |
This PR is reusing most of the classes from the SlackRTM modules, there is no documentation nor tests in this PR and the main class can be refactored in order to be able to leverage most methods from
SlackRTMBackend
class.Please let me know if this is something that you're interested in incorporate to the project I can add the missing bits, it is now in a "works for me" status.