Skip to content

🔧 chore(aci): organization action handlers into integrations directory#89140

Merged
iamrajjoshi merged 7 commits into
masterfrom
raj/aci/organization-action-handlers
Apr 10, 2025
Merged

🔧 chore(aci): organization action handlers into integrations directory#89140
iamrajjoshi merged 7 commits into
masterfrom
raj/aci/organization-action-handlers

Conversation

@iamrajjoshi

@iamrajjoshi iamrajjoshi commented Apr 9, 2025

Copy link
Copy Markdown
Collaborator

this pr reorganizes the action handler folder structure.

i was running into problems with circular dependencies and not registering the handlers correctly. this pr fixes it by moving all action handlers out of the workflow_engine repo.

we follow the src/integrations/handlers/ folder structure which prevents all circular imports.

i also verified that all the handlers are properly registered in the app:

<Type.EMAIL: 'email'>: <class 'sentry.notifications.notification_action.action_handler_registry.email_handler.EmailActionHandler'>
<Type.PLUGIN: 'plugin'>: <class 'sentry.notifications.notification_action.action_handler_registry.plugin_handler.PluginActionHandler'>
<Type.SENTRY_APP: 'sentry_app'>: <class 'sentry.notifications.notification_action.action_handler_registry.sentry_app_handler.SentryAppActionHandler'>
<Type.WEBHOOK: 'webhook'>: <class 'sentry.notifications.notification_action.action_handler_registry.webhook_handler.WebhookActionHandler'>
<Type.OPSGENIE: 'opsgenie'>: <class 'sentry.integrations.opsgenie.handlers.opsgenie_handler.OpsgenieActionHandler'>
<Type.SLACK: 'slack'>: <class 'sentry.integrations.slack.handlers.slack_action_handler.SlackActionHandler'>
<Type.PAGERDUTY: 'pagerduty'>: <class 'sentry.integrations.pagerduty.handlers.pagerduty_handler.PagerdutyActionHandler'>
<Type.GITHUB: 'github'>: <class 'sentry.integrations.github.handlers.github_handler.GithubActionHandler'>
<Type.GITHUB_ENTERPRISE: 'github_enterprise'>: <class 'sentry.integrations.github_enterprise.handlers.github_enterprise_handler.GithubEnterpriseActionHandler'>
<Type.JIRA: 'jira'>: <class 'sentry.integrations.jira.handlers.jira_handler.JiraActionHandler'>
<Type.JIRA_SERVER: 'jira_server'>: <class 'sentry.integrations.jira_server.handlers.jira_server_handler.JiraServerActionHandler'>
<Type.AZURE_DEVOPS: 'azure_devops'>: <class 'sentry.integrations.vsts.handlers.azure_devops_handler.AzureDevopsActionHandler'>
<Type.MSTEAMS: 'msteams'>: <class 'sentry.integrations.msteams.handlers.msteams_handler.MSTeamsActionHandler'>
<Type.DISCORD: 'discord'>: <class 'sentry.integrations.discord.handlers.discord_handler.DiscordActionHandler'>

the folder structure looks something like:

/integrations/slack/handlers/slack_action_handler.py
/integrations/github/handlers/github_action_handler.py
/integrations/jira/handlers/jira_action_handler.py
...

@iamrajjoshi iamrajjoshi self-assigned this Apr 9, 2025
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 9, 2025
@codecov

codecov Bot commented Apr 9, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.66667% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ntegrations/slack/handlers/slack_action_handler.py 66.66% 1 Missing ⚠️
...n_action/action_handler_registry/plugin_handler.py 91.66% 1 Missing ⚠️
..._action/action_handler_registry/webhook_handler.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #89140       +/-   ##
===========================================
+ Coverage   61.71%   87.69%   +25.97%     
===========================================
  Files       10092    10107       +15     
  Lines      571118   571266      +148     
  Branches    22447    22447               
===========================================
+ Hits       352473   500979   +148506     
+ Misses     218237    69879   -148358     
  Partials      408      408               

@iamrajjoshi iamrajjoshi marked this pull request as ready for review April 9, 2025 15:33
@iamrajjoshi iamrajjoshi requested review from a team as code owners April 9, 2025 15:33
@iamrajjoshi iamrajjoshi changed the title 🔧 chore(aci): organization action handlers 🔧 chore(aci): organization action handlers into integrations Apr 9, 2025
@iamrajjoshi iamrajjoshi changed the title 🔧 chore(aci): organization action handlers into integrations 🔧 chore(aci): organization action handlers into integrations directory Apr 9, 2025

@GabeVillalobos GabeVillalobos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Colocating the handlers with their integration code makes sense to me. And we're sure this addresses the registration issue globally?

from sentry.rules import rules

from .actions.create_ticket import GitHubEnterpriseCreateTicketAction
from .handlers import GithubEnterpriseActionHandler # noqa: F401,F403

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what are these specific qa things we're disabling?

@iamrajjoshi iamrajjoshi merged commit 21a3b9d into master Apr 10, 2025
@iamrajjoshi iamrajjoshi deleted the raj/aci/organization-action-handlers branch April 10, 2025 14:41
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 26, 2025
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