Updates the PlayBuildService to use can_enqueue
What does this MR do and why?
In Ci::PlayBuildService#play
, we run two commands: build.enqueue
, followed by build.update(current_user: ..., job_variables_attributes: ...)
It's theoretically possible for us to enqueue a build, which is then picked up and run without the correct user or job variables set.
Fixes: #30360 (closed)
How to set up and validate locally
Steps to reproduce
This has to be done on main/master
:
- In order to reproduce this, place a
sleep(500)
betweenbuild.enqueue
andbuild.update
in thePlayBuildService
- Create a config with a manual job with variables:
variables:
DEPLOY_TO_STAGE:
value: "this is variable deploy to test"
deploy_job:
when: manual
script: echo "$DEPLOY_TO_STAGE" # for ease of testing
- Run a pipeline
- Click on the manual job
deploy_job
:
- Change the value of
DEPLOY_TO_STAGE
and click onTrigger this manual action
:
You will see the variable has NOT changes to the new 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.
Edited by Laura Montemayor