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 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', () => {
// eslint-disable-next-line no-new
......
......@@ -10,7 +10,7 @@
@import './pages/cycle_analytics';
@import './pages/deploy_keys';
@import './pages/detail_page';
@import './pages/dev_ops_score';
@import './pages/dev_ops_report';
@import './pages/diff';
@import './pages/editor';
@import './pages/environment_logs';
......
# frozen_string_literal: true
class Admin::DevOpsScoreController < Admin::ApplicationController
class Admin::DevOpsReportController < Admin::ApplicationController
include Analytics::UniqueVisitsHelper
track_unique_visits :show, target_id: 'i_analytics_dev_ops_score'
# rubocop: disable CodeReuse/ActiveRecord
def show
@metric = DevOpsScore::Metric.order(:created_at).last&.present
@metric = DevOpsReport::Metric.order(:created_at).last&.present
end
# rubocop: enable CodeReuse/ActiveRecord
end
# frozen_string_literal: true
module DevOpsScoreHelper
module DevOpsReportHelper
def score_level(score)
if score < 33.33
'low'
......
......@@ -63,7 +63,7 @@ module NavHelper
end
def admin_analytics_nav_links
%w(dev_ops_score cohorts)
%w(dev_ops_report cohorts)
end
def group_issues_sub_menu_items
......
# frozen_string_literal: true
module DevOpsScore
module DevOpsReport
class Card
attr_accessor :metric, :title, :description, :feature, :blog, :docs
......
# frozen_string_literal: true
module DevOpsScore
module DevOpsReport
class IdeaToProductionStep
attr_accessor :metric, :title, :features
......
# frozen_string_literal: true
module DevOpsScore
module DevOpsReport
class Metric < ApplicationRecord
include Presentable
......
# frozen_string_literal: true
module DevOpsScore
module DevOpsReport
class MetricPresenter < Gitlab::View::Presenter::Simple
def cards
[
......
......@@ -51,11 +51,11 @@ class SubmitUsagePingService
end
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?
DevOpsScore::Metric.create!(
DevOpsReport::Metric.create!(
metrics.slice(*METRICS)
)
end
......
.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
%button.btn.btn-default.close.js-close-callout{ type: 'button',
'aria-label' => _('Dismiss DevOps Report introduction') }
......@@ -10,4 +10,4 @@
%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.')
.svg-container.devops
= custom_icon('dev_ops_score_overview')
= custom_icon('dev_ops_report_overview')
.container.devops-empty
.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...')
%p
= _('In order to gather accurate feature usage data, it can take 1 to 2 weeks to see your index.')
......
......@@ -2,7 +2,7 @@
- usage_ping_enabled = Gitlab::CurrentSettings.usage_ping_enabled
.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'
.gl-mt-3
......
......@@ -49,7 +49,7 @@
= _('Gitaly Servers')
= 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
= sprite_icon('chart')
%span.nav-item-name
......@@ -57,12 +57,12 @@
%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
= link_to admin_dev_ops_score_path do
= link_to admin_dev_ops_report_path do
%strong.fly-out-top-item-name
= _('Analytics')
%li.divider.fly-out-top-item
= nav_link(controller: :dev_ops_score) do
= link_to admin_dev_ops_score_path, title: _('DevOps Report') do
= nav_link(controller: :dev_ops_report) do
= link_to admin_dev_ops_report_path, title: _('DevOps Report') do
%span
= _('DevOps Report')
= nav_link(controller: :cohorts) do
......
......@@ -70,8 +70,8 @@ Rails.application.routes.draw do
# Use this scope for all new global routes.
scope path: '-' do
# remove in 13.5
get '/instance_statistics', to: redirect('admin/dev_ops_score')
get '/instance_statistics/dev_ops_score', 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_report')
get '/instance_statistics/cohorts', to: redirect('admin/cohorts')
# Autocomplete
get '/autocomplete/users' => 'autocomplete#users'
......
......@@ -90,7 +90,9 @@ namespace :admin do
resources :projects, 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
scope(path: 'projects/*namespace_id',
......
Gitlab::Seeder.quiet do
dev_ops_score_metric = DevOpsScore::Metric.new(
dev_ops_report_metric = DevOpsReport::Metric.new(
leader_issues: 10.2,
instance_issues: 3.2,
......@@ -31,10 +31,10 @@ Gitlab::Seeder.quiet do
instance_service_desk_issues: 15.1
)
if dev_ops_score_metric.save
if dev_ops_report_metric.save
print '.'
else
puts dev_ops_score_metric.errors.full_messages
puts dev_ops_report_metric.errors.full_messages
print 'F'
end
end
# frozen_string_literal: true
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
resource :cycle_analytics, only: :show, path: 'value_stream_analytics'
......
......@@ -9,9 +9,9 @@ RSpec.describe 'admin dev ops analytics' do
login_as(user)
end
it 'redirects from -/analytics to admin/dev_ops_score' do
it 'redirects from -/analytics to admin/dev_ops_report' do
get '/-/analytics'
expect(response).to redirect_to(admin_dev_ops_score_path)
expect(response).to redirect_to(admin_dev_ops_report_path)
end
end
......@@ -7,10 +7,10 @@ module RuboCop
#
# @example
# # bad
# root to: redirect('/-/instance/statistics/dev_ops_score')
# root to: redirect('/-/instance_statistics/dev_ops_report')
#
# # good
# root to: redirect('-/instance/statistics/dev_ops_score')
# root to: redirect('-/instance_statistics/dev_ops_report')
#
class AvoidRouteRedirectLeadingSlash < RuboCop::Cop::Cop
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Admin::DevOpsScoreController do
RSpec.describe Admin::DevOpsReportController do
describe 'GET #show' do
context 'as admin' do
let(:user) { create(:admin) }
......
# frozen_string_literal: true
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 }
instance_issues { 1.234 }
percentage_issues { 13.331 }
......
......@@ -8,7 +8,7 @@ RSpec.describe 'DevOps Report page' do
end
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'
......@@ -23,13 +23,13 @@ RSpec.describe 'DevOps Report page' do
end
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")
end
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'
end
......@@ -39,7 +39,7 @@ RSpec.describe 'DevOps Report page' do
it 'shows empty state' do
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')
end
......@@ -48,9 +48,9 @@ RSpec.describe 'DevOps Report page' do
context 'when there is data to display' do
it 'shows numbers for each metric' do
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(
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
......
......@@ -2,8 +2,8 @@
require 'spec_helper'
RSpec.describe DevOpsScore::Metric do
let(:conv_dev_index) { create(:dev_ops_score_metric) }
RSpec.describe DevOpsReport::Metric do
let(:conv_dev_index) { create(:dev_ops_report_metric) }
describe '#percentage_score' do
it 'returns stored percentage score' do
......
......@@ -2,10 +2,10 @@
require 'spec_helper'
RSpec.describe DevOpsScore::MetricPresenter do
RSpec.describe DevOpsReport::MetricPresenter do
subject { described_class.new(metric) }
let(:metric) { build(:dev_ops_score_metric) }
let(:metric) { build(:dev_ops_report_metric) }
describe '#cards' do
it 'includes instance score, leader score and percentage score' do
......
......@@ -134,6 +134,20 @@ RSpec.describe Admin::HealthCheckController, "routing" do
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
let(:name) { 'complex.group-namegit' }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Instance Statistics', 'routing' do
include RSpec::Rails::RequestExampleGroup
it "routes '/-/instance_statistics' to dev ops score" do
expect(get('/-/instance_statistics')).to redirect_to('/admin/dev_ops_score')
it "routes '/-/instance_statistics' to dev ops report" do
expect(get('/-/instance_statistics')).to redirect_to('/admin/dev_ops_report')
end
end
......@@ -71,12 +71,12 @@ RSpec.describe SubmitUsagePingService do
shared_examples 'saves DevOps report data from the response' do
it do
expect { subject.execute }
.to change { DevOpsScore::Metric.count }
.to change { DevOpsReport::Metric.count }
.by(1)
expect(DevOpsScore::Metric.last.leader_issues).to eq 10.2
expect(DevOpsScore::Metric.last.instance_issues).to eq 3.2
expect(DevOpsScore::Metric.last.percentage_issues).to eq 31.37
expect(DevOpsReport::Metric.last.leader_issues).to eq 10.2
expect(DevOpsReport::Metric.last.instance_issues).to eq 3.2
expect(DevOpsReport::Metric.last.percentage_issues).to eq 31.37
end
end
......
......@@ -68,7 +68,7 @@ RSpec.describe 'layouts/nav/sidebar/_admin' do
context 'on analytics' 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
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