Skip to content

Feature: mr list by asssignee

Kerri Miller requested to merge github/fork/zemzale/ft-mr-list-by-asssignee into trunk

Created by: zemzale

Description

Added mr list option --assingee to get MRs for specific assignees.

To do this added 3 API functions :

  • ListMRsWithAssignees - allows us to get MR by their assignee IDs
  • UserByName - allows to get a single user by it's name
  • UsersByNames - allows to get multiple users by names

Now if user passes --assigne=user or --assigne=user,user2` flag to the command, it's gonna show up MRs that are assigned to the users.
It will fail with error message that we can't find any of the usernames that were passed to the command.

There is one issue that is not related to filtering of the users but displaying the MRs. There is no way for the end user to know which MR is assigned to whom. That probably deserves it's own issue since there are multiple ways of how that could be done e.g. new column or multiple table for each assignee. I tried to just add new column but every row overflowed and since I got some time constrains I didn't investigate further for now.

Related Issue

#167 (closed)
Motivation and Context

Allow better filtering for MR listing How Has This Been Tested?

Tested on a private GitLab repo, with single and multiple assignees.

The only issue I can see with this is that if you add multiple assignees and provide the --all flag it will show 20 MRs for each assignee if they have that many to them (which can be pretty normal for a bit bigger projects)

Screenshots (if appropriate):

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)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Merge request reports