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
67bfae0b
Commit
67bfae0b
authored
Aug 06, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5e7e505f
26087322
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
3 deletions
+52
-3
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+2
-3
app/models/list.rb
app/models/list.rb
+1
-0
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+6
-0
app/views/projects/_export.html.haml
app/views/projects/_export.html.haml
+1
-0
db/migrate/20190627100221_add_mr_productivity_metrics.rb
db/migrate/20190627100221_add_mr_productivity_metrics.rb
+14
-0
db/schema.rb
db/schema.rb
+6
-0
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+8
-0
spec/lib/gitlab/import_export/safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+6
-0
spec/models/merge_request_diff_spec.rb
spec/models/merge_request_diff_spec.rb
+8
-0
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
67bfae0b
...
...
@@ -194,10 +194,9 @@ module IssuableCollections
end
def
collection_type
@collection_type
||=
case
finder_type
.
name
when
'IssuesFinder'
@collection_type
||=
if
finder_type
<=
IssuesFinder
'Issue'
when
'MergeRequestsFinder'
elsif
finder_type
<=
MergeRequestsFinder
'MergeRequest'
end
end
...
...
app/models/list.rb
View file @
67bfae0b
...
...
@@ -6,6 +6,7 @@ class List < ApplicationRecord
belongs_to
:board
belongs_to
:label
include
Importable
enum
list_type:
{
backlog:
0
,
label:
1
,
closed:
2
,
assignee:
3
,
milestone:
4
}
...
...
app/models/merge_request_diff.rb
View file @
67bfae0b
...
...
@@ -196,6 +196,12 @@ class MergeRequestDiff < ApplicationRecord
real_size
.
presence
||
raw_diffs
.
size
end
def
lines_count
strong_memoize
(
:lines_count
)
do
diffs
.
diff_files
.
sum
(
&
:line_count
)
end
end
def
raw_diffs
(
options
=
{})
if
options
[
:ignore_whitespace_change
]
@diffs_no_whitespace
||=
compare
.
diffs
(
options
)
...
...
app/views/projects/_export.html.haml
View file @
67bfae0b
...
...
@@ -16,6 +16,7 @@
%li
=
_
(
'Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, and other project entities'
)
%li
=
_
(
'Issue Boards'
)
%li
=
_
(
'LFS objects'
)
%li
=
_
(
'Issue Boards'
)
%p
=
_
(
'The following items will NOT be exported:'
)
%ul
%li
=
_
(
'Job traces and artifacts'
)
...
...
db/migrate/20190627100221_add_mr_productivity_metrics.rb
0 → 100644
View file @
67bfae0b
# frozen_string_literal: true
class
AddMrProductivityMetrics
<
ActiveRecord
::
Migration
[
5.1
]
DOWNTIME
=
false
def
change
add_column
:merge_request_metrics
,
:first_comment_at
,
:datetime_with_timezone
add_column
:merge_request_metrics
,
:first_commit_at
,
:datetime_with_timezone
add_column
:merge_request_metrics
,
:last_commit_at
,
:datetime_with_timezone
add_column
:merge_request_metrics
,
:diff_size
,
:integer
add_column
:merge_request_metrics
,
:modified_paths_size
,
:integer
add_column
:merge_request_metrics
,
:commits_count
,
:integer
end
end
db/schema.rb
View file @
67bfae0b
...
...
@@ -1979,6 +1979,12 @@ ActiveRecord::Schema.define(version: 2019_08_02_012622) do
t
.
integer
"merged_by_id"
t
.
integer
"latest_closed_by_id"
t
.
datetime_with_timezone
"latest_closed_at"
t
.
datetime_with_timezone
"first_comment_at"
t
.
datetime_with_timezone
"first_commit_at"
t
.
datetime_with_timezone
"last_commit_at"
t
.
integer
"diff_size"
t
.
integer
"modified_paths_size"
t
.
integer
"commits_count"
t
.
index
[
"first_deployed_to_production_at"
],
name:
"index_merge_request_metrics_on_first_deployed_to_production_at"
t
.
index
[
"latest_closed_at"
],
name:
"index_merge_request_metrics_on_latest_closed_at"
,
where:
"(latest_closed_at IS NOT NULL)"
t
.
index
[
"latest_closed_by_id"
],
name:
"index_merge_request_metrics_on_latest_closed_by_id"
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
67bfae0b
...
...
@@ -167,6 +167,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect
(
GroupLabel
.
count
).
to
eq
(
0
)
end
it
'has issue boards'
do
expect
(
Project
.
find_by_path
(
'project'
).
boards
.
count
).
to
eq
(
1
)
end
it
'has lists associated with the issue board'
do
expect
(
Project
.
find_by_path
(
'project'
).
boards
.
find_by_name
(
'TestBoardABC'
).
lists
.
count
).
to
eq
(
3
)
end
it
'has a project feature'
do
expect
(
@project
.
project_feature
).
not_to
be_nil
end
...
...
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
67bfae0b
...
...
@@ -235,6 +235,12 @@ MergeRequest::Metrics:
-
latest_build_started_at
-
latest_build_finished_at
-
first_deployed_to_production_at
-
first_comment_at
-
first_commit_at
-
last_commit_at
-
diff_size
-
modified_paths_size
-
commits_count
Ci::Pipeline:
-
id
-
project_id
...
...
spec/models/merge_request_diff_spec.rb
View file @
67bfae0b
...
...
@@ -484,4 +484,12 @@ describe MergeRequestDiff do
end
end
end
describe
'#lines_count'
do
subject
{
diff_with_commits
}
it
'returns sum of all changed lines count in diff files'
do
expect
(
subject
.
lines_count
).
to
eq
109
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