GitLab Integration Hook Issue when pushing to Merge Request after Code Review Completed
I am running into a problem that I'm hoping someone else has experienced and knows the fix to. Inside GitLab, for a merge request, it appears as though the pipeline status fails if I push a new commit (such as a merge commit) to a merge request after the code review was completed.
I am investigation the use of the GitLab Integration Hook with Code Collaborator to see if it's a better alternative for my team instead of having to manually build and update the code review every time. So far it has a lot of great features including triggering a pipeline gate on the merge request. I ran into an issue though when I noticed that merge commits (such as a merge commit from master containing changes not related to the code review) are added to the code review. To find a workaround, I thought that maybe I can fix this by pushing the merge commit to the merge request after the code review was completed and the pipeline is marked as succeeded.
There's a setting in Collaborator for the integration called "Reopen a review when" with the following option enabled by default: "when a push to a pull request is made"
If that's enabled the merge commit on the code review is unavoidable, as the pipeline simply restarts. So I disabled this and tried again (see attached screenshot). Now when I push a change, GitLab claims it cannot "retrieve the pipeline status" and suddenly the pipeline fails and I cannot merge. I looked at the packets sent by GitLab's API and there's a "Note" hook with the following description:
Corresponding review in Collaborator cannot be updated - it is completed Review reopening is not allowed for this repository.
Collaborator appears to reject the merge request hook stating that reopening a code review is not allowed. Because of that, the pipeline fails and this merge request cannot be completed.
Has anyone run into this problem before, and is there a way to fix this? The core issue is because of the merge commits are getting in the way of the code review, and I don't see a way of filtering them out or working around this.
Proposed Solution to core issue:
Provide an option to ignore merge commits when creating and updating code reviews from the integration hook.
Integration Hook Setup Link for reference: https://support.smartbear.com/collaborator/docs/source-control/repo-hosting/gitlab.html