Repository navigation
feat(sentry-apps): Return installation UUID with org components - #127591
Conversation
Agents can read an app's issue-link form from the public components endpoint, but creating the issue needs the installation UUID, which only a private endpoint returns. Include it on each component. Refs ISWF-3567 Co-Authored-By: Athena Moghaddam <[email protected]>
| ).order_by("pk") | ||
|
|
||
| for install in installs: | ||
| installation_uuids[install.sentry_app_id] = str(install.uuid) |
There was a problem hiding this comment.
Can you give me an example for what the new data/payload shape will look like with these changes?
There was a problem hiding this comment.
Sure. Each component returned by GET /api/0/organizations/{org}/sentry-app-components/ gets one new top-level field, installationUuid. It's the UUID of the org's installation of that component's app. Nothing else in the payload changes.
Before:
[
{
"uuid": "6f1c0e2a-1b7d-4c55-9a7e-0d6b2b1f9c11",
"type": "issue-link",
"schema": {
"type": "issue-link",
"create": {
"uri": "/sentry/issues/create",
"required_fields": [
{"type": "text", "name": "title", "label": "Title"},
{"type": "select", "name": "teamId", "label": "Team", "uri": "/sentry/teams"}
]
},
"link": {
"uri": "/sentry/issues/link",
"required_fields": [
{"type": "select", "name": "issueId", "label": "Issue", "uri": "/sentry/issues/search"}
]
}
},
"error": "",
"sentryApp": {
"uuid": "a3b8f1d2-5c4e-4f60-8e21-7c9d0b6a4e33",
"slug": "linear",
"name": "Linear",
"avatars": []
}
}
]After:
[
{
"uuid": "6f1c0e2a-1b7d-4c55-9a7e-0d6b2b1f9c11",
"type": "issue-link",
"schema": { "...": "unchanged" },
"error": "",
"installationUuid": "e7d24b90-3f1a-4c8b-b5d6-2a9f8c7e1d44",
"sentryApp": {
"uuid": "a3b8f1d2-5c4e-4f60-8e21-7c9d0b6a4e33",
"slug": "linear",
"name": "Linear",
"avatars": []
}
}
]An agent then uses that UUID for the next two calls:
GET /api/0/sentry-app-installations/e7d24b90-.../external-requests/?uri=/sentry/teams&projectId=123
POST /api/0/sentry-app-installations/e7d24b90-.../external-issue-actions/
{"groupId": "456", "action": "create", "uri": "/sentry/issues/create",
"title": "...", "teamId": "..."}
Up to now, the only way to get e7d24b90-... was the private GET /organizations/{org}/sentry-app-installations/ endpoint, which the frontend uses.
The app-scoped GET /api/0/sentry-apps/{app}/components/ endpoint doesn't take an installation, so its response stays the same and has no installationUuid. The UUIDs and schema above are illustrative; I made them up for this example.
Upgrades the CLI's `@sentry/api` dependency from `^0.356.0` to `^0.399.0`, the release that includes getsentry/sentry-api-schema#108. That release exports a named type for every enum-valued query parameter, such as `ListOrganizationTraceItemAttributesQueryDataset`, so callers no longer need to derive them with `NonNullable<…["query"]>`. #1559 will switch its trace-item attribute types to these once this lands. The lockfile change only covers `@sentry/api`. `pnpm-workspace.yaml` moves the `minimumReleaseAgeExclude` entry to the new version, because 0.399.0 was published today. Two schema changes between 0.356.0 and 0.399.0 broke existing tests. Both changes match Sentry's current behavior, so the tests were updated rather than the code: - **Sentry App components:** the organization endpoint now returns a required `installationUuid` (getsentry/sentry#127591). The CLI validates this response against the schema, so the `issue-app-links` test fixture now includes the field; without it, all 37 issue-link tests failed. The org endpoint always passes `installation_uuids` to the serializer, so live responses always include the field. Self-hosted servers older than that change will fail this validation. - **Replay fields:** the replay index now accepts every replay response field, including `replay_type`, because the field list comes from `ReplayDetailsResponse` (getsentry/sentry#128518). The two tests that expected `replay_type` to be rejected now check a field that isn't in the schema, `device.model_id`. Verification: typecheck and lint pass. CLI tests: 11,295 passed and 6 failed. The 6 failures are permission tests that also fail on a clean `main` in my sandbox (completions, code-scanner, file-changes, telemetry, upgrade). <!-- junior-request-attribution:start --> via **BYK**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A7fba2603229556152deec3d2 --> -- [View Junior Session in Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A7fba2603229556152deec3d2/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
Agents like Seer Agent (code mode) and MCP should be able to create a Linear ticket for a Sentry issue using only the public API. Linear is a Sentry App, so that flow goes through the issue-link endpoints #124068 published as experimental:
GET /organizations/{org}/sentry-app-components/?filter=issue-linkreturns the app's create/link form.GET /sentry-app-installations/{uuid}/external-requests/loads options for select fields such as team.POST /sentry-app-installations/{uuid}/external-issue-actions/creates or links the issue.Steps 2 and 3 need the installation UUID, and nothing published returns it. Only the private
GET /organizations/{org}/sentry-app-installations/has it, so an agent can read the form but can't submit it.This adds
installationUuidto each component returned by the organization components endpoint, which already loads the installations. It also explains the create/link steps in the endpoint docs so agents can follow them from the OpenAPI spec.I didn't publish the installations list endpoint because its response can include the installation's OAuth grant
code. The private, app-scoped components endpoint doesn't change.The field is additive. First-party integrations (Jira, GitHub, …) are already covered by the public
GroupIntegrationDetailsEndpoint.Refs ISWF-3567
via @sentaur-athena.
--
View Junior Session [Sentry]