Backend: Merge trains visualization MVC

Problem

provide required end-points to implement the plan in Merge train visualization MVC.

Available Tier

Premium +

Feature Usage Metrics

let's set up?

What does success look like, and how can we measure that?

Increased adoption of merge trains

Is this a cross-stage feature?

Need to keep groupcode review updated as the merge widget may be impacted.

What is the competitive advantage or differentiation for this feature?

Increases usability of merge trains, boosting the positioning against competing offerings.

Proposal

  • Provide GraphQL endpoints to support the merge trains frontend MVC.
  • Add database indexes as needed to ensure the queries are performant.

Mutation: Create removal mutation, functionality should exist so it just needs to be ported to GraphQL.

Query sketches:

# get the list of all target branches that have had a merge train for a given project
query { 
  project(fullPath: "gitlab-org/gitlab") {
    mergeTrains {
      targetBranch
    }
  }
}

# get the list of all target branches that have a currently running train (i.e. at least one active car)
query { 
  project(fullPath: "gitlab-org/gitlab") {
    mergeTrains(active: true) {
      targetBranch
    }
  }
}

# get active (running) cars for a specific set of branches
query { 
  project(fullPath: "gitlab-org/gitlab") {
    mergeTrains(targetBranches: ["master"]) {
      cars(limit: 10) {
        mergeRequest { iid }
        pipeline { id, status }
      }
    }
  }
}

# get completed (merged) cars for a specific list of branches 
query { 
  project(fullPath: "gitlab-org/gitlab") {
    mergeTrains(targetBranches: ["master"]) {
      cars(completed: true, limit: 10) {
        mergeRequest { iid }
        pipeline { id, status }
      }
    }
  }
}

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by 🤖 GitLab Bot 🤖