Commit Graph

410 Commits

Author SHA1 Message Date
Douwe Maan 10387f6b8a Merge branch 'master' into tmp-reference-pipeline-and-caching
# Conflicts:
#	spec/lib/gitlab/markdown/autolink_filter_spec.rb
#	spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/cross_project_reference_spec.rb
#	spec/lib/gitlab/markdown/emoji_filter_spec.rb
#	spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/external_link_filter_spec.rb
#	spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/label_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/redactor_filter_spec.rb
#	spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb
#	spec/lib/gitlab/markdown/relative_link_filter_spec.rb
#	spec/lib/gitlab/markdown/sanitization_filter_spec.rb
#	spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
#	spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb
#	spec/lib/gitlab/markdown/task_list_filter_spec.rb
#	spec/lib/gitlab/markdown/upload_link_filter_spec.rb
#	spec/lib/gitlab/markdown/user_reference_filter_spec.rb
2015-12-10 14:04:34 +01:00
Douwe Maan 13d6bab177 Tag lib specs 2015-12-09 11:55:42 +01:00
Robert Speicher bcd89a58e7 Merge branch 'reference-pipeline-and-caching' into 'master'
Implement different Markdown rendering pipelines and cache Markdown

Builds on !1090. 

Related to !1014.

Fixes #2054.

See merge request !1602
2015-12-08 20:22:23 +00:00
Drew Blessing bf5683f889 Block LDAP user when they are no longer found in the LDAP server 2015-12-08 11:15:30 -06:00
Douwe Maan 926c3bef9f Merge branch 'master' into reference-pipeline-and-caching 2015-12-08 13:40:32 +01:00
Grzegorz Bizon 75c6b29f6b Add `RepositoryPush` specs 2015-12-08 08:43:09 +01:00
Robert Speicher 611912fe68 Store the demodulized reference filter name in data attribute 2015-12-07 19:40:46 -05:00
Valery Sizov bd5fb1b479 Merge branch 'webhook_payload_with_changes' into 'master'
Add added, modified and removed properties to commit object in webhook

https://gitlab.com/gitlab-org/gitlab-ee/issues/20

See merge request !1988
2015-12-07 14:43:13 +00:00
Douwe Maan d611a38798 Merge branch 'master' into reference-pipeline-and-caching 2015-12-07 14:48:53 +01:00
Valery Sizov 5c1b49f494 Add added, modified and removed properties to commit object in webhook 2015-12-04 16:23:21 +02:00
Douwe Maan f905fd239c Use URL helpers in specs 2015-12-03 14:00:09 +01:00
Douwe Maan 044e0e33dc Allow invalid URLs in closing pattern 2015-12-02 18:48:39 +01:00
Douwe Maan 60828ab40e Merge branch 'master' into link-refs 2015-12-02 12:12:03 +01:00
Douwe Maan 2955ca613b Merge branch 'master' into reference-pipeline-and-caching 2015-12-02 11:20:51 +01:00
Douwe Maan 9aac53bcee Satisfy Rubocop 2015-12-02 10:54:24 +01:00
Douwe Maan d4030a845e Pick up direct links to issues/MRs as references. 2015-12-01 16:53:07 +01:00
Douwe Maan f3ea06eb7f Autolink first so we don't pick up numeric anchors as issue references. 2015-12-01 15:53:32 +01:00
Douwe Maan 62c14ba2ed Render commit reference using short sha, but include full sha in comment. 2015-12-01 12:58:45 +01:00
Douwe Maan 4a0ebccf6b Fix specs 2015-11-30 22:43:54 +01:00
Douwe Maan bf5e7252ee Recognize commit range with named refs in compare URLs. 2015-11-30 21:36:35 +01:00
Douwe Maan d6a5b45c8e Recognize issue/MR/snippet/commit links as references. 2015-11-30 21:36:34 +01:00
Douwe Maan a7be01cd07 Render commit range reference with short shas, link to full shas. 2015-11-30 21:10:52 +01:00
Valery Sizov e92ceb7b57 fix specs 2015-11-30 16:12:31 +02:00
Yorick Peterse 97f8c6279f Added total query time to Sherlock
This makes it easier to see if a problem is caused by slow queries or
slow Ruby code (unrelated to any SQL queries that might be used).
2015-11-24 10:57:21 +01:00
Marin Jankovski 899807f604 Update required version of lfs client and separate the docs for users and admins. 2015-11-20 16:10:08 +01:00
Marin Jankovski dbc0be1b27 Error 501 when client is using deprecated API. 2015-11-20 12:45:30 +01:00
Kamil Trzcinski b8d8292bef Fix upload tests, reformat code and make rubocop happy 2015-11-20 12:21:41 +01:00
Kamil Trzcinski 14d95b0529 Part of tests done [ci skip] 2015-11-20 11:59:32 +01:00
Kamil Trzcinski 888821f9ff Add support for batch download operation 2015-11-19 19:28:14 +01:00
Douwe Maan e1e67d383e Move Markdown filters and pipelines into folders. 2015-11-19 16:18:13 +01:00
Douwe Maan f5a630111f Merge branch 'master' into reference-pipeline-and-caching 2015-11-19 15:46:04 +01:00
Yorick Peterse 9eefae6917 Fix UNION syntax for MySQL
Apparently MySQL doesn't support this syntax:

    (...) UNION (...)

