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
4689bac8
Commit
4689bac8
authored
Nov 13, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
6e3880e2
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
91 additions
and
11 deletions
+91
-11
app/controllers/concerns/metrics_dashboard.rb
app/controllers/concerns/metrics_dashboard.rb
+27
-1
app/services/metrics/dashboard/project_dashboard_service.rb
app/services/metrics/dashboard/project_dashboard_service.rb
+2
-1
app/services/metrics/dashboard/system_dashboard_service.rb
app/services/metrics/dashboard/system_dashboard_service.rb
+2
-1
changelogs/unreleased/35217-add_fields_to_all_dashboards.yml
changelogs/unreleased/35217-add_fields_to_all_dashboards.yml
+5
-0
config/routes/project.rb
config/routes/project.rb
+1
-1
doc/administration/pages/index.md
doc/administration/pages/index.md
+1
-1
doc/user/permissions.md
doc/user/permissions.md
+1
-1
doc/user/project/operations/error_tracking.md
doc/user/project/operations/error_tracking.md
+11
-0
doc/user/project/operations/img/error_details_v12_5.png
doc/user/project/operations/img/error_details_v12_5.png
+0
-0
spec/controllers/concerns/metrics_dashboard_spec.rb
spec/controllers/concerns/metrics_dashboard_spec.rb
+33
-1
spec/lib/gitlab/email/hook/smime_signature_interceptor_spec.rb
...lib/gitlab/email/hook/smime_signature_interceptor_spec.rb
+2
-0
spec/lib/gitlab/metrics/dashboard/finder_spec.rb
spec/lib/gitlab/metrics/dashboard/finder_spec.rb
+2
-2
spec/services/metrics/dashboard/project_dashboard_service_spec.rb
...vices/metrics/dashboard/project_dashboard_service_spec.rb
+2
-1
spec/services/metrics/dashboard/system_dashboard_service_spec.rb
...rvices/metrics/dashboard/system_dashboard_service_spec.rb
+2
-1
No files found.
app/controllers/concerns/metrics_dashboard.rb
View file @
4689bac8
...
...
@@ -4,6 +4,8 @@
# to the parameters specified by the controller.
module
MetricsDashboard
include
RenderServiceResults
include
ChecksCollaboration
extend
ActiveSupport
::
Concern
def
metrics_dashboard
...
...
@@ -14,7 +16,7 @@ module MetricsDashboard
)
if
include_all_dashboards?
&&
result
result
[
:all_dashboards
]
=
dashboard_finder
.
find_all_paths
(
project_for_dashboard
)
result
[
:all_dashboards
]
=
all_dashboards
end
respond_to
do
|
format
|
...
...
@@ -30,6 +32,30 @@ module MetricsDashboard
private
def
all_dashboards
dashboards
=
dashboard_finder
.
find_all_paths
(
project_for_dashboard
)
dashboards
.
map
do
|
dashboard
|
amend_dashboard
(
dashboard
)
end
end
def
amend_dashboard
(
dashboard
)
project_dashboard
=
project_for_dashboard
&&
!
dashboard
[
:system_dashboard
]
dashboard
[
:can_edit
]
=
project_dashboard
?
can_edit?
(
dashboard
)
:
false
dashboard
[
:project_blob_path
]
=
project_dashboard
?
dashboard_project_blob_path
(
dashboard
)
:
nil
dashboard
end
def
dashboard_project_blob_path
(
dashboard
)
project_blob_path
(
project_for_dashboard
,
File
.
join
(
project_for_dashboard
.
default_branch
,
dashboard
.
fetch
(
:path
,
""
)))
end
def
can_edit?
(
dashboard
)
can_collaborate_with_project?
(
project_for_dashboard
,
ref:
project_for_dashboard
.
default_branch
)
end
# Override in class to provide arguments to the finder.
def
metrics_dashboard_params
{}
...
...
app/services/metrics/dashboard/project_dashboard_service.rb
View file @
4689bac8
...
...
@@ -16,7 +16,8 @@ module Metrics
{
path:
filepath
,
display_name:
name_for_path
(
filepath
),
default:
false
default:
false
,
system_dashboard:
false
}
end
end
...
...
app/services/metrics/dashboard/system_dashboard_service.rb
View file @
4689bac8
...
...
@@ -20,7 +20,8 @@ module Metrics
[{
path:
SYSTEM_DASHBOARD_PATH
,
display_name:
SYSTEM_DASHBOARD_NAME
,
default:
true
default:
true
,
system_dashboard:
true
}]
end
...
...
changelogs/unreleased/35217-add_fields_to_all_dashboards.yml
0 → 100644
View file @
4689bac8
---
title
:
Add can_edit and project_blob_path to metrics_dashboard endpoint
merge_request
:
19663
author
:
type
:
added
config/routes/project.rb
View file @
4689bac8
...
...
@@ -666,7 +666,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
# Legacy routes.
# Introduced in 12.0.
# Should be removed
after 12.1
# Should be removed
with https://gitlab.com/gitlab-org/gitlab/issues/28848.
scope
(
path:
'*namespace_id'
,
as: :namespace
,
namespace_id:
Gitlab
::
PathRegex
.
full_namespace_route_regex
)
do
...
...
doc/administration/pages/index.md
View file @
4689bac8
...
...
@@ -271,7 +271,7 @@ sites served under a custom domain.
To enable it, you'll need to:
1.
Choose an email on which you will rec
ie
ve notifications about expiring domains.
1.
Choose an email on which you will rec
ei
ve notifications about expiring domains.
1.
Navigate to your instance's
**Admin Area > Settings > Preferences**
and expand
**Pages**
settings.
1.
Enter the email for receiving notifications and accept Let's Encrypt's Terms of Service as shown below.
1.
Click
**Save changes**
.
...
...
doc/user/permissions.md
View file @
4689bac8
...
...
@@ -168,7 +168,7 @@ the [documentation on Cycle Analytics permissions](analytics/cycle_analytics.md#
Developers and users with higher permission level can use all
the functionality of the Issue Board, that is create/delete lists
and drag issues around. Read though the
and drag issues around. Read th
r
ough the
[
documentation on Issue Boards permissions
](
project/issue_board.md#permissions
)
to learn more.
...
...
doc/user/project/operations/error_tracking.md
View file @
4689bac8
...
...
@@ -44,3 +44,14 @@ The Error Tracking list may be found at **Operations > Error Tracking** in your
Errors can be filtered by title.
![
Error Tracking list
](
img/error_tracking_list.png
)
## Error Details
From error list, users can navigate to the error details page by clicking the title of any error.
This page has:
-
A link to Sentry issue.
-
A full stack trace along with other details.
![
Error Details
](
img/error_details_v12_5.png
)
doc/user/project/operations/img/error_details_v12_5.png
0 → 100644
View file @
4689bac8
511 KB
spec/controllers/concerns/metrics_dashboard_spec.rb
View file @
4689bac8
...
...
@@ -3,9 +3,11 @@
require
'spec_helper'
describe
MetricsDashboard
do
include
MetricsDashboardHelpers
describe
'GET #metrics_dashboard'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
project_with_dashboard
(
'.gitlab/dashboards/test.yml'
)
}
let_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
before
do
...
...
@@ -63,6 +65,36 @@ describe MetricsDashboard do
expect
(
json_response
[
'dashboard'
][
'dashboard'
]).
to
eq
(
'Environment metrics'
)
expect
(
json_response
).
to
have_key
(
'all_dashboards'
)
end
context
'in all_dashboard list'
do
let
(
:system_dashboard
)
{
json_response
[
'all_dashboards'
].
find
{
|
dashboard
|
dashboard
[
"system_dashboard"
]
==
true
}
}
let
(
:project_dashboard
)
{
json_response
[
'all_dashboards'
].
find
{
|
dashboard
|
dashboard
[
"system_dashboard"
]
==
false
}
}
it
'includes project_blob_path only for project dashboards'
do
expect
(
system_dashboard
[
'project_blob_path'
]).
to
be_nil
expect
(
project_dashboard
[
'project_blob_path'
]).
to
eq
(
"/
#{
project
.
namespace
.
path
}
/
#{
project
.
name
}
/blob/master/.gitlab/dashboards/test.yml"
)
end
describe
'project permissions'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:can_collaborate
,
:system_can_edit
,
:project_can_edit
)
do
false
|
false
|
false
true
|
false
|
true
end
with_them
do
before
do
allow
(
controller
).
to
receive
(
:can_collaborate_with_project?
).
and_return
(
can_collaborate
)
end
it
"sets can_edit appropriately"
do
expect
(
system_dashboard
[
"can_edit"
]).
to
eq
(
system_can_edit
)
expect
(
project_dashboard
[
"can_edit"
]).
to
eq
(
project_can_edit
)
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/email/hook/smime_signature_interceptor_spec.rb
View file @
4689bac8
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
Email
::
Hook
::
SmimeSignatureInterceptor
do
...
...
spec/lib/gitlab/metrics/dashboard/finder_spec.rb
View file @
4689bac8
...
...
@@ -136,7 +136,7 @@ describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store_cachi
describe
'.find_all_paths'
do
let
(
:all_dashboard_paths
)
{
described_class
.
find_all_paths
(
project
)
}
let
(
:system_dashboard
)
{
{
path:
system_dashboard_path
,
display_name:
'Default'
,
default:
true
}
}
let
(
:system_dashboard
)
{
{
path:
system_dashboard_path
,
display_name:
'Default'
,
default:
true
,
system_dashboard:
true
}
}
it
'includes only the system dashboard by default'
do
expect
(
all_dashboard_paths
).
to
eq
([
system_dashboard
])
...
...
@@ -147,7 +147,7 @@ describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store_cachi
let
(
:project
)
{
project_with_dashboard
(
dashboard_path
)
}
it
'includes system and project dashboards'
do
project_dashboard
=
{
path:
dashboard_path
,
display_name:
'test.yml'
,
default:
false
}
project_dashboard
=
{
path:
dashboard_path
,
display_name:
'test.yml'
,
default:
false
,
system_dashboard:
false
}
expect
(
all_dashboard_paths
).
to
contain_exactly
(
system_dashboard
,
project_dashboard
)
end
...
...
spec/services/metrics/dashboard/project_dashboard_service_spec.rb
View file @
4689bac8
...
...
@@ -80,7 +80,8 @@ describe Metrics::Dashboard::ProjectDashboardService, :use_clean_rails_memory_st
[{
path:
dashboard_path
,
display_name:
'test.yml'
,
default:
false
default:
false
,
system_dashboard:
false
}]
)
end
...
...
spec/services/metrics/dashboard/system_dashboard_service_spec.rb
View file @
4689bac8
...
...
@@ -44,7 +44,8 @@ describe Metrics::Dashboard::SystemDashboardService, :use_clean_rails_memory_sto
[{
path:
described_class
::
SYSTEM_DASHBOARD_PATH
,
display_name:
described_class
::
SYSTEM_DASHBOARD_NAME
,
default:
true
default:
true
,
system_dashboard:
true
}]
)
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