Backend: CI_MERGE_REQUEST_APPROVED unset after approval of MR

Summary

Using GitLab Community Edition 14.3.2, the variable $CI_MERGE_REQUEST_APPROVED is not set to either true or false, whether an MR is approved or not.

Steps to reproduce

  • Open an MR
  • Log the $CI_MERGE_REQUEST_APPROVED from a job in gitlab-ci.yml (- echo "CI_MERGE_REQUEST_APPROVED ${CI_MERGE_REQUEST_APPROVED}"). Variable is not set to anything.
  • Approve the MR
  • Log the $CI_MERGE_REQUEST_APPROVED from a job in gitlab-ci.yml. Variable is not set to anything.

What is the current bug behavior?

The variable is never to set anything, regardless of whether the MR was approved.

What is the expected correct behavior?

The variable should be false unless the MR was approved, in which case it should be true.

User Impact

For any users that have built logic around whether an MR is approved or not by utilizing CI_MERGE_REQUEST_APPROVED, with the value being nothing, downstream dependencies can't be configured properly.

Edited by Mark Nuzzo