Skip to content

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

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

alex-hofsteede
Copy link
Contributor

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 /api/0/events/ endpoint.

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)
Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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):
Copy link
Contributor Author

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}/`;
Copy link
Contributor Author

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)
Copy link
Contributor

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

@alex-hofsteede alex-hofsteede merged commit 5bea8f4 into master Dec 5, 2018
@markstory markstory deleted the hoff/event-id-endpoint branch February 12, 2019 15:55
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants