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
17881606
Commit
17881606
authored
Feb 01, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reload MRs memoization after diffs creation
parent
5b73e0eb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+6
-1
changelogs/unreleased/osw-system-notes-for-commits-regression.yml
...gs/unreleased/osw-system-notes-for-commits-regression.yml
+5
-0
spec/services/merge_requests/refresh_service_spec.rb
spec/services/merge_requests/refresh_service_spec.rb
+8
-0
No files found.
app/services/merge_requests/refresh_service.rb
View file @
17881606
...
@@ -90,6 +90,10 @@ module MergeRequests
...
@@ -90,6 +90,10 @@ module MergeRequests
merge_request
.
mark_as_unchecked
merge_request
.
mark_as_unchecked
UpdateHeadPipelineForMergeRequestWorker
.
perform_async
(
merge_request
.
id
)
UpdateHeadPipelineForMergeRequestWorker
.
perform_async
(
merge_request
.
id
)
end
end
# Upcoming method calls need the refreshed version of
# @source_merge_requests diffs (for MergeRequest#commit_shas for instance).
merge_requests_for_source_branch
(
reload:
true
)
end
end
def
reset_merge_when_pipeline_succeeds
def
reset_merge_when_pipeline_succeeds
...
@@ -195,7 +199,8 @@ module MergeRequests
...
@@ -195,7 +199,8 @@ module MergeRequests
merge_requests
.
uniq
.
select
(
&
:source_project
)
merge_requests
.
uniq
.
select
(
&
:source_project
)
end
end
def
merge_requests_for_source_branch
def
merge_requests_for_source_branch
(
reload:
false
)
@source_merge_requests
=
nil
if
reload
@source_merge_requests
||=
merge_requests_for
(
@branch_name
)
@source_merge_requests
||=
merge_requests_for
(
@branch_name
)
end
end
...
...
changelogs/unreleased/osw-system-notes-for-commits-regression.yml
0 → 100644
View file @
17881606
---
title
:
Reload MRs memoization after diffs creation
merge_request
:
author
:
type
:
fixed
spec/services/merge_requests/refresh_service_spec.rb
View file @
17881606
...
@@ -74,6 +74,14 @@ describe MergeRequests::RefreshService do
...
@@ -74,6 +74,14 @@ describe MergeRequests::RefreshService do
expect
(
@fork_build_failed_todo
).
to
be_done
expect
(
@fork_build_failed_todo
).
to
be_done
end
end
it
'reloads source branch MRs memoization'
do
refresh_service
.
execute
(
@oldrev
,
@newrev
,
'refs/heads/master'
)
expect
{
refresh_service
.
execute
(
@oldrev
,
@newrev
,
'refs/heads/master'
)
}.
to
change
{
refresh_service
.
instance_variable_get
(
"@source_merge_requests"
).
first
.
merge_request_diff
}
end
context
'when source branch ref does not exists'
do
context
'when source branch ref does not exists'
do
before
do
before
do
DeleteBranchService
.
new
(
@project
,
@user
).
execute
(
@merge_request
.
source_branch
)
DeleteBranchService
.
new
(
@project
,
@user
).
execute
(
@merge_request
.
source_branch
)
...
...
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