Loading
Add mttrOverTime field to securityMetrics
What does this MR do and why?
- Adds the
mttrOverTimefield toSecurityMetrics(group, project and organization) for the security dashboard's "MTTR over time" chart. - Returns one bucket per Monday–Sunday week from
MttrOverTimeFinder, as a plain list matching the agreed contract. Every week, severity and report type is zero-filled. - Behind the
security_dashboard_mttr_chartfeature flag. It returnsnullwhen the flag is off, and the rest ofsecurityMetricsis unaffected. Marked as an experiment (19.5). bySeverityandbyReportTypeare only computed when selected. It is always a single Elasticsearch query.- The date range is validated: start on or before end, start not in the future, and at most 12 weeks (
MTTR_OVER_TIME_MAX_WEEKS). - Removes the security dashboard's client-side
typedefs.graphql. It declared the same field and types, which now clash with the real schema. The mock resolvers stay until the frontend switches to the API in !255843 (merged).
References
- Implements #627302 (closed)
- Builds on !257453 (merged) (finder) and !256204 (merged) (aggregation), both merged
- GraphQL contract #626733 (closed)
- Frontend (removes the mock resolver) !255843 (merged)
- Epic &23458
Screenshots or screen recordings
No UI changes. Validated end to end in a GDK together with the frontend MR (!255843 (merged)).
How to set up and validate locally
-
Enable the flag for a group with indexed vulnerabilities (advanced search on):
Feature.enable(:security_dashboard_mttr_chart, Group.find_by_full_path('your-group')) -
In GraphiQL (
/-/graphql-explorer), run:{ group(fullPath: "your-group") { securityMetrics { mttrOverTime(startDate: "2026-07-13", endDate: "2026-10-04") { startDate endDate count sumDays mttr bySeverity { severity count mttr } byReportType { reportType count mttr } } } } } -
Check there is one bucket per week, with every severity and report type listed.
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 Harrison Peters