Skip to content

Add :waiting_for_callback CI status

Tiger Watson requested to merge 415736-create-external-job-state into master

What does this MR do and why?

Adds waiting_for_callback to the list of possible states for CI objects (eg. jobs/stages/pipelines).

This state represents jobs that are due to run, but instead of being picked by a runner will wait until the callback is received.

Note that there's currently no way for an object to enter this state, as there is no transition defined at the job level (the new transitions for pipeline and stage are to satisfy the test suite, but they are never actually called).

For more information, see the epic.

Screenshots or screen recordings

Pipeline view Jobs list
Screenshot_2023-10-20_at_1.14.05_pm Screenshot_2023-10-20_at_1.16.16_pm

How to set up and validate locally

  1. Create a project, and add a minimal .gitlab-ci.yml such as:
    test:
      stage: test
      when: manual # So the job won't get picked by a runner
      script:
        - echo 'test'
  2. In a Rails console, update the state of the job, stage and pipeline:
    job = Ci::Build.find <job-id>
    job.update! status: :waiting_for_callback
    job.ci_stage.update! status: :waiting_for_callback
    job.pipeline.update! status: :waiting_for_callback
  3. View the pipeline and job pages to see the state text and icons.

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 #415736

Edited by Tiger Watson

Merge request reports