Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f79a7f4b
Commit
f79a7f4b
authored
Oct 23, 2020
by
Brandon Labuschagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add devops adoption tabs
This commit also introduces the feature flag for the tabs.
parent
5e565772
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
163 additions
and
29 deletions
+163
-29
app/views/admin/dev_ops_report/_tab.html.haml
app/views/admin/dev_ops_report/_tab.html.haml
+3
-0
app/views/admin/dev_ops_report/show.html.haml
app/views/admin/dev_ops_report/show.html.haml
+15
-1
config/feature_flags/development/devops_adoption.yml
config/feature_flags/development/devops_adoption.yml
+7
-0
locale/gitlab.pot
locale/gitlab.pot
+6
-0
spec/features/admin/admin_dev_ops_report_spec.rb
spec/features/admin/admin_dev_ops_report_spec.rb
+132
-28
No files found.
app/views/admin/dev_ops_report/_tab.html.haml
0 → 100644
View file @
f79a7f4b
%li
.nav-item.js-devops-tab-item
{
role:
'presentation'
}
%a
.nav-link
{
href:
target
,
class:
active_when
(
active
),
data:
{
toggle:
'tab'
},
role:
'tab'
}
=
title
app/views/admin/dev_ops_report/show.html.haml
View file @
f79a7f4b
...
...
@@ -3,4 +3,18 @@
.container
.gl-mt-3
=
render
'report'
-
if
Feature
.
enabled?
(
:devops_adoption
)
%h2
=
_
(
'DevOps Report'
)
%ul
.nav-links.nav-tabs.nav.js-devops-tabs
{
role:
'tablist'
}
=
render
'tab'
,
active:
true
,
title:
_
(
'DevOps Score'
),
target:
'#devops_score_pane'
=
render
'tab'
,
active:
false
,
title:
_
(
'Adoption'
),
target:
'#devops_adoption_pane'
.tab-content
.tab-pane.active
#devops_score_pane
=
render
'report'
.tab-pane
#devops_adoption_pane
.js-devops-adoption
-
else
=
render
'report'
config/feature_flags/development/devops_adoption.yml
0 → 100644
View file @
f79a7f4b
---
name
:
devops_adoption
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46005
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/271568
type
:
development
group
:
group::analytics
default_enabled
:
false
locale/gitlab.pot
View file @
f79a7f4b
...
...
@@ -2266,6 +2266,9 @@ msgstr ""
msgid "Administration"
msgstr ""
msgid "Adoption"
msgstr ""
msgid "Advanced"
msgstr ""
...
...
@@ -9218,6 +9221,9 @@ msgstr ""
msgid "DevOps Report"
msgstr ""
msgid "DevOps Score"
msgstr ""
msgid "Diff content limits"
msgstr ""
...
...
spec/features/admin/admin_dev_ops_report_spec.rb
View file @
f79a7f4b
...
...
@@ -2,59 +2,163 @@
require
'spec_helper'
RSpec
.
describe
'DevOps Report page'
do
RSpec
.
describe
'DevOps Report page'
,
:js
do
tabs_selector
=
'.js-devops-tabs'
tab_item_selector
=
'.js-devops-tab-item'
active_tab_selector
=
'.nav-link.active'
before
do
sign_in
(
create
(
:admin
))
end
it
'has dismissable intro callout'
,
:js
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
'Introducing Your DevOps Report'
find
(
'.js-close-callout'
).
click
expect
(
page
).
not_to
have_content
'Introducing Your DevOps Report'
end
context
'when usage ping is disabled'
do
context
'with devops_adoption feature flag disabled'
do
before
do
stub_
application_setting
(
usage_ping_enabled
:
false
)
stub_
feature_flags
(
devops_adoption
:
false
)
end
it
'
shows empty state'
,
:js
do
it
'
does not show the tabbed layout'
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_selector
(
".js-empty-state"
)
expect
(
page
).
not_to
have_selector
tabs_selector
end
it
'h
ides th
e intro callout'
do
it
'h
as dismissabl
e intro callout'
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
'Introducing Your DevOps Report'
find
(
'.js-close-callout'
).
click
expect
(
page
).
not_to
have_content
'Introducing Your DevOps Report'
end
context
'when usage ping is disabled'
do
before
do
stub_application_setting
(
usage_ping_enabled:
false
)
end
it
'shows empty state'
do
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_report_path
expect
(
page
).
not_to
have_content
'Introducing Your DevOps Report'
end
end
context
'when there is no data to display'
do
it
'shows empty state'
do
stub_application_setting
(
usage_ping_enabled:
true
)
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
(
'Data is still calculating'
)
end
end
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_report_metric
)
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
(
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
)
end
end
end
context
'when there is no data to display'
do
it
'shows empty state'
do
stub_application_setting
(
usage_ping_enabled:
true
)
context
'with devops_adoption feature flag enabled'
do
it
'shows the tabbed layout'
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_selector
tabs_selector
end
it
'shows the correct tabs'
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
(
'Data is still calculating'
)
within
tabs_selector
do
expect
(
page
.
all
(
:css
,
tab_item_selector
).
length
).
to
be
(
2
)
expect
(
page
).
to
have_text
'DevOps Score Adoption'
end
end
end
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_report_metric
)
it
'defaults to the DevOps Score tab'
do
visit
admin_dev_ops_report_path
within
tabs_selector
do
expect
(
page
).
to
have_selector
active_tab_selector
,
text:
'DevOps Score'
end
end
it
'displays the Adoption tab content when selected'
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
(
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
)
click_link
'Adoption'
within
tabs_selector
do
expect
(
page
).
to
have_selector
active_tab_selector
,
text:
'Adoption'
end
end
context
'the devops score tab'
do
it
'has dismissable intro callout'
do
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
'Introducing Your DevOps Report'
find
(
'.js-close-callout'
).
click
expect
(
page
).
not_to
have_content
'Introducing Your DevOps Report'
end
context
'when usage ping is disabled'
do
before
do
stub_application_setting
(
usage_ping_enabled:
false
)
end
it
'shows empty state'
do
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_report_path
expect
(
page
).
not_to
have_content
'Introducing Your DevOps Report'
end
end
context
'when there is no data to display'
do
it
'shows empty state'
do
stub_application_setting
(
usage_ping_enabled:
true
)
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
(
'Data is still calculating'
)
end
end
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_report_metric
)
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_content
(
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment