Commit Graph

29 Commits

Author SHA1 Message Date
Dmitriy Zaporozhets 9b6224f99c
More test fixes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-03 12:05:21 +03:00
Marin Jankovski f4f0a7e03e Add a failing test. 2014-04-01 17:18:52 +02:00
Dmitriy Zaporozhets 72b13cc1be Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2014-03-25 09:04:22 +02:00
Dmitriy Zaporozhets 3d8ecbc94f Merge branch 'no-emails-for-mentions' into 'master'
Don't send an email for "mentioned in" notes

Currently, an email is sent every time a mentionable is referenced by an issue, a commit or a merge request: if I comment "This MR is related to #5", the watchers get one email for the comment, and another one stating "Issue #5 was mentioned by issue #13".

This is annoying — but the biggest issue is when pushing an existing branch. Every issue referenced by commit messages in this branch will get a new mention (which is fine), and dozens of emails will be sent for all these new mentions (which is not).

This commit fixes the spam by avoiding to send an email when a new mention is added to an existing mentionable. In most cases the email notification sent by the mentioner is enough.
2014-03-24 18:52:41 +00:00
Pierre de La Morinerie 65f5496e02 Fix the merge notification email not being sent
The 'author_id_of_changes' attribute is not persisted in the database.
As we retrieve the merge request from the DB just before sending the
email, this attribute was always nil.

Also there was no tests for the merge notification code - tests have
been added.

Fix #6605
2014-03-24 15:11:35 +01:00
Pierre de La Morinerie 5818cf063b Don't send an email for "mentioned in" notes
Currently, an email is sent every time a mentionable is referenced
by an issue, a commit or a merge request: if I comment "This MR is
related to #5", watchers get one email for the comment, and another
one stating "Issue #5 was mentioned by issue #13".

This is annoying — but the biggest issue is when pushing an existing
branch. Every issue referenced by commit messages in this branch will
get a new mention (which is fine), and dozens of emails will be sent
for all these new mentions (which is not).

This commit fixes the spam by avoiding to send an email when a new
mention is created. In most cases the email notification for the
mentioner is enough.
2014-02-24 15:34:56 +01:00
Pierre de La Morinerie 96dded3ec8 Send emails from the author
This changes the email "From" field from "gitlab@example.com" to either:

* "John Doe <gitlab@example.com>" if the author of the action is known,
* "GitLab <gitlab@example.com>" otherwise.

Rationale: this allow mails to appear as if they were sent by the
author. It appears in the mailbox more like a real discussion between
the sender and the receiver ("John sent: we should refactor this") and
less like a robot notifying about something.
2014-02-19 18:25:18 +01:00
Jason Hollingsworth 29cfd33d94 Add email aliases for users
Emails are used to associate commits with users. The emails
are not verified and don't have to be valid email addresses. They
are assigned on a first come, first serve basis.

Notifications are sent when an email is added.
2014-02-13 22:59:39 -06:00
Dmitriy Zaporozhets 2e7abbd66c
Move repo rename email to notification service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-15 14:03:52 +02:00
Jakub Zienkiewicz 996d146cbd test if commit author receives new note notifications 2013-09-13 15:38:30 +02:00
Dmitriy Zaporozhets 2388ca0f32 Revert notification specs 2013-08-08 17:42:27 +03:00
Dmitriy Zaporozhets 4537623d12 Merge branch 'master' into karlhungus-mr-on-fork
Conflicts:
	app/contexts/filter_context.rb
	app/contexts/search_context.rb
	app/models/merge_request.rb
	app/models/note.rb
	app/views/shared/_merge_requests.html.haml
	spec/controllers/commit_controller_spec.rb
	spec/services/notification_service_spec.rb
2013-08-08 12:22:09 +03:00
Javier Castro 669ada924b Fix test case for notification_service 2013-07-30 08:52:46 -03:00
Javier Castro cb877b7e6f Fix notifications to handle participants and mentions on commits too 2013-07-24 17:04:51 -03:00
Izaak Alpert 09112dbb1d Rebase on master
Trying to retrigger travis
Change-Id: Ifd86fb4c6b2791ad176230254fbf69a9ade979fb
2013-07-17 22:45:03 -04:00
Izaak Alpert 216d5e2c1a Fix intermittently failing notification_service test
Change-Id: Ic23cb46901f8adc77943bf3cc79566587364e22a
2013-07-17 22:42:51 -04:00
Izaak Alpert 3d7194f011 Merge Request on forked projects
The good:

 - You can do a merge request for a forked commit and it will merge properly (i.e. it does work).
 - Push events take into account merge requests on forked projects
 - Tests around merge_actions now present, spinach, and other rspec tests
 - Satellites now clean themselves up rather then recreate

The questionable:

 - Events only know about target projects
 - Project's merge requests only hold on to MR's where they are the target
 - All operations performed in the satellite

The bad:

  -  Duplication between project's repositories and satellites (e.g. commits_between)

(for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos)

Fixes:

Make test repos/satellites only create when needed
-Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap)
-project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually
-fixed remote removal
-How to merge renders properly
-Update emails to show project/branches
-Edit MR doesn't set target branch
-Fix some failures on editing/creating merge requests, added a test
-Added back a test around merge request observer
-Clean up project_transfer_spec, Remove duplicate enable/disable observers
-Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well
-Signifant speed ups for tests
-Update formatting ordering in notes_on_merge_requests
-Remove wiki schema update
Fixes for search/search results
-Search results was using by_project for a list of projects, updated this to use in_projects
-updated search results to reference the correct (target) project
-udpated search results to print both sides of the merge request

Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-07-17 22:41:30 -04:00
Javier Castro cf35d19c2e Show participants on issues, including mentions, and notify email to all participants 2013-06-24 11:55:44 -03:00
Dmitriy Zaporozhets 7786fe7ca8 Fixing specs & spinach since Wiki model does not exists any more 2013-04-10 23:48:40 +03:00
Dmitriy Zaporozhets 70947fedda inslude author & assignee to note notification recipients 2013-03-28 14:51:25 +02:00
Dmitriy Zaporozhets 618249734b rebuild notification on notes logic 2013-03-28 14:39:59 +02:00
Dmitriy Zaporozhets c04120c1c5 Improve notification service tests 2013-03-28 12:24:04 +02:00
Dmitriy Zaporozhets f49a2ac0df Add close issue/mr methods to Notify. Refactored Notificationservice 2013-03-28 12:14:53 +02:00
Dmitriy Zaporozhets 9e616459e0 add watchers to email recipients list. Add emails for close/merge MR 2013-03-28 11:59:06 +02:00
Dmitriy Zaporozhets 38ffb8220c use NotificationService for handle notify logic when MR created 2013-03-26 17:16:06 +02:00
Dmitriy Zaporozhets da1cf5b9e7 enable callbacks for specs after notification 2013-03-26 15:16:06 +02:00
Dmitriy Zaporozhets c7bd99b040 refactor issue observer spec 2013-03-26 14:41:57 +02:00
Dmitriy Zaporozhets e3e8b9fcb9 fixed tests 2013-03-26 11:17:49 +02:00
Dmitriy Zaporozhets cf6d4dc10c NotificationService for resolving email notification logic 2013-03-26 10:48:06 +02:00