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
3f5f10cb
Commit
3f5f10cb
authored
Apr 21, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make handler metric params more explicit
parent
9f162b91
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
5 deletions
+21
-5
lib/gitlab/email/handler/base_handler.rb
lib/gitlab/email/handler/base_handler.rb
+4
-0
lib/gitlab/email/handler/create_issue_handler.rb
lib/gitlab/email/handler/create_issue_handler.rb
+4
-1
lib/gitlab/email/handler/create_note_handler.rb
lib/gitlab/email/handler/create_note_handler.rb
+4
-0
lib/gitlab/email/handler/ee/service_desk_handler.rb
lib/gitlab/email/handler/ee/service_desk_handler.rb
+4
-0
lib/gitlab/email/handler/unsubscribe_handler.rb
lib/gitlab/email/handler/unsubscribe_handler.rb
+4
-0
lib/gitlab/email/receiver.rb
lib/gitlab/email/receiver.rb
+1
-4
No files found.
lib/gitlab/email/handler/base_handler.rb
View file @
3f5f10cb
...
@@ -16,6 +16,10 @@ module Gitlab
...
@@ -16,6 +16,10 @@ module Gitlab
def
execute
def
execute
raise
NotImplementedError
raise
NotImplementedError
end
end
def
metrics_params
{
handler:
self
.
class
.
name
}
end
end
end
end
end
end
end
...
...
lib/gitlab/email/handler/create_issue_handler.rb
View file @
3f5f10cb
require
'gitlab/email/handler/base_handler'
require
'gitlab/email/handler/base_handler'
module
Gitlab
module
Gitlab
...
@@ -37,6 +36,10 @@ module Gitlab
...
@@ -37,6 +36,10 @@ module Gitlab
@project
||=
Project
.
find_by_full_path
(
project_path
)
@project
||=
Project
.
find_by_full_path
(
project_path
)
end
end
def
metrics_params
super
.
merge
(
project:
project
)
end
private
private
def
create_issue
def
create_issue
...
...
lib/gitlab/email/handler/create_note_handler.rb
View file @
3f5f10cb
...
@@ -28,6 +28,10 @@ module Gitlab
...
@@ -28,6 +28,10 @@ module Gitlab
record_name:
'comment'
)
record_name:
'comment'
)
end
end
def
metrics_params
super
.
merge
(
project:
project
)
end
private
private
def
author
def
author
...
...
lib/gitlab/email/handler/ee/service_desk_handler.rb
View file @
3f5f10cb
...
@@ -16,6 +16,10 @@ module Gitlab
...
@@ -16,6 +16,10 @@ module Gitlab
send_thank_you_email!
if
from_address
send_thank_you_email!
if
from_address
end
end
def
metrics_params
super
.
merge
(
project:
project
)
end
private
private
def
service_desk_key
def
service_desk_key
...
...
lib/gitlab/email/handler/unsubscribe_handler.rb
View file @
3f5f10cb
...
@@ -19,6 +19,10 @@ module Gitlab
...
@@ -19,6 +19,10 @@ module Gitlab
noteable
.
unsubscribe
(
sent_notification
.
recipient
)
noteable
.
unsubscribe
(
sent_notification
.
recipient
)
end
end
def
metrics_params
super
.
merge
(
project:
project
)
end
private
private
def
sent_notification
def
sent_notification
...
...
lib/gitlab/email/receiver.rb
View file @
3f5f10cb
require_dependency
'gitlab/email/handler'
require_dependency
'gitlab/email/handler'
# Inspired in great part by Discourse's Email::Receiver
# Inspired in great part by Discourse's Email::Receiver
...
@@ -32,9 +31,7 @@ module Gitlab
...
@@ -32,9 +31,7 @@ module Gitlab
raise
UnknownIncomingEmail
unless
handler
raise
UnknownIncomingEmail
unless
handler
Gitlab
::
Metrics
.
add_event
(
:receive_email
,
Gitlab
::
Metrics
.
add_event
(
:receive_email
,
handler
.
metrics_params
)
project:
handler
.
try
(
:project
),
handler:
handler
.
class
.
name
)
handler
.
execute
handler
.
execute
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