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
cc9e92a0
Commit
cc9e92a0
authored
Apr 20, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add-email-receiver-metrics' into 'master'
Add email receiver metrics See merge request !10814
parents
d5835016
19970e1d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
add-email-receiver-metrics.yml
changelogs/unreleased/add-email-receiver-metrics.yml
+4
-0
create_note_handler.rb
lib/gitlab/email/handler/create_note_handler.rb
+2
-4
unsubscribe_handler.rb
lib/gitlab/email/handler/unsubscribe_handler.rb
+2
-0
receiver.rb
lib/gitlab/email/receiver.rb
+4
-0
No files found.
changelogs/unreleased/add-email-receiver-metrics.yml
0 → 100644
View file @
cc9e92a0
---
title
:
Add metrics events for incoming emails
merge_request
:
author
:
lib/gitlab/email/handler/create_note_handler.rb
View file @
cc9e92a0
...
...
@@ -7,6 +7,8 @@ module Gitlab
class
CreateNoteHandler
<
BaseHandler
include
ReplyProcessing
delegate
:project
,
to: :sent_notification
,
allow_nil:
true
def
can_handle?
mail_key
=~
/\A\w+\z/
end
...
...
@@ -32,10 +34,6 @@ module Gitlab
sent_notification
.
recipient
end
def
project
sent_notification
.
project
end
def
sent_notification
@sent_notification
||=
SentNotification
.
for
(
mail_key
)
end
...
...
lib/gitlab/email/handler/unsubscribe_handler.rb
View file @
cc9e92a0
...
...
@@ -4,6 +4,8 @@ module Gitlab
module
Email
module
Handler
class
UnsubscribeHandler
<
BaseHandler
delegate
:project
,
to: :sent_notification
,
allow_nil:
true
def
can_handle?
mail_key
=~
/\A\w+
#{
Regexp
.
escape
(
Gitlab
::
IncomingEmail
::
UNSUBSCRIBE_SUFFIX
)
}
\z/
end
...
...
lib/gitlab/email/receiver.rb
View file @
cc9e92a0
...
...
@@ -32,6 +32,10 @@ module Gitlab
raise
UnknownIncomingEmail
unless
handler
Gitlab
::
Metrics
.
add_event
(
:receive_email
,
project:
handler
.
try
(
:project
),
handler:
handler
.
class
.
name
)
handler
.
execute
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