instead it only supports:

    ...
    UNION
    ...
2015-11-18 13:31:18 +01:00
Yorick Peterse d769596aec Added Gitlab::SQL::Union class
This class can be used to join multiple AcitveRecord::Relation objects
together using a SQL UNION statement. ActiveRecord < 5.0 sadly doesn't
support UNION and existing Gems out there don't handle prepared
statements (e.g. they never incremented the variable bindings).
2015-11-18 13:02:43 +01:00
Marin Jankovski 14032d8eb1 Add support for git lfs. 2015-11-16 12:39:13 +01:00
Dmitriy Zaporozhets 3c16fb93fc
Move spec to proper place and fix unused variable
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-13 09:45:21 +01:00
Yorick Peterse 7b5fd8742e Track the amount of times views are rendered 2015-11-09 14:29:10 +01:00
Yorick Peterse db46d49c0e Fixed Hash key style in Sherlock::Query spec 2015-11-09 14:29:10 +01:00
Yorick Peterse 265ef867ff Added specs and source documentation for Sherlock 2015-11-09 14:29:10 +01:00
Valery Sizov 9479496f75 Add added, modified and removed properties to commit object in webhook 2015-11-03 12:16:40 +02:00
Douwe Maan 329e067ff1 Merge branch 'rs-dev-issue-2613' into 'master'
Add custom protocol whitelisting to SanitizationFilter

Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2613

We allow any protocol for autolinks: irc://irc.freenode.net/git

