Skip to content

Add `async` arg to `PipelineCreate` mutation

What does this MR do and why?

This MR adds async and source args to the PipelineCreate mutation. It also adds functionality to Ci::PipelineCreation::Requests to store creation request data for general project pipelines (ie. not merge request pipelines).

We'll use this new functionality to make the pipeline creation request on the pipelines/new page asynchronous. This will reduce the pipeline creation timeouts and improve the overall user experience.

Issue: #488392

Changelog: added

How to set up and validate locally

  1. Use the following mutation in graphql-explorer

    mutation {
      pipelineCreate(input: { async: true, projectPath: "PATH", ref: "main" }) {
        requestId
      }
    }
  2. Use the request ID from the response for the request_id in the next step

  3. In the Rails console, find your project and run:

    ::Ci::PipelineCreation::Requests.get_request(project, request_id)
  4. See the pipeline creation request status. It should look something like:

    {"status"=>"succeeded", "pipeline_id"=>678} # might be failed or in_progress depending on your config and Runner state
  5. That's it! You're all done 🙌

Edited by Avielle Wolfe

Merge request reports

Loading