Prepare removal of legacy predefined CI_BUILD_* variables
What does this MR do and why?
This MR prepares the removal of the legacy predefined variables listed in #352957 (closed). The changes are made behind a feature flag that will be defaulted to on in %16.0.
Feature Flag: ci_remove_legacy_predefined_variables
Roll out issue: #404533 (closed)
How to set up and validate locally
The following steps create a scenario where all the affected predefined variables are expected to have a non-null value prior to enabling the Feature Flag. This allows us to see the effect before and after the flag is turned on.
- First ensure the Feature Flag is off via the Rails console:
Feature.disable(:ci_remove_legacy_predefined_variables)
- Update your project's
.gitlab-ci.yml
with the following content: gitlab-ci.yml - Go to Repository > Tags, and create a new tag for the
master
branch namedv1.0
. - Follow the steps to create a trigger token for your project.
- Run the following curl in your terminal to trigger a pipeline. Replace the values and update the host as necessary.
curl --request POST \
--form token=<YOUR-TRIGGER-TOKEN> \
--form ref=v1.0 \
"http://gdk.test:3000/api/v4/projects/<YOUR-PROJECT-ID>/trigger/pipeline"
- Now view your newly created pipeline in GitLab and run the manual job.
- View the job's output log. Observe that each Current/Legacy variable pair has the same value. NOTE: We expect CI_BUILD_REPO to be
null
(it seems it was already removed at some point.)
- Now turn on the Feature Flag:
Feature.enable(:ci_remove_legacy_predefined_variables)
. - Go back to the pipeline you created from Step 5 and re-run the manual job.
- View the job's output log. Observe that the Legacy predefined variables now all have a
null
value.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #352957 (closed)
Edited by Leaminn Ma