Wrong branch was deployed to production (Auto DevOps)
The following discussion from !53280 (merged) should be addressed:
-
@nikitalevchuk started a discussion: (+9 comments) Hi guys. First of all thanks for contributing @MitchellCash but the changes broke my pipelines.
Because I used
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
template and my default branch wasdevelop
it deployed develop branch to production and master one to staging which is opposite to my regular pipeline (develop -> staging, master -> production). That's not good.I think it could break pipelines for many people in the same way (!master as default branch).
Potential proposal 1
- This change deployed a wrong branch to production. This is bad
- On the other hand, having pipelines that rely on hard-coded
master
to avoid deploying default branch to production is relying on a ~bug - Perhaps the middle ground is failing the
staging
,canary
andproduction
jobs inlib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
if the default branch is notmaster
? - We leave
lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
alone as that will become the default in %14.0
Potential proposal 2
Close as wontfix
Edited by Thong Kuah