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

✨ feat(aci): add pagerduty/opsegnie migration utils #83565

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

iamrajjoshi
Copy link
Member

@iamrajjoshi iamrajjoshi commented Jan 16, 2025

continues #83123, adding migration helper utils for oncall integrations.

continuing to iterate on ABCs, now have introduced something called a FieldMapping dataclass.

Why do we need it? - Because we need Actions to work with Issue & Metric Alert registries, we need to consolidate the configuration for each integration for the API & UI.
More concretely, currently we use severity to mark priority in Issue Alert handlers and priority in Metric Alert. With this mapping we can change the key in the dict.

Another use this has is it will let us add sane defaults. Something we can improve is reducing the amount of optional fields in our code. For example, we have things such as OPSGENIE_DEFAULT_PRIORITY and PAGERDUTY_DEFAULT_SEVERITY defined which represent the default priority in the 3p if there is nothing configured. Here, I leverage this dataclass so we save the default value if nothing is configured. This should make the API and the UI much simpler and configurable.

closes https://getsentry.atlassian.net/browse/ACI-96
closes https://getsentry.atlassian.net/browse/ACI-97

@iamrajjoshi iamrajjoshi self-assigned this Jan 16, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 16, 2025
"priority": FieldMapping(
source_field="priority", default_value=str(OPSGENIE_DEFAULT_PRIORITY)
)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

here i am using the dataclass to enforce a default

@iamrajjoshi iamrajjoshi marked this pull request as ready for review January 16, 2025 15:48
@iamrajjoshi iamrajjoshi requested a review from a team as a code owner January 16, 2025 15:48
Copy link
Member

@ceorourke ceorourke left a comment

Choose a reason for hiding this comment

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

lgtm

@iamrajjoshi iamrajjoshi merged commit de60acb into master Jan 16, 2025
50 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/issue-alert-migration-helper-oncall-2 branch January 16, 2025 22:07
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 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