Commit Graph

30 Commits

Author SHA1 Message Date
Lin Jen-Shin 1f5d55907a Merge the places where exceptions could be raised 2016-05-24 01:23:07 +08:00
Lin Jen-Shin 863d8e5ae5 use split and try to unify error raising 2016-05-23 22:16:40 +08:00
Lin Jen-Shin 75415663f8 Rename handlers and introduce Handler.for 2016-05-21 09:40:08 -07:00
Lin Jen-Shin ee548b6ed0 Only set @raw for receiver, and handle the rest in execute 2016-05-20 19:03:39 -05:00
Lin Jen-Shin 32eae15f2f It's for Message-ID so it should be message_id 2016-05-20 18:23:04 -05:00
Lin Jen-Shin c337e748d3 so we use separate classes to handle different tasks 2016-05-18 17:25:45 -05:00
Lin Jen-Shin 3f4a6412dc We should totally cache it 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 8156475ea5 Report better errors. TODO: Enable skipped test 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 30b3443779 Now we would be validating authentication token 2016-05-16 21:27:16 +00:00
Lin Jen-Shin a065c8d5d8 Create a new issue via: incoming+group/project+AUTH_TOKEN@... 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 634c9f403b process_reply -> process_create_note; handle_reply -> process_reply 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 869de96eea bang to indicate that this method could raise an exception 2016-05-16 21:27:16 +00:00
Lin Jen-Shin aac297adba Update style as create_note 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 68b5ded056 No need to check project because:
sent_notification.project would never be nil, and
we also have already checked message_project before
entering process_create_issue.
2016-05-16 21:27:16 +00:00
Lin Jen-Shin 87ff0107c1 Raise one by one instead of if checks 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 347ee6cc91 Alloy empty reply for new issues, but not response 2016-05-16 21:27:16 +00:00
Lin Jen-Shin a61bf17fce Try to give better names 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 0e4c2b6ec4 enable Style/MethodDefParentheses and fix parentheses 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 4f5027042a Add another TODO that we need to verify identity better 2016-05-16 21:27:16 +00:00
Lin Jen-Shin 6cfd028278 Implement #3243 New Issue by email
So we extend Gitlab::Email::Receiver for this new behaviour,
however we might want to split it into another class for better
testing it.

Another issue is that, currently it's using this to parse project
identifier:

    Gitlab::IncomingEmail.key_from_address

Which is using:

    Gitlab.config.incoming_email.address

for the receiver name. This is probably `reply` because it's used
for replying to a specific issue. We might want to introduce another
config for this, or just use `reply` instead of `incoming`.

I'll prefer to introduce a new config for this, or just change
`reply` to `incoming` because it would make sense for replying to
there, too.

The email template used in tests were copied and modified from:
`emails/valid_reply.eml` which I hope is ok.
2016-05-16 21:27:16 +00:00
Rémy Coutable 9f218fc184 Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature
A few things to note:
- The IncomingEmail feature is now enabled even without a
  correctly-formatted sub-address
- Message-ID for new thread mail are kept the same so that subsequent
  notifications to this thread are grouped in the thread by the email
  service that receives the notification
  (i.e. In-Reply-To of the answer == Message-ID of the first thread message)
- To maximize our chance to be able to retrieve the reply key, we look
  for it in the In-Reply-To header and the References header
- The pattern for the fallback reply message id is "reply-[key]@[gitlab_host]"
- Improve docs thanks to Axil
2016-03-25 13:05:15 +01:00
David Padilla 31e76baf61 Fix #2364. Fall back to In-Reply-To header when reply key not available 2016-03-25 13:05:15 +01:00
Lin Jen-Shin 9374b7eb0b Avoid using the same name between methods and variables 2016-03-23 20:05:31 +08:00
Douwe Maan 1886d727f7 Add API project upload endpoint 2016-01-07 13:37:14 +01:00
Douwe Maan ee028d9d60 Rename reply_by_email to incoming_email to prepare for the future. 2015-09-21 10:35:37 +02:00
Douwe Maan 69708dab9f Block blocked users from replying to threads by email. 2015-08-21 10:14:45 -07:00
Douwe Maan 8ec5fb138d Test Gitlab::Email::Receiver. 2015-08-20 12:17:59 -07:00
Douwe Maan 2f78b5e8af Make error class names more consistent. 2015-08-20 11:33:18 -07:00
Douwe Maan 0b401f2e94 Fix a couple of whoopsy daisies. 2015-08-20 11:17:14 -07:00
Douwe Maan e9972efc2f Extract ReplyParser and AttachmentUploader from Receiver. 2015-08-20 11:05:06 -07:00