Skip to content

Create and expose MergeTrains::Train Type and Resolver

What does this MR do and why?

This MR is a part of the Merge Trains Visualization MVC and adds the following:

  • MergeTrains::Train graphql type and policy
  • MergeTrains::Trains graphql resolver and policy
  • MergeTrains::Car policy as it was needed for the resolver
  • merge_trains field on ProjectType

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2024-05-24_at_3.26.40_PM

How to set up and validate locally

  1. Enable the merge_trains_viz feature flag Feature.enabled(:merge_trains_viz)
  2. Ensure that you are using the Premium or Ultimate edition
  3. Enable Merge Trains for your testing project
  4. Open the graphql explorer and test the queries

Sample Query


{
  project(fullPath: "namespace49/project-49") {
    id
    mergeTrains(status: ACTIVE, targetBranches: ["sherlock", "master"]) {
      count
      nodes { 
       targetBranch
      	cars {
        nodes {
          status
          mergeRequest {
            title
          }
        }
      } 
      }
    }
  }
}

Related to #458730 (closed), #458731 (closed), #458735 (closed)

Edited by Panos Kanellidis

Merge request reports