🐛 Use GitLab MR diff head SHA for CI statuses - #5176
Conversation
Signed-off-by: Rylen Anil <rylen.anil@gmail.com>
bilaldeveloper4312
left a comment
There was a problem hiding this comment.
Reviewed commit 364afa82 against the behavior described in #3701.
Using diffHeadSha for AssociatedMergeRequest.HeadSHA matches the required semantics: CI-Tests needs the merge-request head as it existed before merge, while mergeCommitSha can be absent for fast-forward merges and identifies a different commit when present. Guarding the merge-commit lookup also prevents an empty SHA from becoming a map key. The regression test exercises the important distinction between the MR diff head and merge commit. I found no blocking issue in the changed code.
Focused verification passes locally with Go 1.25.6:
go test ./clients/gitlabrepo -run '^(TestZipUsesDiffHeadShaForMergeRequestHead|TestListRawCommits)$' -count=1
The full package run reaches the unchanged Windows-specific TestExtractTarball/Basic path-separator and file-lock failure, so I am not representing the entire package as passing in this environment.
Signed-off-by: Rylen Anil <rylen.anil@gmail.com>
|
Updated this branch with the latest upstream/main to clear the behind state. Verification after the merge: |
Summary
diffHeadShaFixes #3701
Verification
go test ./clients/gitlabrepogit diff --check