Loading
Validate the timeframe of GraphQL stage metrics
What does this MR do and why?
- Validate the
timeframeof the GraphQL value stream stagemetricsfield, so it raises an argument error above 180 days, like the REST stage endpoints. - Behind the
vsa_stage_metrics_validate_timeframe(gitlab_com_derisk) feature flag, default off, because it can reject queries that pass today. - The VSA page only sends ranges from its 180-day date picker, so the UI is unaffected.
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/636169 (MR 1)
Screenshots or screen recordings
How to set up and validate locally
- Enable the flag:
Feature.enable(:vsa_stage_metrics_validate_timeframe) - In GraphiQL, run:
It returns
query { project(fullPath: "<project>") { valueStreams { nodes { stages { metrics(timeframe: { start: "2016-01-01", end: "2026-10-23" }) { count { value } } } } } } }The given date range is larger than 180 days. - Change the timeframe to 180 days or less. The metrics return as before.
- Open the project and group VSA pages. The stage durations chart loads with every preset range.
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.