Skip to content

Add GraphQL wrapper for pipeline mini graph

Briley Sandlin requested to merge 384853-pipeline-mini-graph-dropdown-jobs into master

What does this MR do and why?

Part 1 of #384853

This MR creates a GraphQL wrapper around the pipeline mini graph and consolidates the apps that use apollo so that

  • The pipeline mini graph owns the queries
  • Every app that uses the pipeline mini graph can simply pass in a project path and pipeline ID.

The legacy implementation is preserved for now and we are releasing this behind a feature flag.

We are also moving pipeline mini graph queries to ~/pipelines directory and updating references

Part 2

  • Add GraphQL query to fetch stages
  • Update REST dropdowns to correct bug

Part 3

  • Create REST wrapper for pipeline mini graph

Ultimately, we will have consolidated queries from 5 separate apps down to 2 definitive API approaches and the pipeline mini graph will hold all of it's own data. Eventually, we aim to deprecate the REST calls altogether and only have 1 GraphQL implementation. This will occur when the other 3 apps migrate from REST.

Screenshots or screen recordings

Commit Page Pipeline Editor
commit_page editor_page

How to set up and validate locally

  • Enable the feature flag Feature.enable(:graphql_pipeline_mini_graph)
  • Navigate to CI/CD >> Editor and create a pipeline. You may use this example:
bridge_job:
  trigger:
    include: child-pipeline.yml

job: 
  script:
    - sleep 5

another_job:
  script:
    - sleep 10
  • Commit the file and view the pipeline mini graph at the top of your current page:
  • Navigate to Repository >> Commits and click on a commit.
  • Insure that the pipeline mini graph on the commit page functions the same way.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Briley Sandlin

Merge request reports