hackforla / VRMS

Volunteer Relationship Management System: This is an ambitious project to create a system that will help us measure our human capital development, reduce repetitive tasks and processes, and improve outcomes.
GNU Affero General Public License v3.0
40 stars 79 forks source link

Add Slack Invite Integration #136

Closed sarL3y closed 3 years ago

sarL3y commented 4 years ago

Overview

A user should be invited to the slack org upon creating profile.

Action Items

Dependencies

145

nickbeaird commented 4 years ago

This is not done yet, although it is small. I spent my time mostly trying to get through the authentication issues. Matt got me unblocked towards the end, but I had already spent my time available this week for that. Can follow up here soon.

alex-anakin commented 4 years ago

@alex-anakin will ping Nick

alex-anakin commented 4 years ago

Nick is unable to log in the Github. He asked me to add his update:

  1. Progress: same as the last comment (see above).
  2. Blockers: none at this time
  3. Availability: Thursday - Saturday
  4. ETA: next team check-in
nickbeaird commented 4 years ago

I am adding this for tomorrow's meetup.

  1. Progress: I did some research into the functionality. I will have to clarify what the scope is before moving forward.

  2. Blockers: Slack changed it's API allowing 3rd party applications to administrate and manage users. The new scope makes it much more challenging to manage users. In other words, they were losing money when people were adding users to Slack without paying for that service. -> Potential workaround 1: We have an Enterprise Slack accounts that can manage users using the API. This is available to only that larger tier of users. This may have more features and I am unable to test this at this time. -> Potential work-around 2: We could use a legacy API token to create the functionality. The current methodology for getting an APIO token is to create a Slack App using OAuth2.0. You then add the permissions for the app. The scope required to invite users to an application is not available to the new OAuth2.0 API. They also no longer allow users to create legacy tokens, and they will be removing the feature entirely here soon. If we have one, then we can get around this for Hack for LA. -> Potential work-around 3: We set data fields in the models for Slack to allows our Code for America teams to add their Slack application information per workspace. Then the responsibility to create a Slack app is made per region (i.e. Hack for LA, Hack for Orange County, etc). Then we use an undocumented API to use that slack app authentication to add a user. The downside is that this method is undocumented and is likely to change in the coming months.

  3. Availability: Wednesday - Friday, Some on the weekend

  4. ETA: TBD after a general approach is determined.

ExperimentsInHonesty commented 4 years ago

@nickbeaird The way we currently invite people to hackforla's slack is we send them to hackforla.org/slack which redirects to https://hackforla-slack.herokuapp.com/

which uses this code library: https://github.com/emedvedev/slackin-extended

ExperimentsInHonesty commented 4 years ago

@nickbeaird The way VRMS will operate in relationship to invitations is that we will check to see if they are already a member of our slack (via their email address). If they are, we get their slack handle and member ID. If their email address is not in our slack, then we automatically send them an invite, which they have to accept via email (the same way they accept now).

According to this post, Nina is the person who updates the heroku account. Not sure whose account this is (I don't get the bill). https://github.com/hackforla/website/issues/110#issuecomment-521455617

nickbeaird commented 4 years ago

I am posting this for future posterity. Here are some useful links on the topic.

Slack Apps: https://api.slack.com/start/overview#apps Legacy Tokens: https://api.slack.com/legacy/custom-integrations/legacy-tokens Enterprise Accounts for User Administration: https://api.slack.com/admins/workspaces Slack API: https://api.slack.com/web Conversations API for users already in the Slack Space: https://api.slack.com/docs/conversations-api Community Work-around1: https://github.com/outsideris/slack-invite-automation#issue-token Community Work-around2: https://github.com/ErikKalkoken/slackApiDoc/blob/master/users.admin.invite.md (uses legacy token) Community Work-around3: https://github.com/emedvedev/slackin-extended (uses legacy token)

nickbeaird commented 4 years ago

Hi @ExperimentsInHonesty, I will do a little digging into this already. It looks like this application requires a legacy token. That is great if we have one, but that means that Jonathan and I personally cannot make one for our own development or testing. Also, this may be removed entirely here soon. https://api.slack.com/legacy/custom-integrations/legacy-tokens

nickbeaird commented 4 years ago

In review to the previous conversations:

Progress:

  1. I talked with Jonathan and Susan on how our Slack work might go together. We have a basic plan that we will check in together later when our work is closer.
  2. I have a basic working frontend that invites users to a slack workspace. It needs some refactoring and refining.
  3. We aim to not use slack plugin described in the description of this ticket, and the one being used for slack invites thus far. slackin-extended requires a legacy slack token, which cannot be recreated locally. It inhibits local development.

Blockers: We do not have user data in the test db, and the app is not functional without it.

Availability: This week.

ETA: Next checkin and after the data issues have been resolved.

nickbeaird commented 4 years ago

Progress: I think that I have a path forward. Blockers: No known current blockers. Availability: Open this week. ETA: Next week.

nickbeaird commented 4 years ago

Progress: I made a test slack space that people can use and added the credentials to the team project.
Blockers: It would be nice to know that I am not stomping on known work, and would prefer to allow Jonathan to merge in his work prior to getting my complete, or vice versa. I have talked to Jonathan and he is way further along in a bigger slack feature, so I think that we should give that to him.
Availability: Only a few nights this week.
ETA: Dependent on the work that Jonathan and Susan have. If they merge, one week.

alex-anakin commented 4 years ago

@nickbeaird please ping Susan and Jonathan

nickbeaird commented 4 years ago

Progress: Have a half working branch.

Blockers: Waiting on PR to be merged from Jonathan.

Availability: 3-4pm

ETA: 1 week.

nickbeaird commented 4 years ago

Waiting on blocking PR to merge

nickbeaird commented 3 years ago

After talking with Alex, we are going to close this ticket and reimplement in the new MVP when that is applicable.