Commit b91197df authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch 'rename-dev-ops-score-to-dev-ops-report-in-codebase' into 'master'

Rename DevOps Score to DevOps Report in the codebase

See merge request gitlab-org/gitlab!41406
parents 1ec95ad8 cfdc3220
import Vue from 'vue'; import Vue from 'vue';
import UserCallout from '~/user_callout'; import UserCallout from '~/user_callout';
import UsagePingDisabled from '~/admin/dev_ops_score/components/usage_ping_disabled.vue'; import UsagePingDisabled from '~/admin/dev_ops_report/components/usage_ping_disabled.vue';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@import './pages/cycle_analytics'; @import './pages/cycle_analytics';
@import './pages/deploy_keys'; @import './pages/deploy_keys';
@import './pages/detail_page'; @import './pages/detail_page';
@import './pages/dev_ops_score'; @import './pages/dev_ops_report';
@import './pages/diff'; @import './pages/diff';
@import './pages/editor'; @import './pages/editor';
@import './pages/environment_logs'; @import './pages/environment_logs';
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::DevOpsScoreController < Admin::ApplicationController class Admin::DevOpsReportController < Admin::ApplicationController
include Analytics::UniqueVisitsHelper include Analytics::UniqueVisitsHelper
track_unique_visits :show, target_id: 'i_analytics_dev_ops_score' track_unique_visits :show, target_id: 'i_analytics_dev_ops_score'
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def show def show
@metric = DevOpsScore::Metric.order(:created_at).last&.present @metric = DevOpsReport::Metric.order(:created_at).last&.present
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
end end
# frozen_string_literal: true # frozen_string_literal: true
module DevOpsScoreHelper module DevOpsReportHelper
def score_level(score) def score_level(score)
if score < 33.33 if score < 33.33
'low' 'low'
......
...@@ -63,7 +63,7 @@ module NavHelper ...@@ -63,7 +63,7 @@ module NavHelper
end end
def admin_analytics_nav_links def admin_analytics_nav_links
%w(dev_ops_score cohorts) %w(dev_ops_report cohorts)
end end
def group_issues_sub_menu_items def group_issues_sub_menu_items
......
# frozen_string_literal: true # frozen_string_literal: true
module DevOpsScore module DevOpsReport
class Card class Card
attr_accessor :metric, :title, :description, :feature, :blog, :docs attr_accessor :metric, :title, :description, :feature, :blog, :docs
......
# frozen_string_literal: true # frozen_string_literal: true
module DevOpsScore module DevOpsReport
class IdeaToProductionStep class IdeaToProductionStep
attr_accessor :metric, :title, :features attr_accessor :metric, :title, :features
......
# frozen_string_literal: true # frozen_string_literal: true
module DevOpsScore module DevOpsReport
class Metric < ApplicationRecord class Metric < ApplicationRecord
include Presentable include Presentable
......
# frozen_string_literal: true # frozen_string_literal: true
module DevOpsScore module DevOpsReport
class MetricPresenter < Gitlab::View::Presenter::Simple class MetricPresenter < Gitlab::View::Presenter::Simple
def cards def cards
[ [
......
...@@ -51,11 +51,11 @@ class SubmitUsagePingService ...@@ -51,11 +51,11 @@ class SubmitUsagePingService
end end
def store_metrics(response) def store_metrics(response)
metrics = response['conv_index'] || response['dev_ops_score'] metrics = response['conv_index'] || response['dev_ops_score'] # leaving dev_ops_score here, as the response data comes from the gitlab-version-com
return unless metrics.present? return unless metrics.present?
DevOpsScore::Metric.create!( DevOpsReport::Metric.create!(
metrics.slice(*METRICS) metrics.slice(*METRICS)
) )
end end
......
.gl-mt-3 .gl-mt-3
.user-callout{ data: { uid: 'dev_ops_score_intro_callout_dismissed' } } .user-callout{ data: { uid: 'dev_ops_report_intro_callout_dismissed' } }
.bordered-box.landing.content-block .bordered-box.landing.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', %button.btn.btn-default.close.js-close-callout{ type: 'button',
'aria-label' => _('Dismiss DevOps Report introduction') } 'aria-label' => _('Dismiss DevOps Report introduction') }
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
%p %p
= _('Your DevOps Report gives an overview of how you are using GitLab from a feature perspective. View how you compare with other organizations, discover features you are not using, and learn best practices through blog posts and white papers.') = _('Your DevOps Report gives an overview of how you are using GitLab from a feature perspective. View how you compare with other organizations, discover features you are not using, and learn best practices through blog posts and white papers.')
.svg-container.devops .svg-container.devops
= custom_icon('dev_ops_score_overview') = custom_icon('dev_ops_report_overview')
.container.devops-empty .container.devops-empty
.col-sm-12.justify-content-center.text-center .col-sm-12.justify-content-center.text-center
= custom_icon('dev_ops_score_no_data') = custom_icon('dev_ops_report_no_data')
%h4= _('Data is still calculating...') %h4= _('Data is still calculating...')
%p %p
= _('In order to gather accurate feature usage data, it can take 1 to 2 weeks to see your index.') = _('In order to gather accurate feature usage data, it can take 1 to 2 weeks to see your index.')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- usage_ping_enabled = Gitlab::CurrentSettings.usage_ping_enabled - usage_ping_enabled = Gitlab::CurrentSettings.usage_ping_enabled
.container .container
- if usage_ping_enabled && show_callout?('dev_ops_score_intro_callout_dismissed') - if usage_ping_enabled && show_callout?('dev_ops_report_intro_callout_dismissed')
= render 'callout' = render 'callout'
.gl-mt-3 .gl-mt-3
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
= _('Gitaly Servers') = _('Gitaly Servers')
= nav_link(controller: admin_analytics_nav_links) do = nav_link(controller: admin_analytics_nav_links) do
= link_to admin_dev_ops_score_path, data: { qa_selector: 'admin_analytics_link' } do = link_to admin_dev_ops_report_path, data: { qa_selector: 'admin_analytics_link' } do
.nav-icon-container .nav-icon-container
= sprite_icon('chart') = sprite_icon('chart')
%span.nav-item-name %span.nav-item-name
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
%ul.sidebar-sub-level-items{ data: { qa_selector: 'admin_sidebar_analytics_submenu_content' } } %ul.sidebar-sub-level-items{ data: { qa_selector: 'admin_sidebar_analytics_submenu_content' } }
= nav_link(controller: admin_analytics_nav_links, html_options: { class: "fly-out-top-item" }) do = nav_link(controller: admin_analytics_nav_links, html_options: { class: "fly-out-top-item" }) do
= link_to admin_dev_ops_score_path do = link_to admin_dev_ops_report_path do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Analytics') = _('Analytics')
%li.divider.fly-out-top-item %li.divider.fly-out-top-item
= nav_link(controller: :dev_ops_score) do = nav_link(controller: :dev_ops_report) do
= link_to admin_dev_ops_score_path, title: _('DevOps Report') do = link_to admin_dev_ops_report_path, title: _('DevOps Report') do
%span %span
= _('DevOps Report') = _('DevOps Report')
= nav_link(controller: :cohorts) do = nav_link(controller: :cohorts) do
......
...@@ -70,8 +70,8 @@ Rails.application.routes.draw do ...@@ -70,8 +70,8 @@ Rails.application.routes.draw do
# Use this scope for all new global routes. # Use this scope for all new global routes.
scope path: '-' do scope path: '-' do
# remove in 13.5 # remove in 13.5
get '/instance_statistics', to: redirect('admin/dev_ops_score') get '/instance_statistics', to: redirect('admin/dev_ops_report')
get '/instance_statistics/dev_ops_score', to: redirect('admin/dev_ops_score') get '/instance_statistics/dev_ops_score', to: redirect('admin/dev_ops_report')
get '/instance_statistics/cohorts', to: redirect('admin/cohorts') get '/instance_statistics/cohorts', to: redirect('admin/cohorts')
# Autocomplete # Autocomplete
get '/autocomplete/users' => 'autocomplete#users' get '/autocomplete/users' => 'autocomplete#users'
......
...@@ -90,7 +90,9 @@ namespace :admin do ...@@ -90,7 +90,9 @@ namespace :admin do
resources :projects, only: [:index] resources :projects, only: [:index]
resources :instance_statistics, only: :index resources :instance_statistics, only: :index
resource :dev_ops_score, controller: 'dev_ops_score', only: :show resource :dev_ops_report, controller: 'dev_ops_report', only: :show
# remove in 13.5
get '/dev_ops_score', to: redirect('admin/dev_ops_report')
resources :cohorts, only: :index resources :cohorts, only: :index
scope(path: 'projects/*namespace_id', scope(path: 'projects/*namespace_id',
......
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
dev_ops_score_metric = DevOpsScore::Metric.new( dev_ops_report_metric = DevOpsReport::Metric.new(
leader_issues: 10.2, leader_issues: 10.2,
instance_issues: 3.2, instance_issues: 3.2,
...@@ -31,10 +31,10 @@ Gitlab::Seeder.quiet do ...@@ -31,10 +31,10 @@ Gitlab::Seeder.quiet do
instance_service_desk_issues: 15.1 instance_service_desk_issues: 15.1
) )
if dev_ops_score_metric.save if dev_ops_report_metric.save
print '.' print '.'
else else
puts dev_ops_score_metric.errors.full_messages puts dev_ops_report_metric.errors.full_messages
print 'F' print 'F'
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
namespace :analytics do namespace :analytics do
root to: redirect('admin/dev_ops_score') root to: redirect('admin/dev_ops_report')
constraints(-> (req) { Gitlab::Analytics.cycle_analytics_enabled? }) do constraints(-> (req) { Gitlab::Analytics.cycle_analytics_enabled? }) do
resource :cycle_analytics, only: :show, path: 'value_stream_analytics' resource :cycle_analytics, only: :show, path: 'value_stream_analytics'
......
...@@ -9,9 +9,9 @@ RSpec.describe 'admin dev ops analytics' do ...@@ -9,9 +9,9 @@ RSpec.describe 'admin dev ops analytics' do
login_as(user) login_as(user)
end end
it 'redirects from -/analytics to admin/dev_ops_score' do it 'redirects from -/analytics to admin/dev_ops_report' do
get '/-/analytics' get '/-/analytics'
expect(response).to redirect_to(admin_dev_ops_score_path) expect(response).to redirect_to(admin_dev_ops_report_path)
end end
end end
...@@ -7,10 +7,10 @@ module RuboCop ...@@ -7,10 +7,10 @@ module RuboCop
# #
# @example # @example
# # bad # # bad
# root to: redirect('/-/instance/statistics/dev_ops_score') # root to: redirect('/-/instance_statistics/dev_ops_report')
# #
# # good # # good
# root to: redirect('-/instance/statistics/dev_ops_score') # root to: redirect('-/instance_statistics/dev_ops_report')
# #
class AvoidRouteRedirectLeadingSlash < RuboCop::Cop::Cop class AvoidRouteRedirectLeadingSlash < RuboCop::Cop::Cop
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Admin::DevOpsScoreController do RSpec.describe Admin::DevOpsReportController do
describe 'GET #show' do describe 'GET #show' do
context 'as admin' do context 'as admin' do
let(:user) { create(:admin) } let(:user) { create(:admin) }
......
# frozen_string_literal: true # frozen_string_literal: true
FactoryBot.define do FactoryBot.define do
factory :dev_ops_score_metric, class: 'DevOpsScore::Metric' do factory :dev_ops_report_metric, class: 'DevOpsReport::Metric' do
leader_issues { 9.256 } leader_issues { 9.256 }
instance_issues { 1.234 } instance_issues { 1.234 }
percentage_issues { 13.331 } percentage_issues { 13.331 }
......
...@@ -8,7 +8,7 @@ RSpec.describe 'DevOps Report page' do ...@@ -8,7 +8,7 @@ RSpec.describe 'DevOps Report page' do
end end
it 'has dismissable intro callout', :js do it 'has dismissable intro callout', :js do
visit admin_dev_ops_score_path visit admin_dev_ops_report_path
expect(page).to have_content 'Introducing Your DevOps Report' expect(page).to have_content 'Introducing Your DevOps Report'
...@@ -23,13 +23,13 @@ RSpec.describe 'DevOps Report page' do ...@@ -23,13 +23,13 @@ RSpec.describe 'DevOps Report page' do
end end
it 'shows empty state', :js do it 'shows empty state', :js do
visit admin_dev_ops_score_path visit admin_dev_ops_report_path
expect(page).to have_selector(".js-empty-state") expect(page).to have_selector(".js-empty-state")
end end
it 'hides the intro callout' do it 'hides the intro callout' do
visit admin_dev_ops_score_path visit admin_dev_ops_report_path
expect(page).not_to have_content 'Introducing Your DevOps Report' expect(page).not_to have_content 'Introducing Your DevOps Report'
end end
...@@ -39,7 +39,7 @@ RSpec.describe 'DevOps Report page' do ...@@ -39,7 +39,7 @@ RSpec.describe 'DevOps Report page' do
it 'shows empty state' do it 'shows empty state' do
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
visit admin_dev_ops_score_path visit admin_dev_ops_report_path
expect(page).to have_content('Data is still calculating') expect(page).to have_content('Data is still calculating')
end end
...@@ -48,9 +48,9 @@ RSpec.describe 'DevOps Report page' do ...@@ -48,9 +48,9 @@ RSpec.describe 'DevOps Report page' do
context 'when there is data to display' do context 'when there is data to display' do
it 'shows numbers for each metric' do it 'shows numbers for each metric' do
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
create(:dev_ops_score_metric) create(:dev_ops_report_metric)
visit admin_dev_ops_score_path visit admin_dev_ops_report_path
expect(page).to have_content( expect(page).to have_content(
'Issues created per active user 1.2 You 9.3 Lead 13.3%' 'Issues created per active user 1.2 You 9.3 Lead 13.3%'
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe DevOpsScore::Metric do RSpec.describe DevOpsReport::Metric do
let(:conv_dev_index) { create(:dev_ops_score_metric) } let(:conv_dev_index) { create(:dev_ops_report_metric) }
describe '#percentage_score' do describe '#percentage_score' do
it 'returns stored percentage score' do it 'returns stored percentage score' do
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe DevOpsScore::MetricPresenter do RSpec.describe DevOpsReport::MetricPresenter do
subject { described_class.new(metric) } subject { described_class.new(metric) }
let(:metric) { build(:dev_ops_score_metric) } let(:metric) { build(:dev_ops_report_metric) }
describe '#cards' do describe '#cards' do
it 'includes instance score, leader score and percentage score' do it 'includes instance score, leader score and percentage score' do
......
...@@ -134,6 +134,20 @@ RSpec.describe Admin::HealthCheckController, "routing" do ...@@ -134,6 +134,20 @@ RSpec.describe Admin::HealthCheckController, "routing" do
end end
end end
# admin_dev_ops_report GET /admin/dev_ops_report(.:format) admin/dev_ops_report#show
RSpec.describe Admin::DevOpsReportController, "routing" do
it "to #show" do
expect(get("/admin/dev_ops_report")).to route_to('admin/dev_ops_report#show')
end
end
# admin_cohorts GET /admin/cohorts(.:format) admin/cohorst#index
RSpec.describe Admin::CohortsController, "routing" do
it "to #index" do
expect(get("/admin/cohorts")).to route_to('admin/cohorts#index')
end
end
RSpec.describe Admin::GroupsController, "routing" do RSpec.describe Admin::GroupsController, "routing" do
let(:name) { 'complex.group-namegit' } let(:name) { 'complex.group-namegit' }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Instance Statistics', 'routing' do RSpec.describe 'Instance Statistics', 'routing' do
include RSpec::Rails::RequestExampleGroup include RSpec::Rails::RequestExampleGroup
it "routes '/-/instance_statistics' to dev ops score" do it "routes '/-/instance_statistics' to dev ops report" do
expect(get('/-/instance_statistics')).to redirect_to('/admin/dev_ops_score') expect(get('/-/instance_statistics')).to redirect_to('/admin/dev_ops_report')
end end
end end
...@@ -71,12 +71,12 @@ RSpec.describe SubmitUsagePingService do ...@@ -71,12 +71,12 @@ RSpec.describe SubmitUsagePingService do
shared_examples 'saves DevOps report data from the response' do shared_examples 'saves DevOps report data from the response' do
it do it do
expect { subject.execute } expect { subject.execute }
.to change { DevOpsScore::Metric.count } .to change { DevOpsReport::Metric.count }
.by(1) .by(1)
expect(DevOpsScore::Metric.last.leader_issues).to eq 10.2 expect(DevOpsReport::Metric.last.leader_issues).to eq 10.2
expect(DevOpsScore::Metric.last.instance_issues).to eq 3.2 expect(DevOpsReport::Metric.last.instance_issues).to eq 3.2
expect(DevOpsScore::Metric.last.percentage_issues).to eq 31.37 expect(DevOpsReport::Metric.last.percentage_issues).to eq 31.37
end end
end end
......
...@@ -68,7 +68,7 @@ RSpec.describe 'layouts/nav/sidebar/_admin' do ...@@ -68,7 +68,7 @@ RSpec.describe 'layouts/nav/sidebar/_admin' do
context 'on analytics' do context 'on analytics' do
before do before do
allow(controller).to receive(:controller_name).and_return('dev_ops_score') allow(controller).to receive(:controller_name).and_return('dev_ops_report')
end end
it_behaves_like 'page has active tab', 'Analytics' it_behaves_like 'page has active tab', 'Analytics'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment