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

feat: initial infra for slack intergration #1131

Merged
merged 40 commits into from
May 8, 2024

Conversation

Shurtu-gal
Copy link
Contributor

@Shurtu-gal Shurtu-gal commented Mar 27, 2024

Description

  • Sets up the initial infrastructure needed for Slack integration.

Tasks

Related issue(s)
Fixes #1072

@Shurtu-gal Shurtu-gal self-assigned this Mar 27, 2024
@Shurtu-gal Shurtu-gal requested a review from smoya March 27, 2024 20:46
@Shurtu-gal
Copy link
Contributor Author

Shurtu-gal commented Apr 4, 2024

@smoya The working groups part has also been done. Successful workflow runs can be viewed here.

Just needs to wait for the added comment #1143 (comment)

@aeworxet
Copy link
Contributor

@asyncapi/bounty_team

@Shurtu-gal Shurtu-gal deleted the slack-integration branch May 8, 2024 13:40
@Shurtu-gal
Copy link
Contributor Author

Shurtu-gal commented May 8, 2024

Two things left for this to function correctly:-

  1. Add the SLACK_TOKEN secret. ( Can be taken from @smoya )
  2. Merge this PR chore: fix working groups file #1203

It would be good to do it in this order as the workflow will run automatically.

cc: @derberg @thulieblack

@Shurtu-gal
Copy link
Contributor Author

@derberg a possible workflow can be verification of WORKING_GROUPS.yaml file like we do for others.

@smoya
Copy link
Member

smoya commented May 8, 2024

@Shurtu-gal This PR shouldn't have been merged until everything properly configured.

Additionally, it seems it's failing here https://github.com/asyncapi/community/actions/runs/9002845962/job/24732067102#step:3:46

@Shurtu-gal
Copy link
Contributor Author

@Shurtu-gal This PR shouldn't have been merged until everything properly configured.

Additionally, it seems it's failing here https://github.com/asyncapi/community/actions/runs/9002845962/job/24732067102#step:3:46

Yeah, the working group file has been changed in some other PR, just fixed it in #1203

@smoya
Copy link
Member

smoya commented May 8, 2024

@Shurtu-gal This PR shouldn't have been merged until everything properly configured.
Additionally, it seems it's failing here https://github.com/asyncapi/community/actions/runs/9002845962/job/24732067102#step:3:46

Yeah, the working group file has been changed in some other PR, just fixed it in #1203

Oh, gotcha. Didn't get it when reading your previous comment. Sorry 😓

@Shurtu-gal
Copy link
Contributor Author

@derberg the only thing left is to add the slack token.

https://github.com/asyncapi/community/actions/runs/9011590065

@smoya
Copy link
Member

smoya commented May 9, 2024

@derberg the only thing left is to add the slack token.

https://github.com/asyncapi/community/actions/runs/9011590065

Token I shared with you @derberg via Slack DM. 🙏

@derberg
Copy link
Member

derberg commented May 9, 2024

I have only one small concern on token name
below you can see all tokens for slack that are globally available in AsyncAPI, and you see names more or less say what it is for. I'm afraid that if I add SLACK_TOKEN for this repo, we will quickly forget what it is for....although we can always search through code where it is used 🤔

Screenshot 2024-05-09 at 15 31 26

@Shurtu-gal
Copy link
Contributor Author

How about changing it to SLACK_INFRA_TOKEN ?

@derberg
Copy link
Member

derberg commented May 9, 2024

no strong opinion here - whatever you folks think is the best - even if not renaming is good, I'll accept your decision

@Shurtu-gal
Copy link
Contributor Author

no strong opinion here - whatever you folks think is the best - even if not renaming is good, I'll accept your decision

I have changed it to SLACK_INFRA_TOKEN in #1205. Let me know if anyone has any other suggestions.

cc: @derberg

Copy link
Member

derberg commented May 13, 2024

ok, secret SLACK_INFRA_TOKEN added

@Shurtu-gal
Copy link
Contributor Author

@smoya there is some problem related to scope as can be seen in this run.

Have you given this scope to the token channels:write?

@smoya
Copy link
Member

smoya commented May 14, 2024

@smoya there is some problem related to scope as can be seen in this run.

Have you given this scope to the token channels:write?

You mention in the README that we should use a user bot. However, i dont think is needed, also not very secure.
I used a bot token and added the following roles:

  • channels:join
  • channels:manage
  • channels:read
  • groups:read
  • groups:write
  • usergroups:read
  • usergroups:write

The changes got approved by @thulieblack now.

I guess we would need to update the README as well to mention the changes about the scopes

@Shurtu-gal
Copy link
Contributor Author

@smoya there is some problem related to scope as can be seen in this run.
Have you given this scope to the token channels:write?

You mention in the README that we should use a user bot. However, i dont think is needed, also not very secure. I used a bot token and added the following roles:

* channels:join

* channels:manage

* channels:read

* groups:read

* groups:write

* usergroups:read

* usergroups:write

The changes got approved by @thulieblack now.

I guess we would need to update the README as well to mention the changes about the scopes

I will change the README.

@smoya
Copy link
Member

smoya commented May 14, 2024

Please @Shurtu-gal confirm it works now🙏

@Shurtu-gal
Copy link
Contributor Author

@derberg can you rerun the workflow once.

Copy link
Member

derberg commented May 16, 2024

sorry but which one? one of the latest from https://github.com/asyncapi/community/actions/workflows/slack-integration.yml?

@Shurtu-gal
Copy link
Contributor Author

@Shurtu-gal
Copy link
Contributor Author

@smoya still not working https://github.com/asyncapi/community/actions/runs/9095277402/job/24998151071#step:3:1456. Could you try it once locally, if not maybe can try using user token as written in the README. WDYT ?

Copy link
Member

derberg commented May 20, 2024

@smoya
Copy link
Member

smoya commented May 20, 2024

Could you try it once locally

I ran this locally and got the same missing_scope errors. Will take a look at it; it is totally not ideal to use a user token here.

@Shurtu-gal
Copy link
Contributor Author

Could you try it once locally

I ran this locally and got the same missing_scope errors. Will take a look at it; it is totally not ideal to use a user token here.

Just curious, what are the disadvantages with user_token as long as it's a bot user 🤔?

@smoya
Copy link
Member

smoya commented May 22, 2024

Just curious, what are the disadvantages with user_token as long as it's a bot user 🤔?

The need of having to maintain a new user, store the credentials somewhere, give permissions to that user, install the app through that user, etc, makes it so complicated VS using bot tokens, which are meant for that.

I checked this on my own workspace and indeed it seems only administrators will be able to do such a thing. The permission for creating channels and usergroups are managed globally in the workspace settings; atm for AsyncAPI Workspace, anyone can create channels but not usergroups, so that's what the bot token will be able to do, just as a any other regular user. More context:

Google Chrome_D3pzNKrp@2x

We would need to move to the solution of having a dedicated user for this bot unfortunately.

@thulieblack how can we proceed with this? I know it is a pita, but there is no other solution if we really want this to happen.

cc @derberg

@Shurtu-gal
Copy link
Contributor Author

Great @smoya. Do you mind if I put this QA in doc as it may prove to be useful later on.

@smoya
Copy link
Member

smoya commented May 22, 2024

Great @smoya. Do you mind if I put this QA in doc as it may prove to be useful later on.

Of course! 👍

@smoya
Copy link
Member

smoya commented May 24, 2024

Please let's move any future discussion into the open issue #1072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Automate Slack user groups + channels creation and management
7 participants