But manual Markdown links with the same protocol get sanitized: `[This will not be clickable](irc://irc.freenode.net/git)`: [This will not be clickable](irc://irc.freenode.net/git)

To get around this we have to first allow *all* protocols, and then manually clean dangerous (i.e., `javascript:`) protocols.

See merge request !1496
2015-11-02 10:49:46 +00:00
Douwe Maan 740feeec77 Merge branch 'master' into reference-pipeline-and-caching 2015-10-27 15:06:40 +01:00
Douwe Maan b6f8d0100e Merge branch 'dirceu/gitlab-ce-fix-project-search-with-unmatched-parentheses' 2015-10-25 11:55:14 +01:00
Stan Hu 69e5e260b0 Add spec for cloning Wiki over HTTP 2015-10-22 14:16:37 -07:00
Douwe Maan 46025ffb8c Fix specs 2015-10-22 15:40:42 +02:00
Dirceu Pereira Tiegs d7bcfe4fc0 Fix issue #3055 (project search with unmatched parentheses) 2015-10-21 10:20:40 -02:00
Douwe Maan 95f0440a78 Merge branch 'master' into rs-redactor-filter 2015-10-15 11:26:58 +02:00
Douwe Maan 539de0dd81 Merge branch 'master' into rs-redactor-filter 2015-10-14 20:23:36 +02:00
Douwe Maan b093cb35d1 Use Gitlab::Markdown for Asciidoc and ReferenceExtractor pipelines 2015-10-14 20:18:49 +02:00
Valery Sizov 8f584d5f2c Fix: Images cannot show when projects' path was changed 2015-10-14 18:50:35 +03:00
Douwe Maan 61d8f96176 Fix specs 2015-10-14 13:46:17 +02:00
Douwe Maan 93fcddd7a7 Allow ReferenceExtractor to efficiently load references from multiple texts at once 2015-10-13 22:53:05 +02:00
Robert Speicher 42603af326 Merge branch 'fix_email_downcasing' into 'master'
LDAP email address downcasing

Fixes #2960

In the event we cannot match an LDAP user by DN we attempt to find an identity by email address and then update the DN. In this case the identity is matched by email address. 

If the user's email address in LDAP has an upper case character we cannot find a match in the GitLab database. GitLab downcases emails before the user object is saved.

This merge request downcases the email from LDAP before we lookup by email. I also added a test to prevent a regression.

See merge request !1550
2015-10-11 22:53:11 +00:00
Robert Speicher 69b41ba043 Normalize space-like characters in keys before output to gitlab-shell
gitlab-shell expects only one tab separator per key, and an SSH key with
a tab character in the comment, for example, would break things.

Closes #2970
2015-10-08 20:34:50 -04:00
Drew Blessing b7def88c02 Fix ldap email downcasing bug 2015-10-08 14:59:46 -05:00
Yorick Peterse 85c6a3743a Added methods for detecting MySQL/PostgreSQL
These two methods remove the need for manually going into
ActiveRecord::Base.connection all over the place.
2015-10-07 23:32:14 +02:00
Douwe Maan 72afcbcd37 Always allow references to the current project 2015-10-07 19:19:23 +02:00
Douwe Maan f42cfa9e87 Refactor reference gathering to use a dedicated filter 2015-10-07 17:00:48 +02:00
Douwe Maan 4f629dab2a Merge branch 'master' into rs-redactor-filter 2015-10-07 15:15:35 +02:00
Guilherme Garnier aed145a9c6 Fix rubocop warnings in spec/lib and spec/tasks 2015-10-03 16:02:21 -05:00
Robert Speicher 16f8ca566b Add custom protocol whitelisting to SanitizationFilter
Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2613
2015-10-01 23:40:29 -04:00
Kamil Trzcinski 04c4445ae0 Test grace auth against gitlab_ci_project with token 2015-09-24 20:19:27 +02:00
Robert Speicher ce19e1739e Update stub syntax 2015-09-24 14:12:25 -04:00
Kamil Trzcinski 5d69bc656a Fix grack auth spec 2015-09-24 17:47:57 +02:00
Douwe Maan 73a3df4de3 Fix LDAP attribute mapping 2015-09-23 16:37:59 +02:00
Robert Speicher d4acda1253 Merge branch 'rs-relative-link-up-one' into 'master'
Allow relative links to go up one directory level

See merge request !1352
2015-09-21 19:38:37 +00:00
Douwe Maan ee028d9d60 Rename reply_by_email to incoming_email to prepare for the future. 2015-09-21 10:35:37 +02:00
Robert Speicher 2b94f5fb06 Allow RelativeLinkFilter to go up multiple directories 2015-09-20 19:21:33 -04:00
Robert Speicher 619f04c196 Allow relative links to go up one directory level 2015-09-18 14:03:42 -04:00
Valery Sizov a0c1a12dee remove API calls from CE to CI 2015-09-18 18:02:11 +02:00
Robert Speicher 09bcce7d1f Merge branch 'ldap-attributes' into 'master'
Allow configuration of LDAP attributes GitLab will use for the new user account.

Fixes #2412.

See merge request !1261
2015-09-16 18:34:55 +00:00
Stan Hu 267687993a Add comments and clean up test for !1274 2015-09-10 14:24:10 -07:00
Stan Hu 9d3344adbb Gracefully handle errors in syntax highlighting by leaving the block unformatted
Closes #2433
2015-09-10 09:16:27 -07:00
Douwe Maan c52fee70d0 Test overriding LDAP attributes 2015-09-09 11:51:40 +01:00
Douwe Maan 0e9ba0a4fa Add attributes to LDAP::Config. 2015-09-08 17:34:18 +01:00
Douwe Maan c915e2c823 Allow configuration of LDAP attributes GitLab will use for the new user account. 2015-09-08 16:18:14 +01:00
Robert Speicher e5d89c1084 Remove unnecessary current_user context from filter specs 2015-09-02 23:54:40 -04:00
Robert Speicher 21cacb36a7 Add RedactorFilter specs for invalid Group and Project references 2015-09-01 18:32:52 -04:00
Robert Speicher 7f75300573 Add RedactorFilter 2015-09-01 17:00:29 -04:00
Robert Speicher 454d227b45 Remove all permission checking from Reference filters 2015-09-01 16:58:38 -04:00
Douwe Maan afb2e6f485 Merge branch 'rs-cleanup-redcarpet-renderer' into 'master'
Decouple Gitlab::Markdown from the GitlabMarkdownHelper

This module is now the sole source of knowledge for *how* we render
Markdown (and GFM).

See merge request !1223
2015-09-01 20:13:44 +00:00
Stan Hu 2e9c922dd1 Fix bug where only the first 15 Bitbucket issues would be imported.
Also fix a number of issues where author/reporter names were not available.
2015-09-01 08:50:20 -07:00
Douwe Maan fe86c8dfbd Merge branch 'master' into joelkoglin/gitlab-ce-feature_fix_ldap_auth_issue_993 2015-08-29 11:49:14 -07:00
Robert Speicher 8e7111f79d Reference filters no longer take a custom class context option 2015-08-27 15:36:26 -07:00
Douwe Maan 30555c1d24 Merge branch 'rs-remove-user-color-scheme-class' into 'master'
Apply syntax highlighting to fenced code blocks client-side

Instead of applying the syntax highlighting scheme class to these blocks
server-side, we use Javascript and Gon to apply the user's color scheme
(or the default) client-side.

This will make it easier to cache these blocks in the future because
they're no longer state-dependent.

See merge request !1203
2015-08-27 16:24:51 +00:00
Robert Speicher 4344b8d2d4 Add Gitlab::ColorSchemes module
Very similar to Gitlab::Theme, this contains all of the definitions for
our syntax highlighting schemes.
2015-08-25 15:32:38 -07:00
Robert Speicher 646c1f0324 Re-enable the "links with adjacent text" UserReferenceFilter spec 2015-08-24 18:56:01 -07:00
Stan Hu ed1d4fa477 Remove user OAuth tokens stored in database for Bitbucket, GitHub, and GitLab
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
2015-08-23 09:23:44 -07:00
Robert Speicher f0bdf7f810 Merge branch 'reply-by-email' into 'master'
Reply by email

Fixes #1360.

It's far from done, but _it works_.

See merge request !1173
2015-08-22 00:00:08 +00: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
Joel Koglin 4d2f36118a Issue #993: Fixed login failure when extern_uid changes 2015-08-21 09:36:27 -07:00
Robert Speicher 747fe7520b Remove trailing HTML entities from non-Rinku autolinks as well. 2015-08-20 18:25:16 -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
Douwe Maan 3d51a6d435 Merge branch 'master' into reply-by-email 2015-08-20 12:19:19 -07:00
Douwe Maan 8ec5fb138d Test Gitlab::Email::Receiver. 2015-08-20 12:17:59 -07:00
Douwe Maan 991c9f6fda Test Email::AttachmentUploader. 2015-08-20 11:33:35 -07:00
Douwe Maan e9972efc2f Extract ReplyParser and AttachmentUploader from Receiver. 2015-08-20 11:05:06 -07:00