Skip to content

Manually renaming environments breaks future deployments

Summary

Manually renaming a CI environment breaks all future deployments to that environment. Instead, each respective pipeline step shows the message This job is an out-of-date deployment to . Deleting the old, renamed environment did not fix the issue.

Steps to reproduce

  1. Create an environment from a CI pipeline step; I used $PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME as a name.
  2. Manually rename the environment. I just shortened the name by a few characters.
  3. Run any CI step that re-creates/updates the environment
  4. This job is an out-of-date deployment to .

Example Project

https://gitlab.com/FabianSperrle/deployment-renaming

What is the current bug behavior?

The changed name of the original environment is correctly updated in the first pipeline. All other pipelines fail to update/re-populate any environment (with either the original or the changed name).

What is the expected correct behavior?

Renaming an environment does not impact future (re-)creations of environments with the original name.

Relevant logs and/or screenshots

See example project + job links above.

Output of checks

This bug happens on GitLab.com. It also happens on our self-hosted gitlab ce instance.

Workaround

Rename the environment back to how it was called

Solution

Disallow renaming environments.

Edited by Kevin Chu