diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-28 19:46:23 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-28 19:46:23 +0300 |
commit | 4a2320a7b002ca97a238d020ede44db1bac2ffd1 (patch) | |
tree | e14d0a2c4171dd6b4e308a69fe7835790c14faa4 /app/models | |
parent | b24ccd4a67f60731ce2eb6be0129e8cf7228263d (diff) | |
parent | 9370bb231bf7a294d94c2fb62faf482627a0ae7a (diff) |
Merge branch 'new-issue-by-email' into 'master'
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.
/cc @DouweM #3243
See merge request !3363
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index cbfa14e81f1..aac78d75f57 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -331,7 +331,7 @@ module Ci end def valid_token?(token) - project.valid_runners_token? token + project.valid_runners_token?(token) end def has_tags? diff --git a/app/models/project.rb b/app/models/project.rb index b3703d71e72..e2bf5f3a3fb 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -605,6 +605,13 @@ class Project < ActiveRecord::Base web_url.split('://')[1] end + def new_issue_address(author) + if Gitlab::IncomingEmail.enabled? && author + Gitlab::IncomingEmail.reply_address( + "#{path_with_namespace}+#{author.authentication_token}") + end + end + def build_commit_note(commit) notes.new(commit_id: commit.id, noteable_type: 'Commit') end |