Skip to content

Link GitHub and Sentry accounts to Junior users reliably #2200

Open

Description

@sentry-junior

Provider accounts are only linked to a Junior user in a narrow case: a plugin that implements resolveOAuthAccount finishes an OAuth callback that a Slack actor started. Because of this, Sentry accounts never link, and many GitHub accounts don't either. Person-level lookups such as userLookup and PR assignment then can't connect a Slack user to their GitHub or Sentry account.

Current behavior

  • handlers/oauth-callback.ts writes the provider identity with upsertLinkedIdentity only when stored.actor?.platform === "slack" and the plugin returns an account.
  • Only junior-github implements resolveOAuthAccount. junior-sentry handles OAuth but never resolves the account, so getOAuthAccountProviders() leaves Sentry out and userLookup only offers slack and github.
  • OAuth connections started from the dashboard or web UI (web actor) skip linking. The web identity (provider: "junior", verified email) already resolves to the same junior_users row.
  • Linking was added in feat(tools): Add provider-scoped userLookup #1359 (2026-08-10). GitHub tokens connected before then were never backfilled, and since the stored token keeps working the user is never prompted to connect again.
  • pluginProviderAccountSchema has no email field, so a provider account can't contribute a verified email for the existing email-based user linking (chat/identities/README.md), even when it matches the user's Slack email.
  • junior-github resolves the account with GET /user only. That returns the profile email only when it is public. It does not call GET /user/emails, which lists every email on the account with verified and primary flags.
  • Junior authorizes GitHub users through GitHub App user access tokens. For these tokens, GET /user/emails needs the App's "Email addresses" user permission (read), not an OAuth scope (GitHub docs).
  • No oauth.callback.identity_link.failed errors appeared in Junior telemetry over the last 90 days. The link step is skipped, not crashing.

Gap

  • A user with a verified Slack email, an active GitHub connection, and a Sentry connection can still have no linked GitHub or Sentry identity.
  • Whether accounts get linked depends on which surface started the connection and when it was made, not on the person.

Proposals (from requester)

  • Link provider accounts when the user interacts through the web UI, not only from Slack.
  • Read all verified GitHub account emails (a GitHub account can have several) and match them against the user's verified Slack email. Match only verified addresses.
  • Use the user's verified Slack email as the connection point for provider accounts (for example, a verified Sentry account email that matches).

Reported by Burak Yigit Kaya.

via BYK.

--

View Junior Session [Sentry]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions