Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hc): Silo fixes for OrganizationAlertRuleAvailableActionIndexEndpoint #57949

Merged

Conversation

RyanSkonnord
Copy link
Member

Adapt OrganizationAlertRuleAvailableActionIndexEndpoint and get_available_action_integrations_for_org to run in the region silo.

Introduce a prepare_sentry_app_components method to AppService. Remove the method of the same name from the SentryAppInstallation model. (It previously dispatched to the same module-level function that AppService now calls. The model method was called nowhere else.)

Mark OrganizationAlertRuleAvailableActionIndexEndpointTest as stable. Change setup to pass RPC models as needed.

…oint

Adapt OrganizationAlertRuleAvailableActionIndexEndpoint and
get_available_action_integrations_for_org to run in the region silo.

Introduce a prepare_sentry_app_components method to AppService. Remove
the method of the same name from the SentryAppInstallation model. (It
previously dispatched to the same module-level function that AppService
now calls. The model method was called nowhere else.)

Mark OrganizationAlertRuleAvailableActionIndexEndpointTest as stable.
Change setup to pass RPC models as needed.
@RyanSkonnord RyanSkonnord requested review from a team as code owners October 11, 2023 22:15
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 11, 2023
from sentry.models.integrations.sentry_app_installation import prepare_sentry_app_components

installation = SentryAppInstallation.objects.get(id=installation_id)
values = json.loads(values_json) if values_json else None
Copy link
Member

Choose a reason for hiding this comment

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

Should we handle json parsing failures here? We are getting a JSON blob off the wire.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good idea, and one that we should probably generalize to other RPC methods. (Grep for data_json to see those cases.)

However, considering that it's not used by the one call site and may remain unused indefinitely, I'll just remove it. We can always add it later (with good validation) when we need to.

@RyanSkonnord RyanSkonnord merged commit 53edebb into master Oct 12, 2023
50 checks passed
@RyanSkonnord RyanSkonnord deleted the hc-fix-organization_alert-rule-available-action-index branch October 12, 2023 18:57
@RyanSkonnord RyanSkonnord added the Trigger: Revert add to a merged PR to revert it (skips CI) label Oct 13, 2023
@getsentry-bot
Copy link
Contributor

revert failed (conflict? already reverted?) -- check the logs

RyanSkonnord added a commit that referenced this pull request Oct 13, 2023
RyanSkonnord added a commit that referenced this pull request Oct 13, 2023
#58091)

Rolling back #57949 to address
SENTRY-16NH (https://sentry.sentry.io/issues/4544284664/)

The original fix should be mostly okay but `RpcSentryAppComponent`
should not have `Mapping[str, Any]` as a field, which seems to be the
root of the problem.
RyanSkonnord added a commit that referenced this pull request Oct 16, 2023
Restore #57949, which was reverted by #58091. Fix
SENTRY-16NH (https://sentry.sentry.io/issues/4544284664/).

Adapt OrganizationAlertRuleAvailableActionIndexEndpoint and
get_available_action_integrations_for_org to run in the region silo.

Introduce a prepare_sentry_app_components method to AppService. Remove
the method of the same name from the SentryAppInstallation model. (It
previously dispatched to the same module-level function that AppService
now calls. The model method was called nowhere else.)

Mark OrganizationAlertRuleAvailableActionIndexEndpointTest as stable.
Change setup to pass RPC models as needed.
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2023
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 Trigger: Revert add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants