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.

Old title: Environment link removed from MR after pushing [ci skip] commit

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

  1. Open a merge request with a pipeline that creates an environment with a URL.
  2. Observe the pipeline succeed. The environment URL appears on the MR.
  3. Create and push a new commit with [ci skip] in the commit message.
  4. Observe that the pipeline is skipped - and that the environment URL disappears from the MR.

Example Project

brett.higgins/env-link-test!1

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

Edited Mar 27, 2019 by Shinya Maeda
Assignee Loading
Time tracking Loading