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
f3b033c7
Commit
f3b033c7
authored
Apr 12, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract fallback update routine to pvt method
parent
04122f32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
23 deletions
+19
-23
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+16
-16
ee/app/services/ee/merge_requests/update_service.rb
ee/app/services/ee/merge_requests/update_service.rb
+3
-7
No files found.
app/services/merge_requests/update_service.rb
View file @
f3b033c7
...
...
@@ -11,22 +11,7 @@ module MergeRequests
end
def
execute
(
merge_request
)
updated_merge_request
=
update_merge_request_with_specialized_service
(
merge_request
)
return
updated_merge_request
unless
updated_merge_request
.
nil?
# We don't allow change of source/target projects and source branch
# after merge request was created
params
.
delete
(
:source_project_id
)
params
.
delete
(
:target_project_id
)
params
.
delete
(
:source_branch
)
if
merge_request
.
closed_or_merged_without_fork?
params
.
delete
(
:target_branch
)
params
.
delete
(
:force_remove_source_branch
)
end
update_task_event
(
merge_request
)
||
update
(
merge_request
)
update_merge_request_with_specialized_service
(
merge_request
)
||
general_fallback
(
merge_request
)
end
def
handle_changes
(
merge_request
,
options
)
...
...
@@ -90,6 +75,21 @@ module MergeRequests
attr_reader
:target_branch_was_deleted
def
general_fallback
(
merge_request
)
# We don't allow change of source/target projects and source branch
# after merge request was created
params
.
delete
(
:source_project_id
)
params
.
delete
(
:target_project_id
)
params
.
delete
(
:source_branch
)
if
merge_request
.
closed_or_merged_without_fork?
params
.
delete
(
:target_branch
)
params
.
delete
(
:force_remove_source_branch
)
end
update_task_event
(
merge_request
)
||
update
(
merge_request
)
end
def
track_title_and_desc_edits
(
changed_fields
)
tracked_fields
=
%w(title description)
...
...
ee/app/services/ee/merge_requests/update_service.rb
View file @
f3b033c7
...
...
@@ -5,12 +5,10 @@ module EE
module
UpdateService
extend
::
Gitlab
::
Utils
::
Override
override
:execute
def
execute
(
merge_request
)
updated_merge_request
=
update_merge_request_with_specialized_service
(
merge_request
)
return
updated_merge_request
unless
updated_merge_request
.
nil?
private
override
:general_fallback
def
general_fallback
(
merge_request
)
unless
update_task_event?
old_approvers
=
merge_request
.
overall_approvers
(
exclude_code_owners:
true
)
end
...
...
@@ -37,8 +35,6 @@ module EE
merge_request
end
private
override
:after_update
def
after_update
(
merge_request
)
super
...
...
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