[VSA] Add GraphQL query for Value Stream Stages
Task
Implement a project and group level GraphQL query which returns the value stream stages for a given value stream.
Structure
group(fullPath: "gitlab-org") { // or project
valueStreamAnalytics {
valueStreams(id: '') {
id // global id
name
createdAt
updatedAt
// actual query starts here
stages(id: '') {
id // global id
name
description
startEvent {
identifier
htmlDescription
label // can be null, it's available for label based stages
}
endEvent {
identifier
htmlDescription
label // can be null, it's available for label based stages
}
createdAt
updatedAt
}
}
}
}
Notes:
- Returns an array of stages for the given value stream
- The endpoint is not paginated. We expect low number of rows and we're planning to add limits: #409609 (closed)
-
id
argument is optional for loading one particular stage. - The value streams are sorted by relative position (as they're visible on the UI).
- We have some special formatting rules (html), see the current serializer for the REST API: https://gitlab.com/gitlab-org/gitlab/-/tree/master/app/serializers/analytics/cycle_analytics/stage_entity.rb
FOSS VS EE
VSA is available on the project-level (FOSS), however there are no persisted stages. The endpoint should return the in memory stages for FOSS projects only (group level VSA node is not available on FOSS).
Finding a stage in FOSS would be done via the stage name (id=stage_name
). These are restricted keywords defined in https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/analytics/cycle_analytics/default_stages.rb
Edited by Adam Hegyi