-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(sentry apps): add urls to issue.created webhook #93780
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
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #93780 +/- ##
==========================================
+ Coverage 81.66% 88.05% +6.39%
==========================================
Files 10330 10335 +5
Lines 596288 598088 +1800
Branches 23163 23163
==========================================
+ Hits 486957 526670 +39713
+ Misses 108875 70962 -37913
Partials 456 456 |
src/sentry/models/group.py
Outdated
query = None | ||
path = f"/issues/{self.id}/" | ||
if params: | ||
query = urlencode(params) | ||
return self.organization.absolute_api_url(path=path, query=query) |
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.
do we need to include query params? The published endpoint doesn't look like it takes any? https://docs.sentry.io/api/events/retrieve-an-issue/ :/
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.
Hmm are we sure we don't have any referrer middlewares that would care about this? 🤔
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.
wym referrer middleware? Like if we check the referrer q param in the endpoint? Looking at the endpoint in the published docs, it looks like there's also an expand
and collapse
query parameter that's present but not documented. So ig we should keep the params
part above
@@ -326,12 +346,13 @@ def _process_resource_change( | |||
) | |||
if event in installation.sentry_app.events | |||
] | |||
data = {} | |||
data: dict[str, Any] = {} |
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.
Doesn't need to be addressed here, but is the _webhook_event_data
function typed and could we narrow this from Any
somehow?
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.
_webhook_event_data
isn't typed, I looked into this and the main issue is trying to type the BaseEvent
serialization is despairge. Like at this bottom part it'll serialize an unknown list of additional 'items' which makes it hard to turn into an accurate TypedDict
. I couldn't find another part of our codebase that tackles this so wasn't sure on how to proceed :/
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
per - #93404 & getsentry/sentry-docs#8992
We were missing urls in the
issue.created
webhooks despite docs saying we had them. This PRadds
url,web_url
&project_url
according to the docs