Repository navigation
feat(slack, teams): rule channels invite people by email, and admins ask everyone to connect at once - #5195
Merged
Conversation
…ask everyone to connect at once A customer bringing about a thousand people into OneUptime asked whether Slack onboarding can be automated. Only a person's own sign-in connects their account, and that stays; everything around it no longer waits on it. - Rule-created Slack channels invite somebody who has not connected Slack by the Slack account with their OneUptime email address, as Add people, paging from chat and on-call user groups already do (SlackAccountByEmail, one cache between them). Guests, bots and deactivated accounts are left out; the channel's note names only whoever is found neither way. - Project owners and admins ask every member who has not connected their Slack or Microsoft Teams account at once: a card on the project's Slack and Microsoft Teams settings says how many have connected, and one button has OneUptime's bot message each of the rest a one-click Connect button (WorkspaceAskToConnect, GET/POST /workspace-ask-to-connect/<type>). People are found by email: Slack's people, or the rosters of the teams the Microsoft Teams app is in. The run goes on after the request answers, one per project and workspace under a lock, and skips whoever was asked in the last day. - The Microsoft Teams user settings page connects on ?connectAccount=true, as Slack's does. - The Slack and Microsoft Teams pages say so, in all seventeen languages.
…ding-automation-a970fc
Contributor
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A customer bringing about 1,000 people into OneUptime asked whether Slack onboarding can be automated, since every user has to connect their own Slack account "for things to work".
An admin still can't connect somebody else's account. Only the person's own sign-in writes that link (
WorkspaceUserAuthToken, held byWorkspaceUserAuthTokenWritersGuard), because the link makes the chat account act as that member, with their permissions. This PR makes everything around that sign-in hands-off.What
Rule-created Slack channels invite people by their email address
WorkspaceNotificationRuleService.findWorkspaceUserIdsToInvitenow tries the connected account first, then the Slack account with the person's OneUptime email address. This is the same lookup Add people on the record's card, paging from chat and on-call user groups already use.SlackAccountByEmail, with one cache, so the card and the rules ask Slack once between them."Ask everyone to connect", for Slack and Microsoft Teams
WorkspaceAskToConnectfinds every member who has not connected and was not asked in the last 24 hours, by their email address:users.lookupByEmailfor up to 20 people, orusers.listpages for more.?connectAccount=true. The link carries no token and never expires, and it connects only the account of whoever signs in with it. The email address only decides whom to message.GET/POST /workspace-ask-to-connect/<Slack | MicrosoftTeams>, for signed-in project owners and admins only. An API key is refused, because each message names the person who asked.?connectAccount=trueas Slack's already did.Docs
The Slack and Microsoft Teams pages in all 17 languages:
The new UI strings are extracted into every Dashboard locale as English placeholders, following the stage-2 process in the Locales README.
Tests
New:
WorkspaceChannelInviteByEmail.test.ts: both rule invite paths, guest/bot/deactivated, Slack refusals, cache, Teams.WorkspaceAskToConnect.test.ts: Slack one-by-one and paged, rate limit, refusals, the 24-hour skip, lock, stopped runs, Teams rosters, the message's escaping, connect URLs.WorkspaceAskToConnectAPI.test.ts: who may read and ask, workspace validation.WorkspaceAskToConnect.test.ts(types): reading answers back.AskToConnectCard.test.tsx: who sees it, confirm, POST, polling until done, refusal, everyone connected, Teams.Updated: the channel note's wording in
ChannelMembersNotAddedNotice.test.tsandQuietChannelsSlackEndToEnd.test.ts, and the docs translation test's lists.Run locally:
tscfor Common, App and the DashboardNot verified