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
I had searched in the issues and found no similar issues.
What happened
The fetching of the merge request information from GitLab APIs is not completely correct because the option "squash on merge" of GitLab is not managed correctly.
To be more specific when a MR is squashed the related commit sha is not reported inside the field "merge_commit_sha" that we are fetching from GitLab APIs but is instead inside the "squash_commit_sha" field. The information about the squashing option enabled or disabled is inside the "squash" field.
I've tried to convert the squash_commit_sha inside the merge_commit_sha field and it looks like it's working fine.
Just to avoid the creation of other bugs, let me test something more regarding that and I'll provide a PR
(I realized this morning that in some strange cases, GitLab is returning null to both of the fields, so maybe it's a GitLab bug)
@Marco-De-Stefani I talked to @liangjingyang and he contributed some very valuable information:
Accord to the comment from the gitlab official repo, not only merge_commit_sha might be null, but also squash_commit_sha when using fast-forward without squash.
So, we may need to do another fallback to the diff_head_sha to fully address the problem.
Search before asking
What happened
The fetching of the merge request information from GitLab APIs is not completely correct because the option "squash on merge" of GitLab is not managed correctly.
To be more specific when a MR is squashed the related commit sha is not reported inside the field "merge_commit_sha" that we are fetching from GitLab APIs but is instead inside the "squash_commit_sha" field. The information about the squashing option enabled or disabled is inside the "squash" field.
Gitlab docs: https://docs.gitlab.com/ee/api/merge_requests.html#response
What do you expect to happen
I would have expected to have the "merge_commit_sha" field in the "pull_requests" table be populated to proceed with the DORA metrics validation.
How to reproduce
Anything else
No response
Version
v0.17.0
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: