Commit Graph

53 Commits

Author SHA1 Message Date
Pawel Chojnacki c3a940000e Handles unsubscribe from notifications via email
- allows unsubscription processing of email in format "reply+%{key}+unsubscribe@acme.com" (example)
- if config.address includes %{key} and replies are enabled every unsubscriable message will include mailto: link in its List-Unsubscribe header
2017-01-13 10:11:46 -05:00
http://jneen.net/ f02f238d52 Revert "allow empty-quotes"
This reverts commit 4f2f678aff8d7dfcac96c47cf7eb480a5707ddaf.
2016-12-21 09:51:42 -08:00
http://jneen.net/ 602c319862 allow empty-quotes 2016-12-21 09:51:41 -08:00
http://jneen.net/ 03753ff146 remove trailing whitespace from email bodies 2016-12-21 09:51:41 -08:00
http://jneen.net/ a3bb2463c4 switch to email_reply_trimmer from discourse 2016-12-21 09:51:39 -08:00
http://jneen.net/ 1734124433 fix rubocop failures 2016-11-17 11:59:44 +09:00
http://jneen.net/ f7b0692912 add parsing support for incoming html email 2016-11-17 11:59:44 +09:00
tiagonbotelho 011e561bfa implements reset incoming email token on issues modal and account page,
reactivates all tests and writes more tests for it
2016-11-07 15:56:18 +00:00
Douwe Maan 9d51421346 Use separate email-friendly token for incoming email and let incoming
email token be reset
2016-11-07 15:55:42 +00:00
Lin Jen-Shin a4ef4244d4 Preserve note_type and position for notes from emails
Closes #23208
2016-10-20 16:18:53 +08:00
Douwe Maan 97dddf39cd Disable “issue by email” feature until it uses a different token 2016-08-19 19:49:12 -05:00
Rémy Coutable f393f2dde0
Simplify the slash commands DSL to store action blocks instead of creating methods
Other improvements:
- Ensure slash commands autocomplete doesn't break when noteable_type is not given
- Slash commands: improve autocomplete behavior and /due command
- We don't display slash commands for note edit forms.
- Add tests for reply by email with slash commands
- Be sure to execute slash commands after the note creation in Notes::CreateService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:36:47 +02:00
Rémy Coutable 39f7f63fe9 Add the /title slash command
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 0eea8c8857 Support slash commands in noteable description and notes
Some important things to note:

- commands are removed from noteable.description / note.note
- commands are translated to params so that they are treated as normal
  params in noteable Creation services
- the logic is not in the models but in the Creation services, which is
  the right place for advanced logic that has nothing to do with what
  models should be responsible of!
- UI/JS needs to be updated to handle notes which consist of commands
  only
- the `/merge` command is not handled yet

Other improvements:

- Don't process commands in commit notes and display a flash is note is only commands
- Add autocomplete for slash commands
- Add description and params to slash command DSL methods
- Ensure replying by email with a commands-only note works
- Use :subscription_event instead of calling noteable.subscribe
- Support :todo_event in IssuableBaseService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:05:57 +02:00
Paco Guzman 1d0c7b7492 Introduce Compare model in the codebase.
This object will manage Gitlab::Git::Compare instances
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Lin Jen-Shin b04f95a2ed Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master: (620 commits)
  Added '*.js.es6 gitlab-language=javascript' to .gitattributes
  Fix CI status icon link underline
  Update CHANGELOG after 8.10.1
  Add CHANGELOG
  Add es6 gem
  Instrument Nokogiri parsing methods
  Fix backup restore
  Use project ID in repository cache to prevent stale data from persisting across projects
  Add iid to MR API response
  `WikiPage` should have a slug even when not persisted.
  ES6ify all the things!
  Make fork counter always clickable (!5463)
  Revert "Merge branch '17073-tagscontroller-index-is-terrible-response-time-goes-up-to-5-…"
  Fix CHANGELOG
  Add spec for dashes in paths
  Fix Error 500 when creating Wiki pages with hyphens or spaces
  Add links to the real markdown.md file for all GFM examples
  Remove magic comments from Ruby files (!5456)
  Ignore invalid trusted proxies in X-Forwarded-For header
  remove search_id for label dropdown filter
  ...
