-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore(aci): handle workflows or rules in integrations sans feature flag #106048
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
Merged
cathteng
merged 6 commits into
cathy/aci/workflow-rule-in-digests
from
cathy/aci/workflow-rule-integrations
Jan 12, 2026
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
613cec0
handle workflows or rules in integrations sans feature flag
cathteng 6a98d68
fix tests
cathteng bd99653
fix typing
cathteng e9b7f3b
fix tests
cathteng b7c1a80
improvements
cathteng 9462e6b
found a straggler
cathteng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,6 @@ | |
| from sentry.models.repository import Repository | ||
| from sentry.models.rule import Rule | ||
| from sentry.models.team import Team | ||
| from sentry.notifications.notification_action.utils import should_fire_workflow_actions | ||
| from sentry.notifications.notifications.base import ProjectNotification | ||
| from sentry.notifications.platform.slack.renderers.seer import SeerSlackRenderer | ||
| from sentry.notifications.platform.templates.seer import SeerAutofixTrigger | ||
|
|
@@ -64,7 +63,7 @@ | |
| dedupe_suggested_assignees, | ||
| get_suspect_commit_users, | ||
| ) | ||
| from sentry.notifications.utils.rules import get_key_from_rule_data | ||
| from sentry.notifications.utils.rules import get_rule_or_workflow_id | ||
| from sentry.services.eventstore.models import Event, GroupEvent | ||
| from sentry.snuba.referrer import Referrer | ||
| from sentry.types.actor import Actor | ||
|
|
@@ -669,18 +668,22 @@ def build(self, notification_uuid: str | None = None) -> SlackBlock: | |
|
|
||
| rule_id = None | ||
| rule_environment_id = None | ||
| key = "legacy_rule_id" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe 'rule_id_type'? "key" is pretty vague. |
||
| if self.rules: | ||
| if features.has("organizations:workflow-engine-ui-links", self.group.organization): | ||
| rule_id = int(get_key_from_rule_data(self.rules[0], "workflow_id")) | ||
| workflow = Workflow.objects.filter(id=rule_id).first() | ||
| rule_environment_id = workflow.environment_id if workflow else None | ||
| elif should_fire_workflow_actions(self.group.organization, self.group.type): | ||
| rule_id = int(get_key_from_rule_data(self.rules[0], "legacy_rule_id")) | ||
| rule = Rule.objects.filter(id=rule_id).first() | ||
| rule_environment_id = rule.environment_id if rule else None | ||
| else: | ||
| try: | ||
| key, value = get_rule_or_workflow_id(self.rules[0]) | ||
| except AssertionError: | ||
| rule_id = self.rules[0].id | ||
| rule_environment_id = self.rules[0].environment_id | ||
| else: | ||
| if key == "workflow_id": | ||
| rule_id = int(value) | ||
| workflow = Workflow.objects.filter(id=rule_id).first() | ||
| rule_environment_id = workflow.environment_id if workflow else None | ||
| else: | ||
| rule_id = int(value) | ||
| rule = Rule.objects.filter(id=rule_id).first() | ||
| rule_environment_id = rule.environment_id if rule else None | ||
|
|
||
| # build up actions text | ||
| if self.actions and self.identity and not action_text: | ||
|
|
@@ -689,7 +692,7 @@ def build(self, notification_uuid: str | None = None) -> SlackBlock: | |
| has_action = True | ||
|
|
||
| title_link = None | ||
| if features.has("organizations:workflow-engine-ui-links", self.group.organization): | ||
| if key == "workflow_id": | ||
| title_link = get_title_link_workflow_engine_ui( | ||
| self.group, | ||
| self.event, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is where variant types would be nice..
it could be like