Validate the timeframe of GraphQL stage metrics

What does this MR do and why?

  • Validate the timeframe of the GraphQL value stream stage metrics field, 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

Screenshots or screen recordings

How to set up and validate locally

  1. Enable the flag: Feature.enable(:vsa_stage_metrics_validate_timeframe)
  2. In GraphiQL, run:
    query {
      project(fullPath: "<project>") {
        valueStreams { nodes { stages { metrics(timeframe: { start: "2016-01-01", end: "2026-10-23" }) { count { value } } } } }
      }
    }
    It returns The given date range is larger than 180 days.
  3. Change the timeframe to 180 days or less. The metrics return as before.
  4. 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.

Merge request reports

Loading
Loading