You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like v3 API is very different from v4: /commits and /changes accept merge request id, not iid.
Unfortunately, GitlabAPI hard-codes v3 and is not extensible, so I can't use v4 with current implementation.
Given that it's very similar other than merge_request_id vs merge_request_iidand all the other methods in this library right now are using iid, I think it's safe to update the implementation for getCommits to use the correct endpoint.
I'll go ahead and submit a PR for this as I have had to implement a workaround for this in the past and would now like to fix it in this library instead of using my workaround. @timols if you have any thoughts/concerns, please let me know.
@Fractaliste I would suggest opening a separate issue for getting commits from a Tag since I would like to keep the scope of this change limited to the original issue.
Activity
maxim5 commentedon Oct 16, 2017
Looks like v3 API is very different from v4:
/commitsand/changesaccept merge request id, not iid.Unfortunately,
GitlabAPIhard-codes v3 and is not extensible, so I can't use v4 with current implementation.Fractaliste commentedon Dec 3, 2018
I got the same when getting commit from a Tag. It's quiet annoying because it prevents me to get author's name...
rkpatel7 commentedon Oct 11, 2019
Since #333, it's been possible to pass in an
apiNameSpacebut the default is nowv4.Regardless, in both v3 and v4, Gitlab provides a way to get commits associated with an MR:
GET /projects/:id/merge_requests/:merge_request_id/commitsGET /projects/:id/merge_requests/:merge_request_iid/commitsGiven that it's very similar other than
merge_request_idvsmerge_request_iidand all the other methods in this library right now are usingiid, I think it's safe to update the implementation forgetCommitsto use the correct endpoint.I'll go ahead and submit a PR for this as I have had to implement a workaround for this in the past and would now like to fix it in this library instead of using my workaround. @timols if you have any thoughts/concerns, please let me know.
@Fractaliste I would suggest opening a separate issue for getting commits from a Tag since I would like to keep the scope of this change limited to the original issue.
Update getCommits for merge requests to use the correct gitlab API en…
Get commits for merge request (#361)