MR approval policies don't require approvals for missing scans when target branch pipeline is absent

Summary

When a merge request's head comparison pipeline lacks a security scan that is mandated by an MR approval policy, we currently unblock the respective approval rule, but we shouldn't.

Steps to reproduce

See:

Example Project

Private: https://gitlab.com/katrinleinweber_ultimate_group/zd-553170-policy-without-report

What is the current bug behavior?

Approval rules getting unblocked despite their mandated security scans being absent.

What is the expected correct behavior?

Approval rules not getting unblocked.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

!161905 (merged)