-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat: Allow id or event_id in project events endpoint #10898
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
Reprise of a previous PR that failed because there is no index on event_id alone. Now I've added this functionality to the project event details endpoint where we know we always have the project id available, and I've made the fronted code use this endpoint instead of the bare /events/x/ endpoint.
data = serialize(event, request.user) | ||
data['userReport'] = serialize(user_report, request.user) | ||
data['release'] = self._get_release_info(request, event) |
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 userReport
and release
stuff is just to make the payload returned by this endpoint the same as the /events/
one
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.
would probably be nice to move the shared stuff between this and the other endpoint into a serializer or something (maybe DetailedEventSerializer
?) but doesn't need to be part of this pr
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.
Good idea. Have done it here. #10921
@@ -23,6 +24,20 @@ def retrieve_event_for_project_scenario(runner): | |||
class ProjectEventDetailsEndpoint(ProjectEndpoint): | |||
doc_section = DocSection.EVENTS | |||
|
|||
def _get_release_info(self, request, event): |
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.
? '/issues/' + this.getGroup().id + '/events/' + eventId + '/' | ||
: '/events/' + eventId + '/'; | ||
? `/issues/${groupId}/events/${eventId}/` | ||
: `/projects/${orgSlug}/${projSlug}/events/${eventId}/`; |
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.
I'm not 100% sure this is the only place that called events/eventId
but that endpoint could potentially be deprecated if it is.
data = serialize(event, request.user) | ||
data['userReport'] = serialize(user_report, request.user) | ||
data['release'] = self._get_release_info(request, event) |
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.
would probably be nice to move the shared stuff between this and the other endpoint into a serializer or something (maybe DetailedEventSerializer
?) but doesn't need to be part of this pr
Reprise of a previous PR that failed because there is no index
on
event_id
alone. Now I've added this functionality to the projectevent details endpoint where we know we always have the project id
available, and I've made the fronted code use this endpoint instead
of the bare
/api/0/events/
endpoint.