Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries
### What does this MR do?
This MR gracefully handles SMTP input errors (e.g. incorrect or invalid e-mail addresses) to prevent these types of exceptions from causing Sidekiq to retry the task. If these specific exceptions occur, they will be logged, and the e-mail will be dropped from the queue.
### Why was this MR needed?
If you include an author that has a misspelled e-mail address, Sidekiq will keep sending e-mail to all the recipients even if they have already received the e-mail. The only way to recover is to clear the Sidekiq queue.
Note that other exceptions can still be thrown (e.g. `IOError`, `Net::SMTPAuthenticationError`, `Net::SMTPServerBusy`, `Net::SMTPUnknownError`, and `TimeoutError`). If the worker encounters these, Sidekiq should retry the task.
### What are the relevant issue numbers?
Closes https://github.com/gitlabhq/gitlabhq/issues/9560
See merge request !1163
and request them each session. Pass these tokens to the project import data.
This prevents the need to encrypt these tokens and clear them in case they
expire or get revoked.
For example, if you deleted and re-created OAuth2 keys for Bitbucket, you would get
an Error 500 with no way to recover:
```
Started GET "/import/bitbucket/status" for x.x.x.x at 2015-08-07 05:24:10 +0000
Processing by Import::BitbucketController#status as HTML
Completed 500 Internal Server Error in 607ms (ActiveRecord: 2.3ms)
NameError (uninitialized constant Import::BitbucketController::Unauthorized):
app/controllers/import/bitbucket_controller.rb:77:in `rescue in go_to_bitbucket_for_permissions'
app/controllers/import/bitbucket_controller.rb:74:in `go_to_bitbucket_for_permissions'
app/controllers/import/bitbucket_controller.rb:86:in `bitbucket_unauthorized'
```
Closes#1871
I also revamped the tests on "closing reference commits" (= "Fixes #xxxx" for example).
Now, there are two different contexts:
- when the commits with "closing reference" are pushed to the default branch,
- when the commits with "closing reference" are pushed to a non-default branch.
Closesgitlab-org/gitlab-ce#2190.
Fix bug preventing invite by e-mail
This was broken in 70f5291808 as a result of introducing the ability to filter by current user.
Closes#2320
See merge request !1181
Adding in ability to check status of automatic branch jobs in jenkins
The current documentation for integrating Jenkins and Gitlab EE indicates that the Gitlab Hook Plugin should be used. When you use that plugin you can set up Jenkins to automatically create new jobs for the branches used in merge requests. The CI Status check for Jenkins does not currently handle those automatic jobs. The result of this is shows an error checking the status on all Merge Requests. This merge request is a small change to the jenkins_service to utilize the ref param being passed in and appending the branch name if not master to the project url which will allow the status checks to succeed.
See merge request !9
Make the `provider` argument for the LDAP group links API endpoint required
Related to #329
If no `provider` is passed to the API endpoint, the group link is not created properly. Making it required fixes the issue temporarily. It should default to the first provider.
Next step, as mentioned in #329, is to do that.
/cc @job
See merge request !475