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
4119206f
Commit
4119206f
authored
Sep 05, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix export performance of CI builds
parent
be99f824
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
app/models/ci/build.rb
app/models/ci/build.rb
+4
-0
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+1
-0
lib/gitlab/import_export/reader.rb
lib/gitlab/import_export/reader.rb
+1
-3
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+11
-8
No files found.
app/models/ci/build.rb
View file @
4119206f
...
...
@@ -451,6 +451,10 @@ module Ci
trace
end
def
serializable_hash
(
options
=
{})
super
(
options
.
merge
(
when:
read_attribute
(
:when
)))
end
private
def
update_artifacts_size
...
...
lib/gitlab/import_export/import_export.yml
View file @
4119206f
...
...
@@ -116,6 +116,7 @@ excluded_attributes:
statuses
:
-
:trace
-
:token
-
:when
push_event_payload
:
-
:event_id
...
...
lib/gitlab/import_export/reader.rb
View file @
4119206f
...
...
@@ -18,9 +18,7 @@ module Gitlab
attributes
=
@attributes_finder
.
find
(
:project
)
project_attributes
=
attributes
.
is_a?
(
Hash
)
?
attributes
[
:project
]
:
{}
build_hash
(
@tree
).
each
do
|
sub_hash
|
yield
(
project_attributes
.
merge
(
include:
sub_hash
))
end
project_attributes
.
merge
(
include:
build_hash
(
@tree
))
rescue
=>
e
@shared
.
error
(
e
)
false
...
...
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
View file @
4119206f
...
...
@@ -117,6 +117,13 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
expect
(
saved_project_json
[
'pipelines'
].
first
[
'statuses'
].
count
{
|
hash
|
hash
[
'type'
]
==
'Ci::Build'
}).
to
eq
(
1
)
end
it
'builds do not call the attributes for retrieving when'
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ci_yaml_file
).
and_return
(
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
)))
expect_any_instance_of
(
Ci
::
GitlabCiYamlProcessor
).
not_to
receive
(
:build_attributes
)
saved_project_json
end
it
'has pipeline commits'
do
expect
(
saved_project_json
[
'pipelines'
]).
not_to
be_empty
end
...
...
@@ -251,15 +258,11 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
create
(
:label_priority
,
label:
group_label
,
priority:
1
)
milestone
=
create
(
:milestone
,
project:
project
)
merge_request
=
create
(
:merge_request
,
source_project:
project
,
milestone:
milestone
)
commit_status
=
create
(
:commit_status
,
project:
project
)
ci_pipeline
=
create
(
:ci_pipeline
,
project:
project
,
sha:
merge_request
.
diff_head_sha
,
ref:
merge_request
.
source_branch
,
statuses:
[
commit_status
])
ci_build
=
create
(
:ci_build
,
project:
project
,
when:
nil
)
ci_build
.
pipeline
.
update
(
project:
project
)
commit_status
=
create
(
:commit_status
,
project:
project
,
pipeline:
ci_build
.
pipeline
)
create
(
:ci_build
,
pipeline:
ci_pipeline
,
project:
project
)
create
(
:milestone
,
project:
project
)
create
(
:note
,
noteable:
issue
,
project:
project
)
create
(
:note
,
noteable:
merge_request
,
project:
project
)
...
...
@@ -267,7 +270,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
ci_pipeline
.
sha
)
commit_id:
ci_
build
.
pipeline
.
sha
)
create
(
:event
,
:created
,
target:
milestone
,
project:
project
,
author:
user
)
create
(
:service
,
project:
project
,
type:
'CustomIssueTrackerService'
,
category:
'issue_tracker'
)
...
...
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