Repository navigation
feat(service-accounts): Create, edit and delete service accounts in settings - #131876
Merged
Merged
Conversation
…ettings Add create and edit pages and a delete action to the service account settings. The permissions picker is the Seer automation form's ServiceAccountPermissions, with the same default scopes. Accounts owned by a Seer automation can't be edited or deleted here. Refs ENG-9091 Co-Authored-By: Shaun Kaasten <[email protected]>
Contributor
📊 Type Coverage Diff
🔍 1 new type safety issue introducedType assertions (
This is informational only and does not block the PR. |
Co-Authored-By: Shaun Kaasten <[email protected]>
DominikB2014
approved these changes
Nov 20, 2026
DominikB2014
left a comment
Contributor
There was a problem hiding this comment.
just some nits, overall lgtm
skaasten
added a commit
that referenced
this pull request
Nov 20, 2026
Fixes navigation within the service accounts settings UI
-----
On customer domains, opening a service account from the settings list
loads the wrong org and fails with `GET /organizations/{orgSlug}/teams/
403`.
The path helpers in `paths.tsx` (added in #131876) wrap
every URL in `normalizeUrl`, and `Link`/`LinkButton` run `normalizeUrl`
on their `to` again. `normalizeUrl` isn't idempotent, so the second pass
reads `service-accounts` as an org slug and strips it:
`/settings/org-slug/service-accounts/42/` becomes
`/settings/service-accounts/42/`, then `/settings/42/`. The router then
matches `/settings/:orgId/` with `orgId = 42`. The New and Edit links
and the edit page breadcrumb break the same way.
The helpers now return org-scoped paths without normalizing them, so
`Link` normalizes them once. `navigate()` doesn't normalize, so the new,
edit and details pages wrap those calls in `normalizeUrl`.
<!-- junior-request-attribution:start -->
via @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 was referenced Nov 20, 2026
skaasten
added a commit
that referenced
this pull request
Nov 23, 2026
…ngs (#132066) <summary> Adds UI for showing/creating/revoking service account access tokens, gated by service-accounts feature flag. <img width="866" height="756" alt="image" src="https://github.com/user-attachments/assets/c3d73a57-cba3-49f1-81da-2a1fcd148953" /> <img width="892" height="756" alt="image" src="https://github.com/user-attachments/assets/9b8f1572-ec3c-46d4-bea1-a28f04cb2f21" /> <details> Service accounts can be created and edited in settings, but there was no way to give one a token, so they couldn't be used from CI or scripts yet. This PR adds token management to the service account details page, using the existing token endpoints. It's the last PR in the stack after #131795, #131876 and #132041. It's frontend only and stays behind `organizations:service-accounts`. The design follows the prototype in #131689. - **List:** an Access Tokens section shows each active token's name, a masked preview (`sntrym_` plus the last 4 characters), its scopes, created date, last used and expiry. Tokens that expire within 7 days or have already expired get a tag. The section has an empty state and pagination. - **Create:** a modal asks for a name, scopes (every available scope, or a chosen subset) and an expiration. Expiration defaults to 30 days, matching the API, and can be set to never. Only scopes held by both the account and the current user are offered, because the API rejects any others. Errors from the API show on the matching field. - **Show once:** after a token is created, a second modal shows its value with a copy button and says it won't be shown again. The API returns the value only in the create response, so clicking outside the modal or pressing Escape doesn't close it. The value lives only in that modal's props. - **Revoke:** a confirm dialog names the token by its masked preview. - **Access:** creating and revoking use the same `useCannotManageReason` check as Edit and Delete. They're disabled for accounts owned by a Seer automation, which are read-only in settings, and for users without `service_account:write`. Tokens are still listed for those accounts. `getFieldErrors` in `serviceAccountForm.tsx` now takes a list of fields, so the token form can reuse it. </details> </summary> Refs ENG-9091 <!-- junior-request-attribution:start --> via @skaasten. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A37638c005805f15c953512fe5dd9cd22 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A37638c005805f15c953512fe5dd9cd22) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A37638c005805f15c953512fe5dd9cd22/?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
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.
UI for creating / editing / deleting service accounts, behind feature flag.
Service accounts attached to Seer Workflow Configs cannot be edited.
Orgs can now see their service accounts in settings (#131795), but creating, editing or deleting one still means calling the API directly. This is the second PR in the service account settings stack, and it adds those actions to Settings → Service Accounts. The UI follows @marthalyndon's prototype (#131689), and everything stays behind
organizations:service-accounts.service-accounts/new/) and Edit (service-accounts/:id/edit/) pages share one form: name, permissions, and project access (All projects or specific projects).ServiceAccountPermissionspicker and the same default scopes, so the two places never offer different access.DEFAULT_SERVICE_ACCOUNT_SCOPESmoves frommetricAutomationForm.tsxintoserviceAccountAccess.tsxso both forms share it.useServiceAccountAccessmirrors the API's checks: write actions needservice_account:write, and only a role with access to every project can pick All projects. Without access, the buttons are disabled with a tooltip.ownerKind: seer_workflow_config) can't be edited or deleted here, because the automation manages their access.detail, and the form shows them on the matching field.Nothing changes for orgs without the flag.
Next in the stack: the tokens section (token list, create-token dialog that shows the secret once, revoke).
Refs ENG-9091
via @skaasten.
--
View Session [Sentry]