Show previous environment link when the head pipeline of the MR skipped creating environment
Summary
When user pushed a new code with [ci skip] message, the head pipeline of the MR will not have any jobs, thus deployment jobs for Review apps will not happen and Review app link will disappear.
We should show the previous environment link in such case, with a clear inidication that the environment is not tied with the diff_head_sha (i.e. the latest commit of the branch). See more explanation in https://gitlab.com/gitlab-org/gitlab-ce/issues/52577#note_146884350.
Summary
After successfully deploying a merge request to an environment, I later push a tiny fixup commit (e.g comments or other documentation). I know this commit doesn't affect the deployment, and I don't want to wait for the long deploy job to run again, so I put [ci skip] in my commit message. Surprisingly, the environment link on the MR is now gone.
Steps to reproduce
- Open a merge request with a pipeline that creates an environment with a URL.
- Observe the pipeline succeed. The environment URL appears on the MR.
- Create and push a new commit with
[ci skip]in the commit message. - Observe that the pipeline is skipped - and that the environment URL disappears from the MR.
Example Project
What is the current bug behavior?
No environment link after second commit.
What is the expected correct behavior?
The environment link from the most recently run pipeline should still be visible on the MR.
Output of checks
This bug happens on GitLab.com