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
828b475c
Commit
828b475c
authored
Feb 25, 2022
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Fetch issue and mr comments in parallel threads
parent
f4d7de21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb
...cs/features/api/1_manage/import_large_github_repo_spec.rb
+8
-8
No files found.
qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb
View file @
828b475c
...
...
@@ -363,7 +363,7 @@ module QA
imported_mrs
=
imported_project
.
merge_requests
(
auto_paginate:
true
,
attempts:
2
)
logger
.
debug
(
"= Fetching merge request comments ="
)
imported_mrs
.
each_with_object
({})
do
|
mr
,
mrs_with_comments
|
Parallel
.
map
(
imported_mrs
,
in_threads:
4
)
do
|
mr
|
resource
=
Resource
::
MergeRequest
.
init
do
|
resource
|
resource
.
project
=
imported_project
resource
.
iid
=
mr
[
:iid
]
...
...
@@ -371,7 +371,7 @@ module QA
end
logger
.
debug
(
"Fetching comments for mr '
#{
mr
[
:title
]
}
'"
)
mrs_with_comments
[
mr
[
:iid
]]
=
{
[
mr
[
:iid
],
{
url:
mr
[
:web_url
],
title:
mr
[
:title
],
body:
sanitize_description
(
mr
[
:description
])
||
''
,
...
...
@@ -380,8 +380,8 @@ module QA
# remove system notes
.
reject
{
|
c
|
c
[
:system
]
||
c
[
:body
].
match?
(
/^(\*\*Review:\*\*)|(\*Merged by:).*/
)
}
.
map
{
|
c
|
sanitize_comment
(
c
[
:body
])
}
}
end
}
]
end
.
to_h
end
end
...
...
@@ -394,7 +394,7 @@ module QA
imported_issues
=
imported_project
.
issues
(
auto_paginate:
true
,
attempts:
2
)
logger
.
debug
(
"= Fetching issue comments ="
)
imported_issues
.
each_with_object
({})
do
|
issue
,
issues_with_comments
|
Parallel
.
map
(
imported_issues
,
in_threads:
4
)
do
|
issue
|
resource
=
Resource
::
Issue
.
init
do
|
issue_resource
|
issue_resource
.
project
=
imported_project
issue_resource
.
iid
=
issue
[
:iid
]
...
...
@@ -402,15 +402,15 @@ module QA
end
logger
.
debug
(
"Fetching comments for issue '
#{
issue
[
:title
]
}
'"
)
issues_with_comments
[
issue
[
:iid
]]
=
{
[
issue
[
:iid
],
{
url:
issue
[
:web_url
],
title:
issue
[
:title
],
body:
sanitize_description
(
issue
[
:description
])
||
''
,
comments:
resource
.
comments
(
auto_paginate:
true
,
attempts:
2
)
.
map
{
|
c
|
sanitize_comment
(
c
[
:body
])
}
}
end
}
]
end
.
to_h
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