Skip to content

Value Streams Dashboard: Expose flow metrics (New Issues) via graphql

Problem

We currently have to make a large number of API requests to fetch the data required for the exec dashboards feature. Not all of the metrics are available in graphql.

Solution

Implementation

We have 4 metrics to expose. Each of them is invoked differently (Issuealbe finder, DORA, VSA median call) and requires a different test data setup. This would produce a fairly large MR thus this MR should focus only on setting up the GraphQL API and expose only one metric: Issue count.

I would avoid using existing (issues) GraphQL APIs because we might move the whole VSA feature to a different data store in the future which could introduce inconsistency issues.

Proposed API structure:

group(fullPath: "gitlab-org") {
  valueStream(from: "", to: "") {
    flowMetrics {
       issueCount(milestoneId:, assigneeUsernames: [], milestoneTitle: "", labelName: [], authorUsername: "") {
         identifier
         value
         title
         links // options, array of strings
         unit // optional
       }
       ... next metric comes here
    }
    valueStreams(id: 1) { // to be implemented later when we move VSA completely to GraphQL
      stages {
        median
        count
        average
      }
    }
  }
}
Edited by Brandon Labuschagne