open-swe/agent/dashboard
Johannes du Plessis 427bfe4f56
feat: Store-backed GitHub/Slack user mapping (self-service + admin) (#1369)
* Replace hardcoded GitHub-email map with Store-backed user mapping

Move the static GITHUB_USER_EMAIL_MAP to a Store-backed bidirectional
mapping (GitHub login <-> work email <-> optional Slack ID) with an
in-process cache, self-service onboarding, and admin management.

- agent/dashboard/user_mappings.py: Store CRUD + login/email/slack-id
  indexes, sync cache readers for hot paths, async fallthrough, and a
  bulk_import that preserves existing richer records.
- Migrate all read sites (auth.py, agent_overrides.py, authorship.py,
  github_comments.py, webapp.py x2) off the dict.
- Unmapped Slack tags now run on the GitHub App installation token
  (use_installation_token_fallback) and get an ephemeral "link your
  GitHub account" prompt carrying the Slack id + email via a signed
  account-link token threaded through the OAuth state.
- OAuth callback completes a self-service (org-gated) mapping from that
  token, falling back to the verified GitHub email.
- Admin CRUD endpoints + one-time legacy import; dashboard UI section.
- Legacy dict retained only as the import payload (no longer read).

Tests: mapping store, account-link round-trip + completion, mapped vs
unmapped Slack flows; existing trust-gate tests updated to prime cache.

* Address review: cold-cache email resolution + stale alias de-indexing

- agent_overrides: add resolve_login_from_email_async that falls through to
  the Store on a cold cache; use it at the async repo-resolution call sites
  (Slack repo config, Linear comment, owner-metadata) so a mapped user still
  resolves to their GitHub login + dashboard default_repo on a fresh worker.
- user_mappings.upsert_mapping: de-index the existing login before re-indexing
  so a changed email/Slack id no longer leaves stale aliases resolving to the
  login in-process.
- Tests for both fixes; update Slack repo-config test to patch the async resolver.
2026-06-01 14:37:19 -07:00
..
__init__.py feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
admin.py feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
agent_overrides.py feat: Store-backed GitHub/Slack user mapping (self-service + admin) (#1369) 2026-06-01 14:37:19 -07:00
analyzer_cron.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
enabled_repos.py feat: restructure Open SWE Review tab + wire create_prs (#1319) 2026-05-21 09:17:07 -07:00
message_adapter.py feat: add Agents chat UI for cloud threads (#1323) 2026-05-22 18:15:59 +00:00
oauth.py feat: Store-backed GitHub/Slack user mapping (self-service + admin) (#1369) 2026-06-01 14:37:19 -07:00
options.py feat: upgrade default agent + reviewer model to Opus 4.8 (#1350) 2026-05-28 10:59:29 -07:00
profiles.py feat: Configure subagent model defaults (#1342) 2026-05-27 12:34:52 -07:00
review_style_jobs.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
review_styles.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
routes.py feat: Store-backed GitHub/Slack user mapping (self-service + admin) (#1369) 2026-06-01 14:37:19 -07:00
team_settings.py fix: include reviewer trace links (#1351) 2026-05-28 13:48:14 -07:00
thread_api.py feat: surface all of a user's agent threads in the Agents UI (#1366) 2026-06-01 13:01:20 -07:00
user_mappings.py feat: Store-backed GitHub/Slack user mapping (self-service + admin) (#1369) 2026-06-01 14:37:19 -07:00