Skip to content

feat(settings): Add service accounts UI prototype - #131034

Draft
marthalyndon wants to merge 1 commit into
masterfrom
martha.peck/prototype/service-accounts-ui
Draft

marthalyndon wants to merge 1 commit into
masterfrom
martha.peck/prototype/service-accounts-ui

Conversation

@marthalyndon

Copy link
Copy Markdown
Contributor

Design prototype, not meant to merge as is. This is a clickable mock of the service accounts settings flow, built to drive design discussion. All data is mocked in memory and resets on reload; nothing calls the backend.

It covers the whole flow under Settings → Service Accounts (next to Members):

  • List of service accounts
  • Create / edit with project access, a permission preset ("Start from"), guardrails, and a per-resource Access table that switches to Custom when you change a row
  • Details with a summary strip, the access tokens table, and the account's permissions
  • Create token modal and the show-once token dialog
  • Revoke token and delete account (type the name to confirm)

The permissions table follows the layout of the Seer automation picker (#130820), using the proposed granular scopes and bundles from #128556. Everything is built from Scraps and existing shared components (SimpleTable, ConfirmDelete, TextCopyInput, the Scraps form system).

To try it locally, turn on the flag, then reload:

localStorage.setItem('feature-flag-overrides', JSON.stringify({'service-accounts': true}))

Add ?as=owner, ?as=admin or ?as=member to any page to preview the different permission states (disabled buttons and tooltips).

Refs ENG-8854

Design prototype of the service accounts settings flow: list, create and edit, details with access tokens, token creation, revoke and delete. Data is mocked in memory; nothing calls the backend.

Refs ENG-8854
@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

ENG-8854

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

decision-model-linter

frontend

static/app/views/settings/organizationServiceAccounts/useServiceAccountAccess.tsx

  • warn usesUrlQueryParamWithoutNuqs = TRUE (0.97): URL query params should be read and updated through nuqs, with useQueryState or useQueryStates in React or createLoader elsewhere, and a parser (for repeated-key lists, parseAsStringArray). Page filters should come from usePageFilters. This file reads or updates a query param through location.query or another API.

security

static/app/views/settings/organizationServiceAccounts/mockServiceAccountApi.tsx

  • warn usesRandomForSecrets = TRUE (0.71): Tokens, codes, and passwords should be generated with the secrets module. This file generates one with the random module.

decision-model-linter: 140 calls on 18 files, 417,890 input tokens, $0.018, model typesafe/jev-1.13-20260917

@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 96.02% 96.03% 🟢 +0.01%
Typed 142,192 142,609 🟢 +417
Untyped 5,890 5,900 🔴 +10
🔍 10 new type safety issues introduced

Non-null assertions (!) (7 new)

File Line Detail
static/app/views/settings/organizationServiceAccounts/mockServiceAccountApi.tsx 95 accounts[0]!
static/app/views/settings/organizationServiceAccounts/mockServiceAccountApi.tsx 137 accounts[1]!
static/app/views/settings/organizationServiceAccounts/permissionRows.tsx 140 writeScopes[0]!
static/app/views/settings/organizationServiceAccounts/serviceAccountData.tsx 439 BUNDLES[0]!
static/app/views/settings/organizationServiceAccounts/serviceAccountForm.tsx 59 BUNDLES.find(bundle => bundle.id === DEFAULT_BUNDLE_ID)!
static/app/views/settings/organizationServiceAccounts/serviceAccountForm.tsx 143 BUNDLES.find(b => b.id === CUSTOM_BUNDLE_ID)!
static/app/views/settings/organizationServiceAccounts/serviceAccountForm.tsx 145 GUARDRAILS.find(g => g.id === id)!

Type assertions (as) (3 new)

File Line Detail
static/app/views/settings/organizationServiceAccounts/createTokenModal.tsx 66 `as 'all'
static/app/views/settings/organizationServiceAccounts/createTokenModal.tsx 68 as Expiration — '90' as Expiration
static/app/views/settings/organizationServiceAccounts/useServiceAccountAccess.tsx 18 as ViewerRole — value as ViewerRole

This is informational only and does not block the PR.

Comment on lines +208 to +210
const secret = Array.from({length: 48}, () =>
Math.floor(Math.random() * 16).toString(16)
).join('');
skaasten added a commit that referenced this pull request Nov 19, 2026
… pages (#131795)

Adds Service Accounts page in the Org Settings Section, with a details
page showing its projects and permissions.

<img width="1082" height="361" alt="image"
src="https://github.com/user-attachments/assets/27a9aaaf-e6e7-4dbc-919a-e7ac6e164ff6"
/>

<img width="825" height="682" alt="image"
src="https://github.com/user-attachments/assets/ed8cb6e3-772f-45e2-b501-8a0116bfa8a8"
/>

----------

The service account API is done, but orgs have no way to see or manage
their service accounts in Sentry. This is the first PR in a stack that
builds the settings UI on the real API, using @marthalyndon's prototype
(#131034, #131689) as the UI template. The stack is split so each PR
stays small to review.

Adds **Settings → Service Accounts** (next to Members), gated by
`organizations:service-accounts`. The nav item is hidden without the
flag, and a layout route renders Not Found for every page under
`service-accounts/`.

- **List** (`GET /service-accounts/`): name, owner, permission count,
project access and created date.
- **Details** (`GET /service-accounts/:id/`): owner, permissions,
project access, created date, and a read-only Resource | Access table.

Both pages show the account's `ownerKind` the same way: Organization,
Seer automation, or Unknown when the API returns null.

Permissions use the same resources and levels as the Seer automation
form, so the two never disagree: the table is built from `PERMISSIONS`
and `getPermissionLevel` in
`seerWorkflows/automations/serviceAccountAccess.tsx`, now exported. The
prototype's fixed permission levels, description, creator, token count
and last-activity fields aren't in the API, so they're left out.

Nothing changes for orgs without the flag.

Next in the stack: create, edit and delete, then the tokens section.

Refs ENG-9091

<!-- junior-request-attribution:start -->
via [automation
`evt_96f99ce311a0097e57d5a80fb82b61c7`](https://junior-prod.sentry.dev/automations/evt_96f99ce311a0097e57d5a80fb82b61c7)
· Run ID `dispatch_9cc8f0b969117bd3a2195ff4f0c32807`, @skaasten.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!--
junior-conversation-id:agent-dispatch%3Adispatch_9cc8f0b969117bd3a2195ff4f0c32807
-->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_9cc8f0b969117bd3a2195ff4f0c32807)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_9cc8f0b969117bd3a2195ff4f0c32807/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Shaun Kaasten <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — a8856fe5 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants