MR widget shows unrelated deployment status when a user created an empty MR
Problem
This MR gitlab-com/www-gitlab-com!16544 (merged) shows the following deployment status under the post-merge pipeline.
But the deployment status for review/3359-re-add-qualys-that-was-eliminated-in-a-merge-conflict environment is unrelated to this MR. It should only show production environment's deployment status.
After some investigation, it turned out that this bug is caused when a user created an MR without creating a new commit. He/she just created a new branch and pushed.
For instance, in gitlab-com/www-gitlab-com!16548 (closed) case, deployment status is shown as following
It shows that pre-merge pipeline deployed to production
, whcih obviously didn't, whereas Deployed to review/3359-re-add-qu...
is correct.
Solution
Show correct deployment status even though a user created an empty MR