API link between commit and merge request: get MR id in commit data
Description
Hi,
I'm using the gitlab api for developping devops tools in C#. For my current tool, I need to determine the MRs merged since the last tag. I've tried to do that by date, but the date of the tag is the date of the commit and there is no refference to the MR, neither in the tag nor in the commit. Since you can get the commits for a given MR, i thought the reverse was possible. However, i haven't found any way to do that. As far as i can see the only way to find the MR of a certain commit is to go through all the project's MRs and search through the commit list of each MR for the commit in question. This seems very suboptimal to me...
Proposal
Since a commit belongs to a unique MR, could you please add the MR id or iid in the commit data? So that a GET on /repository/commits/:id
would return something like this :
{
"id": "c56ffd183cfea378e6739309f062735b7e0a940f",
"short_id": "c56ffd18",
"mr_id": "1234",
"title": "my title",
"author_name": "author",
"author_email": "author.email@mymail.com",
"created_at": "2016-08-08T14:56:44.000+02:00",
"message": "my message",
"parent_ids": [
"0df292af73541ec55fa7447bc128ab1da210ebca",
"0578adfc39fd07aa653bee3b08f0318a26010073"
],
"committed_date": "2016-08-08T14:56:44.000+02:00",
"authored_date": "2016-08-08T14:56:44.000+02:00",
"stats": {
"additions": 435,
"deletions": 26,
"total": 461
},
"status": "failed"
}
If the commit has no MR then the mr_id could be empty.
Another interesting feature would be to have the merge date for an MR.
Thanking you in advance.
Links / references
I've found a similar question on stackoverflow, but no answer alas! http://stackoverflow.com/questions/33168209/gitlab-get-merge-request-from-a-commit-id