Add DORA projects comparison panel analytics dashboard visualization

What does this MR do and why?

Adds a new analytics dashboard visualization to compare DORA metrics for projects within a group. The new DoraProjectsComparison will not be visible on any dashboards at this point, but can be viewed by adding the visualization to a custom Value streams dashboard.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

No data With data
Screenshot_2024-10-30_at_2.22.05_PM Screenshot_2024-10-30_at_2.27.03_PM

Untitled

Video recorded with panel.height = 2

How to set up and validate locally

  1. Ensure you are using GitLab Ultimate
  2. Create a custom Value streams dashboard for any group of your choosing, using the sample config:
version: '2'
title: 'Custom VSD'
panels:
  - title: 'Projects by DORA categories (Last full calendar month)'
    visualization: dora_projects_comparison
    gridAttributes:
      yPos: 0
      xPos: 0
      height: 4
      width: 12
  1. Access the custom VSD from the analytics dashboards list (ex. http://gdk.test:3000/groups/flightjs/-/analytics/dashboards)
  2. By default you should see the No data available message
  3. Create mock DORA data for two or more projects within the group ()
project = Group.find(GROUP_ID).projects.first

# generate mock DORA metrics for the last 2 months
# project must have a default environment set first, or this will error
[
  [1.month.ago, 12, 10, 2, 5],
  [2.month.ago, 16, 7, 1, 9]
].each do |date, deploys, lead_time_for_changes, time_to_restore_service, incidents_count|
  Dora::DailyMetrics.create!(
    deployment_frequency: deploys,
    lead_time_for_changes_in_seconds: lead_time_for_changes * 1.day.to_i,
    time_to_restore_service_in_seconds: time_to_restore_service * 1.day.to_i,
    incidents_count: incidents_count,
    environment: project.default_environment,
    date: date
  )
end
  1. Verify that data loads and can be sorted as expected

Related to #408516 (closed)

Edited by Alex Pennells

Merge request reports

Loading