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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
9d85ea3a
Commit
9d85ea3a
authored
Jan 25, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Organize event order execution when update issue or mr
parent
2b028525
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
8 deletions
+11
-8
app/services/issues/close_service.rb
app/services/issues/close_service.rb
+1
-1
app/services/issues/update_service.rb
app/services/issues/update_service.rb
+1
-1
app/services/merge_requests/auto_merge_service.rb
app/services/merge_requests/auto_merge_service.rb
+1
-1
app/services/merge_requests/close_service.rb
app/services/merge_requests/close_service.rb
+1
-1
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+1
-1
app/services/merge_requests/reopen_service.rb
app/services/merge_requests/reopen_service.rb
+1
-1
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+1
-1
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+1
-0
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+3
-1
No files found.
app/services/issues/close_service.rb
View file @
9d85ea3a
...
@@ -2,9 +2,9 @@ module Issues
...
@@ -2,9 +2,9 @@ module Issues
class
CloseService
<
Issues
::
BaseService
class
CloseService
<
Issues
::
BaseService
def
execute
(
issue
,
commit
=
nil
)
def
execute
(
issue
,
commit
=
nil
)
if
issue
.
close
if
issue
.
close
notification_service
.
close_issue
(
issue
,
current_user
)
event_service
.
close_issue
(
issue
,
current_user
)
event_service
.
close_issue
(
issue
,
current_user
)
create_note
(
issue
,
commit
)
create_note
(
issue
,
commit
)
notification_service
.
close_issue
(
issue
,
current_user
)
execute_hooks
(
issue
,
'close'
)
execute_hooks
(
issue
,
'close'
)
end
end
...
...
app/services/issues/update_service.rb
View file @
9d85ea3a
...
@@ -23,8 +23,8 @@ module Issues
...
@@ -23,8 +23,8 @@ module Issues
end
end
if
issue
.
previous_changes
.
include?
(
'assignee_id'
)
if
issue
.
previous_changes
.
include?
(
'assignee_id'
)
notification_service
.
reassigned_issue
(
issue
,
current_user
)
create_assignee_note
(
issue
)
create_assignee_note
(
issue
)
notification_service
.
reassigned_issue
(
issue
,
current_user
)
end
end
issue
.
notice_added_references
(
issue
.
project
,
current_user
)
issue
.
notice_added_references
(
issue
.
project
,
current_user
)
...
...
app/services/merge_requests/auto_merge_service.rb
View file @
9d85ea3a
...
@@ -11,9 +11,9 @@ module MergeRequests
...
@@ -11,9 +11,9 @@ module MergeRequests
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
current_user
,
merge_request
).
merge!
(
commit_message
)
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
current_user
,
merge_request
).
merge!
(
commit_message
)
merge_request
.
merge
merge_request
.
merge
notification_service
.
merge_mr
(
merge_request
,
current_user
)
create_merge_event
(
merge_request
,
current_user
)
create_merge_event
(
merge_request
,
current_user
)
create_note
(
merge_request
)
create_note
(
merge_request
)
notification_service
.
merge_mr
(
merge_request
,
current_user
)
execute_hooks
(
merge_request
)
execute_hooks
(
merge_request
)
true
true
...
...
app/services/merge_requests/close_service.rb
View file @
9d85ea3a
...
@@ -7,8 +7,8 @@ module MergeRequests
...
@@ -7,8 +7,8 @@ module MergeRequests
if
merge_request
.
close
if
merge_request
.
close
event_service
.
close_mr
(
merge_request
,
current_user
)
event_service
.
close_mr
(
merge_request
,
current_user
)
notification_service
.
close_mr
(
merge_request
,
current_user
)
create_note
(
merge_request
)
create_note
(
merge_request
)
notification_service
.
close_mr
(
merge_request
,
current_user
)
execute_hooks
(
merge_request
,
'close'
)
execute_hooks
(
merge_request
,
'close'
)
end
end
...
...
app/services/merge_requests/merge_service.rb
View file @
9d85ea3a
...
@@ -9,9 +9,9 @@ module MergeRequests
...
@@ -9,9 +9,9 @@ module MergeRequests
def
execute
(
merge_request
,
commit_message
)
def
execute
(
merge_request
,
commit_message
)
merge_request
.
merge
merge_request
.
merge
notification_service
.
merge_mr
(
merge_request
,
current_user
)
create_merge_event
(
merge_request
,
current_user
)
create_merge_event
(
merge_request
,
current_user
)
create_note
(
merge_request
)
create_note
(
merge_request
)
notification_service
.
merge_mr
(
merge_request
,
current_user
)
execute_hooks
(
merge_request
,
'merge'
)
execute_hooks
(
merge_request
,
'merge'
)
true
true
...
...
app/services/merge_requests/reopen_service.rb
View file @
9d85ea3a
...
@@ -3,8 +3,8 @@ module MergeRequests
...
@@ -3,8 +3,8 @@ module MergeRequests
def
execute
(
merge_request
)
def
execute
(
merge_request
)
if
merge_request
.
reopen
if
merge_request
.
reopen
event_service
.
reopen_mr
(
merge_request
,
current_user
)
event_service
.
reopen_mr
(
merge_request
,
current_user
)
notification_service
.
reopen_mr
(
merge_request
,
current_user
)
create_note
(
merge_request
)
create_note
(
merge_request
)
notification_service
.
reopen_mr
(
merge_request
,
current_user
)
execute_hooks
(
merge_request
,
'reopen'
)
execute_hooks
(
merge_request
,
'reopen'
)
merge_request
.
reload_code
merge_request
.
reload_code
merge_request
.
mark_as_unchecked
merge_request
.
mark_as_unchecked
...
...
app/services/merge_requests/update_service.rb
View file @
9d85ea3a
...
@@ -33,8 +33,8 @@ module MergeRequests
...
@@ -33,8 +33,8 @@ module MergeRequests
end
end
if
merge_request
.
previous_changes
.
include?
(
'assignee_id'
)
if
merge_request
.
previous_changes
.
include?
(
'assignee_id'
)
notification_service
.
reassigned_merge_request
(
merge_request
,
current_user
)
create_assignee_note
(
merge_request
)
create_assignee_note
(
merge_request
)
notification_service
.
reassigned_merge_request
(
merge_request
,
current_user
)
end
end
merge_request
.
notice_added_references
(
merge_request
.
project
,
current_user
)
merge_request
.
notice_added_references
(
merge_request
.
project
,
current_user
)
...
...
spec/services/issues/update_service_spec.rb
View file @
9d85ea3a
...
@@ -22,6 +22,7 @@ describe Issues::UpdateService do
...
@@ -22,6 +22,7 @@ describe Issues::UpdateService do
}
}
@issue
=
Issues
::
UpdateService
.
new
(
project
,
user
,
opts
).
execute
(
issue
)
@issue
=
Issues
::
UpdateService
.
new
(
project
,
user
,
opts
).
execute
(
issue
)
@issue
.
reload
end
end
it
{
@issue
.
should
be_valid
}
it
{
@issue
.
should
be_valid
}
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
9d85ea3a
...
@@ -21,12 +21,14 @@ describe MergeRequests::UpdateService do
...
@@ -21,12 +21,14 @@ describe MergeRequests::UpdateService do
state_event:
'close'
state_event:
'close'
}
}
end
end
let
(
:service
)
{
MergeRequests
::
UpdateService
.
new
(
project
,
user
,
opts
)
}
let
(
:service
)
{
MergeRequests
::
UpdateService
.
new
(
project
,
user
,
opts
)
}
before
do
before
do
service
.
stub
(
:execute_hooks
)
service
.
stub
(
:execute_hooks
)
@merge_request
=
service
.
execute
(
merge_request
)
@merge_request
=
service
.
execute
(
merge_request
)
@merge_request
.
reload
end
end
it
{
@merge_request
.
should
be_valid
}
it
{
@merge_request
.
should
be_valid
}
...
@@ -46,7 +48,7 @@ describe MergeRequests::UpdateService do
...
@@ -46,7 +48,7 @@ describe MergeRequests::UpdateService do
end
end
it
'should create system note about merge_request reassign'
do
it
'should create system note about merge_request reassign'
do
note
=
@merge_request
.
notes
.
last
note
=
@merge_request
.
notes
.
reload
.
last
note
.
note
.
should
include
"Reassigned to
\@
#{
user2
.
username
}
"
note
.
note
.
should
include
"Reassigned to
\@
#{
user2
.
username
}
"
end
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