Skip to content

Add deployment frequency charts to CI/CD Analytics page

What does this MR do?

Adds new "deployment frequency" charts to the project-level CI/CD Analytics page.

These new charts are visible if:

  1. The project is on Gold/Ultimate
  2. The user has at least reporter permissions for the project
  3. The deployment_frequency_charts feature flag is not disabled

In order for deployments to show on these graphs, the environment must be named production.

Screenshots

Screen_Shot_2021-01-07_at_2.42.47_PM

Click for mobile-sized screenshot Screen_Shot_2021-01-07_at_2.40.55_PM

Feature flag

This feature is hidden behind a feature flag named deployment_frequency_charts which is disabled by default.

Rollout issue: #296893.

MR to enable the feature flag by default: !51338 (merged)

Testing locally

To create data for this graph locally, drop into the Rails console (rails c) and run the following:

p = Project.find(<your local project's ID here>)
e = Environment.find(<your local production environment's ID here>)
sha = '<any SHA from your repo here>'

2000.times do
  Deployment.new(project: p, environment: e, status: :success, finished_at: rand(1..100).days.ago, sha: sha, ref: 'master', tag: false).save!
end

Note that the environment must be named production.

Related to #275991 (closed)

Edited by Nathan Friend

Merge request reports