chore(aci): migration to fix fallthrough_type on email Actions#106902
chore(aci): migration to fix fallthrough_type on email Actions#106902
Conversation
src/sentry/workflow_engine/migrations/0107_fix_email_action_fallthrough_type.py
Show resolved
Hide resolved
|
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
src/sentry/workflow_engine/migrations/0107_fix_email_action_fallthrough_type.py
Show resolved
Hide resolved
src/sentry/workflow_engine/migrations/0106_fix_email_action_fallthrough_type.py
Outdated
Show resolved
Hide resolved
d17bf57 to
86a18bc
Compare
src/sentry/workflow_engine/migrations/0106_fix_email_action_fallthrough_type.py
Outdated
Show resolved
Hide resolved
02dc653 to
1c78e3e
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
src/sentry/workflow_engine/migrations/0107_fix_email_action_fallthrough_type.py
Outdated
Show resolved
Hide resolved
src/sentry/workflow_engine/migrations/0107_fix_email_action_fallthrough_type.py
Outdated
Show resolved
Hide resolved
ceorourke
left a comment
There was a problem hiding this comment.
left some non blocking nits
| if target_type_str in ("Member", "Team"): | ||
| target_identifier = rule_action.get("targetIdentifier") | ||
| config["target_identifier"] = str(target_identifier) if target_identifier else str(None) | ||
| else: | ||
| config["target_identifier"] = None |
There was a problem hiding this comment.
Couldn't you do something like
config["target_identifier"] = str(rule_action.get("targetIdentifier"))
since None is the fallback value and IssueOwners wouldn't have one set?
| fallthrough_type = rule_action.get("fallthrough_type") | ||
| if fallthrough_type is None: | ||
| fallthrough_type = rule_action.get("fallthroughType", DEFAULT_FALLTHROUGH_TYPE) | ||
| data["fallthrough_type"] = str(fallthrough_type) |
There was a problem hiding this comment.
Same here I think you can simplify a bit
fallthrough_type = rule_action.get("fallthrough_type", "fallthroughType")
data["fallthrough_type"] = str(fallthrough_type) if fallthrough_type else DEFAULT_FALLTHROUGH_TYPE
We started handling fallthroughType correctly in dual writing here #106633
But we need a migration to fix the previously migrated email actions