Skip to content

Fix events order in users/:id/events endpoint

Airat Shigapov requested to merge airat/gitlab-ce:fix-events-api into master

What does this MR do?

Order of events in contributions API is currently being lost, though docs are saying:

Get the contribution events for the specified user, sorted from newest to oldest.

Order becomes different after .merge(ProjectsFinder.new.execute(current_user)) call, so I moved ordering below this line.

This MR also removes extra .page(params[:page]) call in the method chain, since paginate(events) already does it.

Are there points in the code the reviewer needs to double check?

This MR is small enough to double-check everything.

Why was this MR needed?

Bug in API.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

I wasn't able to find any corresponding issues this time. Probably because it's a new endpoint (added in 8.13, introduced in !6771 (merged)) and is not used widely yet.

Merge request reports