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
b8e0ba1b
Commit
b8e0ba1b
authored
Aug 05, 2020
by
Magdalena Frankiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix URL of issues in VSA dashboard
Add changelog entry
parent
7b67520a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
changelogs/unreleased/bug-incorrect-issue-url-in-vsa.yml
changelogs/unreleased/bug-incorrect-issue-url-in-vsa.yml
+5
-0
lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
+2
-2
spec/serializers/analytics_issue_entity_spec.rb
spec/serializers/analytics_issue_entity_spec.rb
+21
-4
No files found.
changelogs/unreleased/bug-incorrect-issue-url-in-vsa.yml
0 → 100644
View file @
b8e0ba1b
---
title
:
Fix URLs of issues in VSA dashboard
merge_request
:
38703
author
:
type
:
fixed
lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
View file @
b8e0ba1b
...
...
@@ -13,7 +13,7 @@ module Gitlab
MAPPINGS
=
{
Issue
=>
{
serializer_class:
AnalyticsIssueSerializer
,
includes_for_query:
{
project:
[
:namespace
]
,
author:
[]
},
includes_for_query:
{
project:
{
namespace:
[
:route
]
}
,
author:
[]
},
columns_for_select:
%I[title iid id created_at author_id project_id]
},
MergeRequest
=>
{
...
...
@@ -41,7 +41,7 @@ module Gitlab
project
=
record
.
project
attributes
=
record
.
attributes
.
merge
({
project_path:
project
.
path
,
namespace_path:
project
.
namespace
.
path
,
namespace_path:
project
.
namespace
.
route
.
path
,
author:
record
.
author
})
serializer
.
represent
(
attributes
)
...
...
spec/serializers/analytics_issue_entity_spec.rb
View file @
b8e0ba1b
...
...
@@ -17,16 +17,13 @@ RSpec.describe AnalyticsIssueEntity do
}
end
let
(
:project
)
{
create
(
:project
,
name:
'my project'
)
}
let
(
:request
)
{
EntityRequest
.
new
(
entity: :merge_request
)
}
let
(
:entity
)
do
described_class
.
new
(
entity_hash
,
request:
request
,
project:
project
)
end
context
'generic entity'
do
subject
{
entity
.
as_json
}
shared_examples
'generic entity'
do
it
'contains the entity URL'
do
expect
(
subject
).
to
include
(
:url
)
end
...
...
@@ -40,4 +37,24 @@ RSpec.describe AnalyticsIssueEntity do
expect
(
subject
).
not_to
include
(
/variables/
)
end
end
context
'without subgroup'
do
let_it_be
(
:project
)
{
create
(
:project
,
name:
'my project'
)
}
subject
{
entity
.
as_json
}
it_behaves_like
'generic entity'
end
context
'with subgroup'
do
let_it_be
(
:project
)
{
create
(
:project
,
:in_subgroup
,
name:
'my project'
)
}
subject
{
entity
.
as_json
}
it_behaves_like
'generic entity'
it
'has URL containing subgroup'
do
expect
(
subject
[
:url
]).
to
include
(
"
#{
project
.
group
.
parent
.
name
}
/
#{
project
.
group
.
name
}
/my_project/"
)
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