Skip to content

fix(api): ensure stable sorting of MRs by descending CreatedAt

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

Description

This MR puts an explicit sort on merge requests fetched through the list MR methods that use assignee and reviewer filters. This follows up on !1623 (merged) to fix a flaky test and ensure a display of MRs that is consistent across commands and filters. Looking at the other commands and other places in the codebase, it seems like sorting is consistently by descending iid/CreatedAt. This MR follows that standard.

Related Issues

Resolves #7640 (closed)

How has this been tested?

Running test suite multiple times, and also running the cli commands that use the methods and return multiple MRs:

i.e.

glab-dev-cli mr list --group gitlab-community --reviewer=Taucher2003 --assignee=ChaelCodes

and

glab-dev-cli mr list --repo https://gitlab.com/gitlab-org/gitlab --reviewer=aturinske --assignee=lee-tickett

Both consistently return MRs sorted by descending iid.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Van Anderson

Merge request reports

Loading