Adding approvals via our API could raise a race condition when an approval is sent via the API and a commit is pushed at the same time
Existing ZD Ticket: https://gitlab.zendesk.com/agent/tickets/76235
Excerpt from the ticket:
I had a look in the GitLab API to find out what options we have to let a tool automatically approve a merge request. The option there is just
to approve a merge request which brought up the question what happens when there is a race condition between approval and another change to the merge request. Usually when a merge request was approved the approval gets removed as soon as a code change was made.
However what happens when the merge request was modified between Review and giving the approval? I expected that at least in the GitLab API I need to pass the commit id when approving to avoid that. I know that one could require that the CI must succeed building but that isn’t an option here.