-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
✨ feat(aci): add discord/msteam issue alert migration helper #83455
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 discord/msteam issue alert migration helper #83455
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #83455 +/- ##
==========================================
+ Coverage 87.52% 87.54% +0.02%
==========================================
Files 9405 9405
Lines 537144 537514 +370
Branches 21136 21136
==========================================
+ Hits 470120 470572 +452
+ Misses 66673 66591 -82
Partials 351 351 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remind me of the policy when migrating a list of actions, but one/some of them are malformed? will we migrate all or none, or only the valid ones?
# Remove excluded keys | ||
return {k: v for k, v in self.action.items() if k not in EXCLUDED_ACTION_DATA_KEYS} | ||
# Remove excluded keys and required fields | ||
excluded_keys = EXCLUDED_ACTION_DATA_KEYS + self.required_fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are all required fields guaranteed to be stored as fields on Action
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, required fields are the ones stores in integration_id
, target_identifier
, target_display
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be some kind of assert for this?
we will only migrate the valid ones |
# Remove excluded keys | ||
return {k: v for k, v in self.action.items() if k not in EXCLUDED_ACTION_DATA_KEYS} | ||
# Remove excluded keys and required fields | ||
excluded_keys = EXCLUDED_ACTION_DATA_KEYS + self.required_fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be some kind of assert for this?
we assert here: sentry/tests/sentry/workflow_engine/migration_helpers/test_migrate_rule_action.py Lines 110 to 112 in c2947b1
|
continues #83123, adding migration helper utils for discord and msteams.
updated the base class a bit so it returns None by default for optional fields. also fixed a tiny bug in the base class blob sanitize function so i also remove the required attributes (since they are part of the first-class fields (
integration_id
,target_identifier
, etc.) on the model)MsTeams doesn't have a dataclass defined b/c we won't have anything special saved in data blob.