Loading
Limit stage metrics to 15 stages per GraphQL request
What does this MR do and why?
- Limit the value stream stage
metricsfield to 15 resolutions per GraphQL request, the maximum number of stages in one value stream. - Query complexity can't bound this:
stagesis a plain list, so the field's complexity counts once no matter how many stages resolve it. This uses the existingFieldCallCountextension instead, which counts real resolutions per query. - Behind the
vsa_stage_metrics_validate_timeframefeature flag, the samegitlab_com_deriskflag as the timeframe check, scoped to the stage's root namespace. Follows theMlCandidateFieldCallCountpattern. - The VSA page asks for one value stream at a time (
valueStreams(id:)), so at most 15 stages, and is unaffected. - The new limit makes some queries that pass today fail, which is a GraphQL breaking change once the flag is fully enabled. It is covered by the performance exemption, documented in the rollout issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/638756#breaking-change-exemption
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/636169 (MR 2)
- Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/638756
Screenshots or screen recordings
How to set up and validate locally
- Enable the flag:
Feature.enable(:vsa_stage_metrics_validate_timeframe) - In GraphiQL, request metrics for the default value stream three times with aliases (6 stages each, 18 in total):
It returns
query { project(fullPath: "<project>") { a: valueStreams { nodes { stages { metrics(timeframe: { start: "2026-09-01", end: "2026-10-01" }) { count { value } } } } } b: valueStreams { nodes { stages { metrics(timeframe: { start: "2026-09-01", end: "2026-10-01" }) { count { value } } } } } c: valueStreams { nodes { stages { metrics(timeframe: { start: "2026-09-01", end: "2026-10-01" }) { count { value } } } } } } }"metrics" field can be requested only for 15 ValueStreamStage(s) at a time. - Remove two of the aliases. The metrics return as before.
- Open the project and group VSA pages. The stage durations chart loads.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Ezekiel Kigbo