Class: DevOpsReport::MetricPresenter

Inherits:
Gitlab::View::Presenter::Simple show all
Defined in:
app/presenters/dev_ops_report/metric_presenter.rb

Instance Method Summary collapse

Methods inherited from Gitlab::View::Presenter::Simple

#initialize

Methods included from Gitlab::View::Presenter::Base

#__subject__, #can?, #declarative_policy_delegate, #is_a?, #path_with_line_numbers, #present, #url_builder, #web_path, #web_url

Methods included from Gitlab::Allowable

#can?

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Simple

Instance Method Details

#average_percentage_scoreObject

rubocop: disable CodeReuse/ActiveRecord



147
148
149
# File 'app/presenters/dev_ops_report/metric_presenter.rb', line 147

def average_percentage_score
  cards.sum(&:percentage_score) / cards.size.to_f
end

#cardsObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'app/presenters/dev_ops_report/metric_presenter.rb', line 9

def cards
  [
    Card.new(
      metric: metric,
      title: 'Issues',
      description: 'created per active user',
      feature: 'issues',
      blog: 'https://www2.deloitte.com/content/dam/Deloitte/se/Documents/technology-media-telecommunications/deloitte-digital-collaboration.pdf'
    ),
    Card.new(
      metric: metric,
      title: 'Comments',
      description: 'created per active user',
      feature: 'notes',
      blog: 'http://conversationaldevelopment.com/why/'
    ),
    Card.new(
      metric: metric,
      title: 'Milestones',
      description: 'created per active user',
      feature: 'milestones',
      blog: 'http://conversationaldevelopment.com/shorten-cycle/',
      docs: help_page_path('user/project/milestones/index')
    ),
    Card.new(
      metric: metric,
      title: 'Boards',
      description: 'created per active user',
      feature: 'boards',
      blog: 'http://jpattonassociates.com/user-story-mapping/',
      docs: help_page_path('user/project/issue_board')
    ),
    Card.new(
      metric: metric,
      title: 'Merge requests',
      description: 'per active user',
      feature: 'merge_requests',
      blog: 'https://8thlight.com/blog/uncle-bob/2013/02/01/The-Humble-Craftsman.html',
      docs: help_page_path('user/project/merge_requests/index')
    ),
    Card.new(
      metric: metric,
      title: 'Pipelines',
      description: 'created per active user',
      feature: 'ci_pipelines',
      blog: 'https://martinfowler.com/bliki/ContinuousDelivery.html',
      docs: help_page_path('ci/index')
    ),
    Card.new(
      metric: metric,
      title: 'Environments',
      description: 'created per active user',
      feature: 'environments',
      blog: 'https://about.gitlab.com/2016/08/26/ci-deployment-and-environments/',
      docs: help_page_path('ci/environments/index')
    ),
    Card.new(
      metric: metric,
      title: 'Deployments',
      description: 'created per active user',
      feature: 'deployments',
      blog: 'https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff'
    ),
    Card.new(
      metric: metric,
      title: 'Monitoring',
      description: 'fraction of all projects',
      feature: 'projects_prometheus_active',
      blog: 'https://prometheus.io/docs/introduction/overview/',
      docs: help_page_path('user/project/integrations/prometheus')
    ),
    Card.new(
      metric: metric,
      title: 'Service Desk',
      description: 'issues created per active user',
      feature: 'service_desk_issues',
      blog: 'http://blogs.forrester.com/kate_leggett/17-01-30-top_trends_for_customer_service_in_2017_operations_become_smarter_and_more_strategic',
      docs: 'https://docs.gitlab.com/ee/user/project/service_desk.html'
    )
  ]
end

#idea_to_production_stepsObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'app/presenters/dev_ops_report/metric_presenter.rb', line 91

def idea_to_production_steps
  [
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Idea',
      features: %w[issues]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Issue',
      features: %w[issues notes]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Plan',
      features: %w[milestones boards]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Code',
      features: %w[merge_requests]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Commit',
      features: %w[merge_requests]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Test',
      features: %w[ci_pipelines]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Review',
      features: %w[ci_pipelines environments]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Staging',
      features: %w[environments deployments]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Production',
      features: %w[deployments]
    ),
    IdeaToProductionStep.new(
      metric: metric,
      title: 'Feedback',
      features: %w[projects_prometheus_active service_desk_issues]
    )
  ]
end