Hexanet / MergeRequestsCI

:eyes: UI to see all GitLab merge requests of your teams in one place
https://hexanet.gitlab.io/MergeRequestsCI
MIT License
13 stars 7 forks source link

Add a MR status badge #129

Open nclsHart opened 7 years ago

nclsHart commented 7 years ago

Since latest versions of GitLab, the API now returns the MR status. For example:

...
  "merge_when_pipeline_succeeds": true,
  "merge_status": "can_be_merged",
  "subscribed" : true,
...

source: https://docs.gitlab.com/ee/api/merge_requests.html#list-merge-requests

merge_status possible values are: can_be_merged, cannot_be_merged and unchecked.

We could use this new information to create a new column "status" with a badge.

Possible rendering of the new feature:

can_be_merged cannot_be_merged unchecked

Depending of the projet/team workflow validation, this feature could give duplicate results with the CI badge.

notFloran commented 7 years ago

Do you know if cannot_be_merged cover the failure of the CI?

We could use this new information to create a new column "status" with a badge.

I'm not a fan of the new column, maybe we can mix the CI column and this new data in one column "Status".

nclsHart commented 7 years ago

Do you know if cannot_be_merged cover the failure of the CI?

I hope so, but I need to check it. It's not really specify in the GitLab API documentation.

notFloran commented 7 years ago

what cannot_be_merged means is, essentially, whether the MR has merge conflicts. But that's not the only reason we might be unable to merge an MR.

We need to mix the CI status and the "cannot be merged" in some way