-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(ACI): Correctly read target_type and target_identifier values from Action.config #104634
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #104634 +/- ##
========================================
Coverage 80.47% 80.47%
========================================
Files 9349 9349
Lines 401504 401505 +1
Branches 25802 25802
========================================
+ Hits 323129 323130 +1
Misses 77933 77933
Partials 442 442 |
dda78b2 to
6737b7c
Compare
| from sentry.models.organizationmemberteam import OrganizationMemberTeam | ||
| from sentry.models.projectownership import ProjectOwnership | ||
| from sentry.models.rule import Rule | ||
| from sentry.notifications.types import ActionTargetType, FallthroughChoiceType |
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.
This diff is rough - here's what I changed:
- Prefixed old tests with
legacy - Used enums instead of hard coding strings
- Refactored a bit to move reused vars into a
setUpmethod - Replicated all the legacy tests with workflow engine equivalents
29f93c5 to
17fdc4c
Compare
| } | ||
| target_type = ActionTargetType(self.data["targetType"]) | ||
| target_identifier = self.data.get("targetIdentifier", None) | ||
| # XXX: temporarily support both types, after ACI GA we should only need to support snake case |
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.
Unfortunately we'll need to support both until we completely rewrite how we send notifications 🥲 so we don't use Rules anymore
17fdc4c to
12d1b4c
Compare
Follow up to #104613 to properly read
target_typeandtarget_identifierfromActionmodels'configfield - we store them in snake case, not camel case. For now we need to support both as we are still processing some rules through the old system.