Commit Graph

143 Commits

Author SHA1 Message Date
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Sean McGivern b07ca92f2e Remove requires from email handlers 2018-09-03 10:33:48 +01:00
Sean McGivern 55465747aa Add frozen_string_literal: true to email handlers 2018-09-03 10:33:48 +01:00
Sean McGivern 74616ece28 Extract EE-specific lines from Gitlab::Email::Handler 2018-09-03 10:33:48 +01:00
Felipe Artur Cardozo 236ed1f2f3 Merge branch 'security-event-counters-private-data' into 'master'
[master] Don't expose project names in various counters

See merge request gitlab/gitlabhq!2418
2018-07-24 20:25:25 +00:00
Grzegorz Bizon dce9599ef5 Implement action mailer delivery metrics observer 2018-07-16 13:40:55 +02:00
Grzegorz Bizon e682d94180 Move existing email interceptors into the same module 2018-07-16 11:23:15 +02:00
Yorick Peterse 9e29408ee6
Don't expose project names in various counters
Various counters would expose either project names, or full project
paths (e.g. "gitlab-org/gitlab-ce"). This commit changes various places
where we use "add_event" so we no longer expose (potentially) private
information.
2018-06-21 16:56:40 +02:00
Cameron Crockett 421dbb1746 skip email trim when email is creating new issue
Updates from MR discussion

1. Added test for ReplyParser
2. Changed param to trim_reply with default set as true

Removed keyword param in favor of normal options param

updates for MR discussion

Resolutions for code review comments

more code review fixes
2018-05-22 23:05:51 -05:00
Mario de la Ossa 02741ca4c5
Backport 5480-epic-notifications from EE 2018-05-07 12:58:47 -06:00
Bob Van Landuyt 71ccfde322 Correct permissions for creating merge requests from issues
This could only be possible for users that can create merge requests
within a project.

So they need to be a allowed to create a branch and create a merge request.
2018-04-11 10:51:17 +02:00
Riccardo Padovani f68aab1945 Make email handler clearer 2018-04-09 09:39:03 +00:00
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Jan Provaznik b39b5524f2 Use message body for merge request description
When a merge request is created from email, use message body
as merge request description. If message body is empty then
merge request description is still created from the source
branch commit (if there is only single commit in the merge
request).

If message body is empty and there are multiple commits in
the source branch, then merge request description is left empty.

Closes #40968
2017-12-11 11:46:21 +01:00
Jan Provaznik 8cce70730c Create merge request from email
* new merge request can be created by sending an email to the specific
email address (similar to creating issues by email)
* for the first iteration, source branch must be specified in the mail
subject, other merge request parameters can not be set yet
* user should enable "Receive notifications about your own activity" in
user settings to receive a notification about created merge request

Part of #32878
2017-12-05 08:41:58 +01:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Lin Jen-Shin 86e1f41b83 Check against "Auto-Submitted: no" instead
This would be much more accurate. We assume this is an
auto-generated email if such header is provided, and
the value is not "no". It could also be: "auto-generated",
"auto-replied", or other values from extension. It seems
that only "no" could mean that this is sent by a human.

See: https://tools.ietf.org/html/rfc3834
2017-08-03 19:29:18 +08:00
Lin Jen-Shin f097e4dbcd Don't send rejection mails for all auto-generated mails
Also make it easier to have mailer helper
2017-08-03 00:40:10 +08:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Douwe Maan c81928cfa7 Include new URL helpers retroactively into includers of Gitlab::Routing 2017-07-07 10:43:37 -05:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
http://jneen.net/ ef39fb0b54 unwrap all links with no href 2017-06-19 14:24:26 -07:00
Douwe Maan aed0387f97 Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
Sean McGivern 7af4c0c4f7 Fix email receiver metrics events
`Project#inspect` isn't very useful for examining usage of these features.
2017-05-05 10:37:54 +01:00
Sean McGivern ba608dc0f2 Merge branch '12910-uploader-pers-snippet' into 'master'
Prepare uploaders for personal snippets comments

