Variables specified through manual job page are not persisted when a job is retried
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
When retrying a manual job, variables that were specified via job page during the previous run will not be available to the new job.
- When using a variable to execute a manual job, re-running the job later does not carry the variable into the new execution, resulting in the job potentially running in an altered/erroneous state in subsequent executions.
- The only way to re-enter the manual variable is to delete the log. This can be quite dangerous from an accountability point of view.
It becomes quite dangerous to use manual jobs with required variables to control environment deploys, if the information is not passed through subsequent re-runs or builds, or it's not possible to re-enter the details without deleting the log of a run.
Steps to reproduce
- Create a pipeline with at least 1 manual job.
- Run the pipeline manually. Do not set a variable on the
Run pipelinepage. - On the next screen, click on the job that is pending on manual action.
- Specify a variable and trigger the manual action. This job will run with the set variables.
- If the above job is retried, variables specified on step 4 will not be available to the job.
Example Project
Pipeline: https://gitlab.com/jmitchell38488/gitlab-ci-test/-/pipelines/342647280
test:
stage: deploy
rules:
- when: manual
script:
- if [ -z "$VAR" ]; then exit 1; else echo "Variable has value!"; fi
What is the current bug behavior?
Manual variables are not carried through with subsequent re-runs of a job, or cannot be re-entered even when logs of a previous job are deleted to enter the variable and value again.
What is the expected correct behavior?
The value should be carried through, and when the user clicks on Retry, they should be able to re-enter the manual variables.