Skip to content

Add `manual_variables` field to `JobType`

Avielle Wolfe requested to merge 361236-add-manual-variables-to-job-type into master

What does this MR do and why?

This MR adds a manual_variables field to JobType, which returns the variables given to a manual job when it is triggered by a user. Builds that are not manual will always have an empty collection for this field. Bridges will have null.

How to set up and validate locally

  1. Create a pipeline with a manual job

    manual_job:
      script:
        - echo "I am manual"
      when: manual
  2. Run the pipeline and go to the job's page. Do not trigger the job from the pipeline graph

  3. Add a variable using the form on the page, and then run the job

  4. Go to /-/graphql-explorer and run this query:

    {
      project(fullPath: "PROJECT_PATH") {
        pipeline(id: "PIPELINE_ID") {
          jobs {
            nodes {
              manualVariables {
                key
                value
              }
            }
          }
        }
      }
    }
  5. See that your variable is present in the return with the correct key and 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.

Related to #361236 (closed)

Edited by Avielle Wolfe

Merge request reports

Loading