Commit Graph

73 Commits

Author SHA1 Message Date
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11: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 b2e0f609b4 Clean test path between merge request handler tests
create_merge_request_handler_spec needs a repository for some tests but
this repository lasts on disk by default which causes failures of other
tests. TestEnv.clean_test_path is used to get rid of the repository
after each test.

Closes #40900
2017-12-07 20:20:41 +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
Gabriel Mazetto 8f178c4222 Prevent new / renamed project from using a repository path that already exists on disk
There are some redundancies in the validation steps, and that is to
preserve current error messages behavior

Also few specs have to be changed in order to fix madness in validation
logic.
2017-08-25 20:06:06 +02:00
Sean McGivern 27d34789c9 Merge branch '28472-ignore-auto-generated-mails' into 'master'
Don't send rejection mails for all auto-generated mails

Closes #28472

See merge request !13254
2017-08-03 12:41:16 +00:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04: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
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
http://jneen.net/ d866c7763c add a spec for no-href link parsing 2017-06-19 14:24:19 -07:00
Eric Eastwood ea090291bb Rename "Slash commands" to "Quick actions"
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27070

Deprecate "chat commands" in favor of "slash commands"

We looked for things like:

 - `slash commmand`
 - `slash_command`
 - `slash-command`
 - `SlashCommand`
2017-06-15 09:01:56 -05: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
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
Douwe Maan 79889a6aa3
Add specs 2017-04-05 17:44:14 +01: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
Robert Speicher 80a6d2fda2 Use `:empty_project` where possible throughout spec/lib 2017-01-25 12:25:42 -05: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/ 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