Coverage check approval rule requires approval while pipeline is running

Summary

When an MR pipeline is being run and you load the MR page, the Coverage-check approval rule shows as being required even though we haven't gotten the coverage results yet.

Once the pipeline finishes and the coverage is above the required threshold, the Coverage-check approval rule still shows until you refresh the page.

Steps to reproduce

  1. Have a project with Coverage-check approval enabled
  2. Have a project where the default branch has a coverage report
  3. Create a new MR where coverage won't decrease
  4. See that the MR requires Coverage-check approval. DO NOT REFRESH YET
  5. Once the pipeline finishes, note that the Coverage-check approval is still required
  6. Refresh the page and see that Coverage-check is no longer required when coverage hasn't decreased

Example Project

What is the current bug behavior?

The MR shows the Coverage-check approval as required when the pipeline is still running.

What is the expected correct behavior?

The MR doesn't show the Coverage-check approval as required until after the pipeline has finished.

Relevant logs and/or screenshots

Screen_Recording_2021-12-07_at_09.16.17

Output of checks

This bug happens on GitLab.com

Possible fixes