Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sentry/seer/autofix/autofix_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ def build_pr_description_suffix(group: Group) -> str | None:
lines = []

if group.qualified_short_id:
lines.append(f"Fixes {group.qualified_short_id}")
issue_url = group.get_absolute_url(params={"seerDrawer": "true"})
lines.append(f"Fixes [{group.qualified_short_id}]({issue_url})")

for external_issue in PlatformExternalIssue.objects.filter(group_id=group.id):
if external_issue.service_type == "linear":
Expand Down
16 changes: 13 additions & 3 deletions tests/sentry/seer/autofix/test_autofix_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,9 @@ def test_passes_correct_pr_description_suffix(self, mock_post):
)

body = mock_post.call_args[0][0]
assert body["payload"]["pr_description_suffix"] == f"Fixes {self.group.qualified_short_id}"
issue_url = self.group.get_absolute_url(params={"seerDrawer": "true"})
expected = f"Fixes [{self.group.qualified_short_id}]({issue_url})"
assert body["payload"]["pr_description_suffix"] == expected

@patch("sentry.seer.agent.client.make_agent_update_request")
def test_pr_description_suffix_includes_linear_issue(self, mock_post):
Expand Down Expand Up @@ -1198,7 +1200,11 @@ def test_pr_description_suffix_includes_linear_issue(self, mock_post):
)

body = mock_post.call_args[0][0]
expected = f"Fixes {self.group.qualified_short_id}\nFixes [PROJ-123](https://linear.app/proj/issue/PROJ-123)"
issue_url = self.group.get_absolute_url(params={"seerDrawer": "true"})
expected = (
f"Fixes [{self.group.qualified_short_id}]({issue_url})\n"
f"Fixes [PROJ-123](https://linear.app/proj/issue/PROJ-123)"
)
assert body["payload"]["pr_description_suffix"] == expected

@patch("sentry.seer.agent.client.make_agent_update_request")
Expand Down Expand Up @@ -1228,5 +1234,9 @@ def test_pr_description_suffix_linear_alphanumeric_prefix(self, mock_post):
)

body = mock_post.call_args[0][0]
expected = f"Fixes {self.group.qualified_short_id}\nFixes [PROJ2-456](https://linear.app/team/issue/PROJ2-456)"
issue_url = self.group.get_absolute_url(params={"seerDrawer": "true"})
expected = (
f"Fixes [{self.group.qualified_short_id}]({issue_url})\n"
f"Fixes [PROJ2-456](https://linear.app/team/issue/PROJ2-456)"
)
assert body["payload"]["pr_description_suffix"] == expected
Loading