Moving Auto DevOps jobs syntax to `rules`

Goal

Switch all Auto DevOps jobs from using only / except to rules.

Impact

Only users who extend Auto DevOps jobs

Impacted users (small percentage?) will see their pipeline fail to start with something like:

jobs:<job-name> config key may not be used with `rules`: only
  1. AFAIK, this only impacts users who extend the templates below, and uses only/except in their extension
  2. We cannot mix only/except and rules in the same job. So there is currently nothing for users to do except wait for the templates to be updated, (it will break their pipeline, but only some, see 1), then update their extension to use rules.

What if I am not ready to update my pipelines ?

For affected users who extend Auto DevOps templates, but are not ready to update their pipelines, you can switch to the GitLab 12.10 based templates.

Impact on GitLab.com [Tentatively scheduled for 2020-05-13]

Users who extend Auto DevOps and uses only/except in their extension will immediately have their pipeline fail once deployed to GitLab.com

  • Update 2020-05-11: I have set MWPS on all 5 MRs referred to in #proposal. Assuming no broken masters, deploys are OK, this should reach GitLab.com in the next 24 hours.
  • Update 2020-05-12: The MRs have reach staging.gitlab.com. This should be live on gitlab.com today
  • Update 2020-05-13: This was deployed to GitLab.com at May 13, 2020 7:56pm GMT+0000

Proposal

Switch all of the following jobs in lib/gitlab/ci/templates/Jobs/ to using if:

Note: Work was already done in !25492 (merged) but had to be reverted as it introduced a breaking change

Note2: This is the first part of fixing Auto DevOps tests due to changing CI/CD syntax. See: #34304 (comment 316597080)

Edited by Thong Kuah