Merge request: Include all aspects in the merge status
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Both the merge request overview list (used by humans) as well as the merge request API endpoint (used by integrations/tools) shows a "merge status" that might not necessarily reflect the overall mergability state. In project settings, merge requests can be set to be unmergable if there are open discussions or failing pipelines. The merge request itself disables the "Merge" button in those cases and shows an info text, but the overview and API still return "can be merged".
For a developer, it is difficult to find their own merge requests that need their attention (since as far as I could tell, they do not show up as such in the overview, they cannot be filtered using the search and they do not show up in the ToDo list). For an integration/tool, it may return an incorrect (or rather: incomplete) status for a merge request and indicate it is ok when it is really not.
This at least affects (but is probably not limited to) the following places:
- The merge request overview page (at https://gitlab.com/gitlab-org/gitlab/-/merge_requests)
- The filters on the merge request overview page (which allow filters for "Author", "Assignee", "Target branch" amongst others, but not "Merge Status", "Pipeline Status" or a combined "Cannot be merged right now" status; also in the dashboard)
- The field
merge_status
in the merge request API (at https://gitlab.com/api/v4/projects/278964/merge_requests) - The list of merge requests in the dashboard (at https://gitlab.com/dashboard/merge_requests)
- The ToDo list which at least shows unmergable ones when a merge conflict is detected (at https://gitlab.com/dashboard/todos)
The easiest is probably a simple boolean "can be merged" (or "can click on the merge button" to go by the UI state, which also has to come from somewhere). More interresting could be a "merge blocker" field that could contain status values such as "merge conflict", "failed pipeline", "unresolved discussion" etc. - but that would be a nice-to-have extra.