See merge request !11022
2017-05-04 10:47:10 +00:00
Sean McGivern eb490365b5 Handle incoming emails from aliases correctly
These set the 'actual' destination email in one of the Delivered-To lines, so
check those too.
2017-05-03 20:51:10 +01:00
Jarka Kadlecova 43ff738641 Support uploaders for personal snippets comments 2017-05-02 15:22:24 +02:00
Sean McGivern 08b1380ff7 Don't blow up when email has no References header
If an email doesn't match our incoming email patterns on the To header, we fall
back to the References header. If there was no References header, we'd raise an
exception, when we'd be better off acting as if it was empty.
2017-05-01 14:25:04 +01:00
Sean McGivern 0bb31e54d1 Make handler metric params more explicit 2017-04-21 16:11:21 +01:00
Sean McGivern 19970e1dba Store projects in metrics for email replies 2017-04-20 13:19:16 +01:00
Sean McGivern 57edc23385 Add metrics events for incoming emails
This lets us track how many incoming emails a GitLab instance is processing, by
email type (handler) and by project (where applicable).
2017-04-20 11:32:10 +01:00
Luke "Jared" Bennett b70d828f83
Merge branch 'master' into new-resolvable-discussion 2017-04-07 16:12:59 +01:00
Felipe Artur 60c121ebc2 Backport permissions and multi-line array to CE 2017-04-07 10:53:29 +01:00
Douwe Maan 79889a6aa3
Add specs 2017-04-05 17:44:14 +01:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01:00
Sean McGivern 811e598f60 Enable and autocorrect the CustomErrorClass cop 2017-03-01 15:28:10 +00:00
Douwe Maan 5c7f9d69e3 Fix code for cops 2017-02-23 09:31:57 -06:00
Douwe Maan 8a4d68c53e Enable Style/ConditionalAssignment 2017-02-23 09:31:57 -06:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Rémy Coutable 6a1b3ef73f Merge branch 'zj-drop-ruby-21-tests' into 'master'
Update Rubocop to Ruby 2.3

See merge request !8994
2017-02-13 10:22:38 +00:00
Z.J. van de Weg 128b1eae09 Update Rubocop to ruby 2.3 2017-02-07 15:16:46 +01:00
Sean McGivern e6f5177b75 Merge branch 'fix-references-header-parsing' into 'master'
Fix References header parser for Microsoft Exchange

Closes #26567

See merge request !8620
2017-02-06 19:33:21 +00:00
Lin Jen-Shin 849d09cfd6 Use references variable
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8620#note_22020035
2017-02-03 17:30:54 +08:00
Lin Jen-Shin 0786894473 Merge remote-tracking branch 'upstream/master' into fix-references-header-parsing
* upstream/master: (574 commits)
  remove dateFormat global exception
  fix relative paths to xterm.js within fit.js
  use setFixtures instead of fixture.set
  prevent u2f tests from triggering a form submission while testing
  simplify test for focus state
  preload projects.json fixture
  preload projects.json fixture
  rework tests which rely on teaspoon-specific behavior
  Only render hr when user can't archive project.
  use setFixtures instead of fixture.set
  ensure helper classes and constants are exposed globally
  preload projects.json fixture
  fix fixture references in environments_spec
  allow console.xxx in tests, reorder eslint rules alphabetically
  remove redundant "data-toggle" attribute so Vue doesn't complain
  fix broken reference to formatDate in a CommonJS environment
  fix errors within gl_dropdown_spec.js when running in Karma
  fix intermittant errors in merge_commit_message_toggle_spec.rb
  Update installation docs to include Docker, others
  ignore node_modules in rubocop
  ...
2017-02-03 17:16:21 +08:00
Adam Pahlevi a0586dbc16 replace `find_with_namespace` with `find_by_full_path`
add complete changelog for !8949
2017-02-03 07:14:04 +07:00
Lin Jen-Shin 7fcbe37df3 Specify that iOS app would also do this 2017-01-20 20:20:40 +08:00
Lin Jen-Shin d15b7db121 Fix References header parser for Microsoft Exchange
Microsoft Exchange would append a comma and another
message id into the References header, therefore we'll
need to fallback and parse the header by ourselves.

Closes #26567
2017-01-20 20:19:22 +08:00
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/ 7218daaa96 fix guard style 2016-12-22 00:10:35 -08:00