Add job_variables_attributes to play build API
What does this MR do and why?
This MR adds an optional job_variables_attributes
param to the REST API endpoint for playing manual jobs. Users can pass custom variables to the param in order to have those variables set on the job.
Implements: #37267 (closed)
Screenshots or screen recordings
N/A
How to set up and validate locally
- Set up a pipeline with a manual job that includes
script: echo "$TEST_VAR"
- Run a pipeline
- Navigate to the manual job's show page and get the job ID
- Run
curl --request POST --header "PRIVATE-TOKEN: <private_access_token>" "<gdk.test>/api/v4/projects/<project_id>/jobs/<job_id>/play" -d "job_variables_attributes%5B%5D%5Bkey%5D=TEST_VAR&job_variables_ attributes%5B%5D%5Bvalue%5D=it+works%21"
- See that your manual job has run and printed
it works!
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 Avielle Wolfe