Skip to content

Split the Value stream dashboard table into multiple panels

Alex Pennells requested to merge 461748-split-table into master

What does this MR do and why?

Splits the metric table into separate panels for Lifecycle metrics, DORA metrics and Security metrics. Also ensures that each of the table columns are aligned with each other.

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

Note: Dashboard loading errors are due to Clickhouse not running, and are expected.

Before After
Screenshot_2024-09-25_at_2.00.15_PM Screenshot_2024-09-25_at_1.55.59_PM
Screenshot_2024-09-25_at_1.59.50_PM Screenshot_2024-09-25_at_1.56.29_PM

How to set up and validate locally

  1. Ensure that you are using GitLab Ultimate
  2. Navigate to the VSD for any group (ex. http://gdk.test:3000/groups/flightjs/-/analytics/dashboards/value_streams_dashboard)
  3. Verify that the newly split charts load as expected
  4. Navigate to the VSD for any project (ex. http://gdk.test:3000/flightjs/Flight/-/analytics/dashboards/value_streams_dashboard)
  5. Verify that the newly split charts load as expected

Add mock dashboard data (optional)

  1. Determine the ID of a project in your test group
  2. Enter the rails console: rails c
  3. Create reference to your test project: project = Project.find(ID)
  4. Run any of the necessary data mocks below:
DORA metrics
[
  [1.month.ago, 5, 1, 5, 2],
  [2.month.ago, 10, 3, 3, 3],
  [3.month.ago, 8, 5, 7, 1],
  [4.month.ago, 5, 1, 5, 2],
  [5.month.ago, 10, 3, 3, 3],
  [6.month.ago, 8, 5, 7, 1]
].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
Lifecycle metrics
[
  [1.month.ago.beginning_of_month + 2.days, 2, 10],
  [2.month.ago.beginning_of_month + 2.days, 4, 20],
  [3.month.ago.beginning_of_month + 2.days, 3, 15],
  [4.month.ago.beginning_of_month + 2.days, 2, 10],
  [5.month.ago.beginning_of_month + 2.days, 4, 20],
  [6.month.ago.beginning_of_month + 2.days, 3, 15]
].each do |created_at, lead_time, count|
  count.times do
    Issue.create!(
      project: project,
      author: project.users.first,
      title: "create_mock_flow_metrics #{SecureRandom.hex}",
      created_at: created_at,
      closed_at: created_at + lead_time.days
    ).metrics.update!(first_mentioned_in_commit_at: created_at + 1.day)
  end
end

Analytics::CycleAnalytics::DataLoaderService.new(group: project.group, model: Issue).execute
Security metrics
[
  [1.month.ago.end_of_month, 3, 2],
  [2.month.ago.end_of_month, 5, 4],
  [3.month.ago.end_of_month, 2, 3],
  [4.month.ago.end_of_month, 3, 2],
  [5.month.ago.end_of_month, 5, 4],
  [6.month.ago.end_of_month, 2, 3]
].each do |date, critical, high|
  Vulnerabilities::HistoricalStatistic.create!(
    date: date,
    high: high,
    critical: critical,
    total: critical + high,
    letter_grade: 'a',
    project: project
  )
end

Related to #461748 (closed)

Edited by Alex Pennells

Merge request reports

Loading