chore(seer-activity): Correct webhook url and web_url alert keys#118697
chore(seer-activity): Correct webhook url and web_url alert keys#118697leeandher wants to merge 2 commits into
url and web_url alert keys#118697Conversation
a7fc010 to
5ce235a
Compare
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.
Reviewed by Cursor Bugbot for commit 5ce235a. Configure here.
| url=organization.absolute_url( | ||
| url=organization.absolute_api_url( | ||
| f"organizations/{organization.slug}/workflows/{workflow.id}/" | ||
| ), |
There was a problem hiding this comment.
Duplicate org in API URL
High Severity
The alert url passed to absolute_api_url includes an organizations/{slug}/ prefix, but that helper already builds /api/0/organizations/{slug}/…. The webhook emits a duplicated segment and a non-existent API path, so consumers treating alert.url like issue url get broken links.
Reviewed by Cursor Bugbot for commit 5ce235a. Configure here.
There was a problem hiding this comment.
idk if this is valid or not, but we could add a test to prove/misprove this
| url=organization.absolute_api_url( | ||
| f"organizations/{organization.slug}/workflows/{workflow.id}/" | ||
| ), |
There was a problem hiding this comment.
Bug: The call to organization.absolute_api_url redundantly includes the organization slug in the path, creating a malformed URL.
Severity: HIGH
Suggested Fix
Update the call to organization.absolute_api_url to only pass the path segment that follows the organization slug. Change the path argument from f"organizations/{organization.slug}/workflows/{workflow.id}/" to f"workflows/{workflow.id}/".
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
src/sentry/notifications/notification_action/activity_registry/sentry_app.py#L151-L153
Potential issue: The `organization.absolute_api_url` function is called with a path that
includes `organizations/{organization.slug}/`. However, the function itself is designed
to prepend `/api/0/organizations/{slug}/` to the provided path. This results in a
duplicated path segment, creating a malformed URL like
`/api/0/organizations/{slug}/organizations/{slug}/workflows/{workflow.id}//`. Any
webhook calls attempting to use this URL will fail with a 404 error, breaking the
notification functionality.
Did we get this right? 👍 / 👎 to inform future reviews.
| url=organization.absolute_url( | ||
| url=organization.absolute_api_url( | ||
| f"organizations/{organization.slug}/workflows/{workflow.id}/" | ||
| ), |
There was a problem hiding this comment.
idk if this is valid or not, but we could add a test to prove/misprove this


Slight update to the webhook format I noticed while drafting getsentry/sentry-docs#18588. For issues, the
urlis by default for the API, and we specify user facing urls asweb_url.Added
web_urland corrected that for thealertsection of the webhook.