BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bfedbefd
Commit
bfedbefd
authored
Mar 21, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging for bulk update recipients
This is only needed to debug
https://gitlab.com/gitlab-org/gitlab-ce/issues/28836
parent
9d96367f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
bulk_update_service.rb
app/services/issuable/bulk_update_service.rb
+6
-0
notification_service.rb
app/services/notification_service.rb
+18
-0
No files found.
app/services/issuable/bulk_update_service.rb
View file @
bfedbefd
...
...
@@ -7,6 +7,9 @@ module Issuable
ids
=
params
.
delete
(
:issuable_ids
).
split
(
","
)
items
=
model_class
.
where
(
id:
ids
)
# https://gitlab.com/gitlab-org/gitlab-ce/issues/28836
Rails
.
logger
.
info
(
"BulkUpdateService received created for type:
#{
type
}
with IDs:
#{
ids
.
inspect
}
and params:
#{
params
.
inspect
}
"
)
%i(state_event milestone_id assignee_id add_label_ids remove_label_ids subscription_event)
.
each
do
|
key
|
params
.
delete
(
key
)
unless
params
[
key
].
present?
end
...
...
@@ -14,6 +17,9 @@ module Issuable
items
.
each
do
|
issuable
|
next
unless
can?
(
current_user
,
:"update_
#{
type
}
"
,
issuable
)
# https://gitlab.com/gitlab-org/gitlab-ce/issues/28836
Rails
.
logger
.
info
(
"BulkUpdateService created
#{
update_class
}
for
#{
issuable
.
to_reference
(
full:
true
)
}
with params:
#{
params
.
inspect
}
"
)
update_class
.
new
(
issuable
.
project
,
current_user
,
params
).
execute
(
issuable
)
end
...
...
app/services/notification_service.rb
View file @
bfedbefd
...
...
@@ -595,17 +595,28 @@ class NotificationService
end
end
# https://gitlab.com/gitlab-org/gitlab-ce/issues/28836
def
log_recipients
(
target
,
recipients
,
stage
)
Rails
.
logger
.
info
(
"NotificationService recipients for
#{
target
.
class
}
#{
target
.
id
}
were
#{
recipients
.
compact
.
map
(
&
:id
).
sort
.
inspect
}
at
#{
stage
}
"
)
rescue
=>
e
Rails
.
logger
.
info
(
"NotificationService failed to log with params
#{
[
target
,
recipients
,
stage
]
}
:
#{
e
.
message
}
"
)
end
def
build_recipients
(
target
,
project
,
current_user
,
action:
nil
,
previous_assignee:
nil
,
skip_current_user:
true
)
custom_action
=
build_custom_key
(
action
,
target
)
recipients
=
target
.
participants
(
current_user
)
log_recipients
(
target
,
recipients
,
'add participants'
)
unless
NotificationSetting
::
EXCLUDED_WATCHER_EVENTS
.
include?
(
custom_action
)
recipients
=
add_project_watchers
(
recipients
,
project
)
log_recipients
(
target
,
recipients
,
'add project watchers'
)
end
recipients
=
add_custom_notifications
(
recipients
,
project
,
custom_action
)
log_recipients
(
target
,
recipients
,
'add custom notifications'
)
recipients
=
reject_mention_users
(
recipients
,
project
)
log_recipients
(
target
,
recipients
,
'reject mention users'
)
recipients
=
recipients
.
uniq
...
...
@@ -617,15 +628,22 @@ class NotificationService
recipients
<<
target
.
assignee
end
log_recipients
(
target
,
recipients
,
'add previous and current assignees'
)
recipients
=
reject_muted_users
(
recipients
,
project
)
log_recipients
(
target
,
recipients
,
'reject muted users'
)
recipients
=
add_subscribed_users
(
recipients
,
project
,
target
)
log_recipients
(
target
,
recipients
,
'add subscribed users'
)
if
[
:new_issue
,
:new_merge_request
].
include?
(
custom_action
)
recipients
=
add_labels_subscribers
(
recipients
,
project
,
target
)
log_recipients
(
target
,
recipients
,
'add label subscribers'
)
end
recipients
=
reject_unsubscribed_users
(
recipients
,
target
)
log_recipients
(
target
,
recipients
,
'reject unsubscribed users'
)
recipients
=
reject_users_without_access
(
recipients
,
target
)
log_recipients
(
target
,
recipients
,
'reject users without access'
)
recipients
.
delete
(
current_user
)
if
skip_current_user
...
...
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