2016-07-26 14:51:52 +08:00
Rémy Coutable 356b2d2bd7 Get rid of `is_image` in FileUploader
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00
Lin Jen-Shin 176fa21cb7 raise UnknownIncomingEmail when there's no mail_key:
So that we don't have to pretend that CreateNoteHandler
could handle a nil mail_key. Also, since NilClass#=~ would
just return nil for any regular expression, we could just
match it without checking nilness.

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3363#note_12566407
2016-06-20 19:15:54 +08:00
Lin Jen-Shin 4befcc353d Add missing require in tests 2016-06-15 17:59:44 +08:00
Lin Jen-Shin e75391889e Merge branch 'master' into new-issue-by-email
* master: (1246 commits)
  Update CHANGELOG
  Update tests to make it work with Turbolinks approach
  Use Turbolink instead of ajax
  Reinitialize checkboxes to toggle event bindings
  Turn off handlers before binding events
  Removed console.log Uses outerWidth instead of width
  Revert "Added API endpoint for Sidekiq Metrics"
  Added API endpoint for Sidekiq Metrics
  Added CHANGELOG entry for allocations Gem/name fix
  Filter out classes without names in the sampler
  Update the allocations Gem to 1.0.5
  Put all sidebar icons in fixed width container
  Instrument private/protected methods
  Fix Ci::Build#artifacts_expire_in= when assigning invalid duration
  Fix grammar and syntax
  Update CI API docs
  UI and copywriting improvements
  Factorize members mails into a new Emails::Members module
  Factorize access request routes into a new :access_requestable route concern
  Factorize #request_access and #approve_access_request  into a new AccessRequestActions controller concern
  ...
2016-06-15 15:43:12 +08:00
Lin Jen-Shin 8c0b619d40 Split tests into their own classes 2016-05-24 17:30:36 +08:00
Lin Jen-Shin 1f5d55907a Merge the places where exceptions could be raised 2016-05-24 01:23:07 +08:00
Lin Jen-Shin c2bc15a766 Use the authentication_token for finding the user 2016-05-20 17:38:08 -05:00
Lin Jen-Shin 9436a444f3 Rename reply_key to mail_key 2016-05-20 13:05:57 -05:00
Lin Jen-Shin 4b341dea55 Actually there's no such case 2016-05-20 12:52:53 -05:00
Lin Jen-Shin a7c823a573 Give ProjectNotFound when the project is not readable 2016-05-18 17:57:14 -05:00
Lin Jen-Shin c337e748d3 so we use separate classes to handle different tasks 2016-05-18 17:25:45 -05:00
Sean McGivern a9977f2b7a Syntax-highlight diffs in push emails
Based on:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/151
2016-05-17 13:23:17 +01:00
Lin Jen-Shin 8156475ea5 Report better errors. TODO: Enable skipped test 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 347ee6cc91 Alloy empty reply for new issues, but not response 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
Lin Jen-Shin 2375b437bd Fix a typo 2016-05-16 21:27:16 +00:00
Sean McGivern 5f27e26bb4 Only generate repository push email once
The repository push email can be very expensive to generate, especially
with syntax-highlighted diffs. Instead of generating the email for each
recipient, generate one email object and reset the Message-Id and To
headers for each recipient. (Cloning would also be expensive in the case
of large emails, although probably not as bad as generating from
scratch.)
2016-05-11 09:16:01 +01: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
Jacob Vosmaer 1764e1b7cb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
Douwe Maan 1e927d39b4 Update spec 2016-01-07 15:51:12 +01:00
Douwe Maan 50f8366a89 Merge branch 'complexity/rubocop-metrics' into 'master'
Enable rubocop metrics

This enables rubocop metrics like CyclomaticComplexity and ABCSize.
Initial threshold values are high, should be probably decreased.

See merge request !1802
2015-12-11 15:06:31 +00:00
Douwe Maan 13d6bab177 Tag lib specs 2015-12-09 11:55:42 +01:00
Grzegorz Bizon 75c6b29f6b Add `RepositoryPush` specs 2015-12-08 08:43:09 +01:00
Valery Sizov 8f584d5f2c Fix: Images cannot show when projects' path was changed 2015-10-14 18:50:35 +03: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 15fc7bd613 No HTML-only email please 2015-08-21 16:09:55 -07:00
Douwe Maan 69708dab9f Block blocked users from replying to threads by email. 2015-08-21 10:14:45 -07:00
Douwe Maan 48e25a019a Add stub_reply_by_email_setting helper. 2015-08-20 13:21:22 -07:00
Douwe Maan 6110e175dc Use heredocs. 2015-08-20 13:10:55 -07:00
Douwe Maan 54b04f1c5b Add fixture_file helper. 2015-08-20 12:41:47 -07:00
Douwe Maan 2b5a2b8f39 Removed unused fixtures. 2015-08-20 12:29:03 -07:00