Conversation
| arw = AlertRuleWorkflow.objects.get(rule_id=issue_alert.id) | ||
| workflow = arw.workflow | ||
|
|
||
| workflow = IssueAlertMigrator(issue_alert).run() |
There was a problem hiding this comment.
create_project_rule already runs the IssueAlertMigrator here so we only need to fetch the already created workflow.
| self.issue_alert.update(owner_user_id=self.user.id) | ||
| self.issue_alert.refresh_from_db() | ||
| self.assert_equal_serializers(self.issue_alert) | ||
| issue_alert = self.create_project_rule( |
There was a problem hiding this comment.
Since I removed the duplicate IssueAlertMigrator.run() call the workflow we use now wouldn't update it's owner so we have to do it here.
|
|
||
| @responses.activate | ||
| def test_sentry_app_render_label(self) -> None: | ||
| responses.add( |
There was a problem hiding this comment.
We need this response to resolve the assignee field from the alert rule action schema.
| { | ||
| "id": "sentry.rules.actions.notify_event_sentry_app.NotifyEventSentryAppAction", | ||
| "sentryAppInstallationUuid": installation.uuid, | ||
| "settings": [ |
There was a problem hiding this comment.
These correspond to the schema linked in my comment above
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.
|
|
||
| serialized_actions = [] | ||
| for action in self._fetch_actions(workflow_dcg.condition_group): | ||
| # build up actions data |
There was a problem hiding this comment.
I had to refactor this a bit to build up the actions data before we loop over each action to avoid N+1 calls to build up the component data
The
WorkflowEngineRuleSerializeraccepted theprepare_component_fieldsarg but didn't do anything with it - this PR fetches the component data and adds it to the serializer response. This PR is based off of howRuleSerializerhandles this arg but has to be implemented in a slightly different way for workflows.