Skip to content

ref(sentry-apps): Improve RpcSentryAppError with from_exc factory method#106424

Merged
leeandher merged 5 commits intomasterfrom
leander/sai-region-service-7-update-errors
Jan 16, 2026
Merged

ref(sentry-apps): Improve RpcSentryAppError with from_exc factory method#106424
leeandher merged 5 commits intomasterfrom
leander/sai-region-service-7-update-errors

Conversation

@leeandher
Copy link
Member

@leeandher leeandher commented Jan 15, 2026

Add RpcSentryAppError.from_exc() factory method and respond_rpc_sentry_app_error() endpoint helper. Previously we were swallowing public_context when converting exceptions to RPC errors.

Part of the sentry app installation endpoint migration stack.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 15, 2026
Base automatically changed from leander/sai-region-service-6-record-interaction to master January 16, 2026 15:22
Add a factory method to RpcSentryAppError that creates error objects from
SentryAppBaseError exceptions, capturing error_type, public_dict, and
webhook_context. This simplifies exception handling in the region service
and adds respond_rpc_sentry_app_error() to the base endpoint for surfacing
these errors to clients.
@leeandher leeandher force-pushed the leander/sai-region-service-7-update-errors branch from 892d372 to da1a9a4 Compare January 16, 2026 15:23
@leeandher leeandher marked this pull request as ready for review January 16, 2026 15:38
@leeandher leeandher requested review from a team as code owners January 16, 2026 15:38
The file header explicitly states not to use `from __future__ import
annotations` in hybrid cloud RPC model files to allow type reflection.
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Add public_context field and get_public_dict() method that mirrors
SentryAppBaseError.to_public_dict() for creating error responses.
Change RpcPlatformExternalIssue to use int types and rename issue_id to
group_id for consistency. Add projects list to RpcServiceHookProjectsResult
so endpoints can check project access. Update serializers to accept RPC types.
…name

Update assertions to use group_id instead of issue_id to match the
model changes.
@leeandher leeandher merged commit 16b526d into master Jan 16, 2026
65 of 66 checks passed
@leeandher leeandher deleted the leander/sai-region-service-7-update-errors branch January 16, 2026 19:39
BYK pushed a commit that referenced this pull request Jan 19, 2026
…hod (#106424)

Add `RpcSentryAppError.from_exc()` factory method and
`respond_rpc_sentry_app_error()` endpoint helper. Previously we were
swallowing `public_context` when converting exceptions to RPC errors.

Part of the sentry app installation endpoint migration stack.
leeandher added a commit that referenced this pull request Jan 19, 2026
…106461)

Convert 6 sentry app installation endpoints from `@region_silo_endpoint`
to `@all_silo_endpoint` by replacing direct database queries with RPC
service calls.

**Depends on:** #106526 (must be deployed first)

Endpoints converted:
- `installation_external_requests.py` - uses `get_select_options` RPC
- `installation_external_issue_actions.py` - uses `create_issue_link`
RPC
- `installation_external_issues.py` - uses `create_external_issue` RPC
- `installation_external_issue_details.py` - uses
`delete_external_issue` RPC
- ~~`installation_service_hook_projects.py` - uses service hook RPCs~~
Deferred for a follow up
- `sentry_app_interaction.py` - uses interaction stats RPCs

Also removes obsolete API gateway proxy code since these endpoints no
longer need proxying:
- Emptied `SENTRY_APP_REGION_URL_NAMES` tuple
- Removed `proxy_sentryappinstallation_request` and
`proxy_sentryapp_request` functions
- Removed related proxy tests

This enables these endpoints to be called from both control and region
silos, which is required for the hybrid cloud migration.

Continues the work from #106424.

---------

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants