Commit Graph
3806 Commits
Author SHA1 Message Date
Robert Speicher 93571c4335 Merge branch 'redis-connection-pool' into 'master'
Redis connection pool

Split from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3232

Having an easily accessible Redis connection pool allows us to do more
cool stuff with Redis in GitLab (instead of having to go through e.g.
the Rails cache).

See merge request !3521
2016-04-08 22:26:53 +00:00
Yorick Peterse 833808d737 Merge branch 'instrument-rails-cache' into 'master'
Instrument Rails cache code

See merge request !3619
2016-04-08 20:52:21 +00:00
Yorick Peterse 940b27ecc1 Merge branch 'metrics-timestamp-precision' into 'master'
Use more accurate timestamps for InfluxDB.

See merge request !3617
2016-04-08 15:58:11 +00:00
Yorick Peterse c56f702ec3 Instrument Rails cache code
This allows us to track how much time of a transaction is spent in
dealing with cached data.
2016-04-08 17:54:52 +02:00
Yorick Peterse aa7cddc4fc Use more accurate timestamps for InfluxDB.
This changes the timestamp of metrics to be more accurate/unique by
using Time#to_f combined with a small random jitter value. This
combination hopefully reduces the amount of collisions, though there's
no way to fully prevent any from occurring.

Fixes gitlab-com/operations#175
2016-04-08 16:39:44 +02:00
Robert Schilling fb2fde9d62 API: Expose subscribed? on issues 2016-04-08 15:53:04 +02:00
Jacob Vosmaer cf669551f6 Put CACHE_NAMESPACE in the Gitlab::Redis module 2016-04-07 15:42:07 +02:00
Rémy Coutable 92897d7683 Merge branch 'api-filter-milestone' into 'master'
API: Ability to filter milestones by state

Ability to filter milestones by `active` and `closed` state.

* Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14931

See merge request !3566
2016-04-07 08:45:35 +00:00
Rémy Coutable 8eae7b1088 Merge branch 'feature/expose-builds-badge' into 'master'
Expose badges

This MR exposes badge somewhere in visible place.

![expose_badges](/uploads/d2e290d3013d1ef2b1bdeebbbe2c5d8b/expose_badges.png)

Closes #13801

See merge request !3326
2016-04-07 08:40:15 +00:00
Robert Schilling f5fdf20d76 Merge branch 'master' of github.com:gitlabhq/gitlabhq 2016-04-07 08:21:04 +02:00
Robert Speicher 936be025cd Merge branch 'saml-external-groups' into 'master'
Allow SAML to identify external users and set them as such

Related to #4009

Fixes #14577

This allows SAML to retrieve group information form the `SAML Response`
and match that to a setting that will flag all matching users as external.

See merge request !3530
2016-04-07 00:35:08 +00:00
Robert Speicher 730625f022 Merge branch 'patch/fix-markdown-preview-wikis' into 'master'
Wiki preview URL converting problem [via Markdown]

Current implementation when rendering the preview, thinks relative links are for project repository files.

We are creating a new preview route that will define correct context data to render for wikis instead.

Fixes #2380, #1184

See merge request !3461
2016-04-07 00:17:21 +00:00
Patricio Cano 8110e75309 Implemented suggested fixes 2016-04-06 18:12:25 -05:00
Gabriel Mazetto 1575a95b65 little refactor and improvements on specs 2016-04-06 20:09:15 -03:00
Robert Speicher 5bdc18c5b3 Merge branch 'patch/fix-ldap-unblock-user-logic' into 'master'
Unblocks user when active_directory is disabled and it can be found

We implemented a specific block state to handle user blocking that originates from LDAP filtering rules / directory state in !2242. 

That introduced a regression in LDAP authentication when Active Directory support was disabled. You could have a scenario where the user would not be temporarily found (like a filtering rule), that would mark the user as `ldap_blocked`, but will never unblock it automatically when that state changed.

Fixes #14253, #13179, #13259, #13959

See merge request !3550
2016-04-06 21:50:40 +00:00
Patricio Cano eb0f1de36c Added CHANGELOG item 2016-04-06 16:21:58 -05:00
Douwe Maan fe132f52e8 Merge branch 'fix-markdown-rendering' into 'master'
Fix header link rendering when containing numbers

This fixes the problem where Markdown such as:

    ### 31st

Would get rendered as a link tag pointing to issue number 31 inside a
header tag.

See gitlab-org/gitlab-ce#14936 for more information.

cc @rspeicher 

See merge request !3568
2016-04-06 21:19:12 +00:00
Patricio Cano 3a36fa8957 Fix error that was causing only one group to be returned and corrected specs to use the proper attribute type 2016-04-06 16:03:35 -05:00
Robert Schilling dc3272dccb Revert "API: Ability to retrieve a single tag"
This reverts commit 7f287c9136.
2016-04-06 21:03:24 +02:00
Robert Schilling e6215a9a8e Improve coding and doc style 2016-04-06 20:53:17 +02:00
Robert Schilling 0728588c34 API: Ability to filter milestones by state 2016-04-06 20:39:43 +02:00
Grzegorz Bizon b7fa7c4d59 Extend build status badge, add html/markdown methods 2016-04-06 19:56:34 +02:00
Robert Speicher 755edd8004 Merge branch 'metrics-measure-block' into 'master'
Support for measuring Ruby blocks using GitLab performance monitoring

This adds support for measuring timings of arbitrary Ruby blocks.

Fixes #14710 

See merge request !3515
2016-04-06 17:13:15 +00:00
Robert Schilling 62b6963255 Expose user location in API 2016-04-06 15:53:17 +02:00
Yorick Peterse 1af6cf28c0 Measure Ruby blocks using Gitlab::Metrics
This allows measuring of timings of arbitrary Ruby blocks, this allows
for more fine grained performance monitoring. Custom values and tags can
also be attached to a block.
2016-04-06 14:31:52 +02:00
Yorick Peterse 507cbca339 Fix header link rendering when containing numbers
This fixes the problem where Markdown such as:

    ### 31st

Would get rendered as a link tag pointing to issue number 31 inside a
header tag.

See gitlab-org/gitlab-ce#14936 for more information.
2016-04-06 14:24:30 +02:00
Robert Schilling 7f287c9136 API: Ability to retrieve a single tag 2016-04-06 13:59:50 +02:00
Yasser Hussain d023a85287 Changed the argument of not_found for 'unprotect'
not_found appends string "Not Found" to the argument causing the resulting message to be "Branch does not exist Not Found" which is an incorrect error message.

Changed the argument of not_found! for 'unprotect'  command to "Branch" from "Branch does not exist".  This makes the final error message to appear as "Branch Not Found" which is correct and same as error messages for other commands like 'protect'.
2016-04-06 15:07:31 +05:30
Gabriel Mazetto 207b7218aa Ensure correct filter order to validate with our markdown spec 2016-04-06 03:30:56 -03:00
Gabriel Mazetto 22055e1058 Fix a few edited references from WikiLinkFilter and specs 2016-04-06 03:13:46 -03:00
Gabriel Mazetto 61fe0a2397 Fixed WikiPipeline and specs 2016-04-06 03:12:39 -03:00
Patricio Cano 518ec6b266 Changed config syntax and improved how chaanges in group memberships are handled when external groups is set up 2016-04-05 19:20:18 -05:00
Gabriel Mazetto 5ee6badade Unblocks user when active_directory is disabled and it can be found 2016-04-05 16:34:31 -03:00
connorshea b9abf938ed Wrap images in discussions and wikis with a link to the image source using ImageLinkFilter.
Resolves #14411.

See merge request !3464
2016-04-04 19:44:07 -06:00
Patricio Cano 1a168279fa Prepare SAML for group retrieval 2016-04-04 19:09:12 -05:00
Jacob Vosmaer 213ee62469 Be careful when setting class instance vars 2016-04-04 17:01:56 +02:00
Jacob Vosmaer 0163e27631 Add Gitlab::Redis connection pool 2016-04-04 17:00:09 +02:00
Yorick Peterse 915fd3f910 Cleaned up caching in AbstractReferenceFilter
Cleaning this up any further is a bit tricky as the caches in question
should only be evaluated if RequestStore is actually enabled.
2016-04-04 11:39:11 +02:00
Yorick Peterse 7f0fd73eeb Cache default_issues_tracker? in Banzai
Every object processed by ExternalIssueReferenceFilter can return a
different Project instance when calling "project". For example, every
note processed will have it's own associated Project. If we were to
cache Project#default_issues_tracker? on Project level this would have
no impact on Markdown rendering timings as the cache would have to be
built for every Project instance without it ever being re-used.

To work around this we cache Project#default_issues_tracker? in
Banzai::Filter::ExternalIssueReferenceFilter using the project's _id_
instead of the whole object. This setup allows re-using of the cached
data even when the Project instances used are different, as long as the
actual project IDs are the same.
2016-04-04 10:44:35 +02:00
Yorick Peterse 9fa94326db Memoize object class titles
For an issue with around 200 notes this cuts down timings by around 150
milliseconds.
2016-04-04 10:44:35 +02:00
Yorick Peterse 8c49eaa937 Cache Banzai class methods returning static data
These methods always return the same data for every class so there's no
point in computing their values on every call.
2016-04-04 10:44:35 +02:00
Yorick Peterse 1411480577 Refactor processing of various Banzai filters
These filters now use a single iteration over all the document nodes
instead of multiple ones. This in turn allows variables to be re-used
(e.g. links only have to be unescaped once). Combined with some other
refactoring this can drastically reduce render timings.
2016-04-04 10:44:35 +02:00
Yorick Peterse 57bde0ce65 Cache Banzai projects/objects using RequestStore
This was originally suggested by @ayufan and modified to be a bit
cleaner and use RequestStore instead of a regular Hash.

By caching the output of the two methods involved the number of queries
is reduced significantly. For example, for an issue with 200 notes (of
which 100 reference a number of merge requests) this cuts down the
amount of queries from around 6300 to around 3300.
2016-04-04 10:44:35 +02:00
Douwe Maan df725aec98 Merge branch 'add-ability-to-archive-a-project-via-api-14296' into 'master'
Add endpoints for archiving and unarchiving

Closes #14296

See merge request !3372
2016-04-03 13:19:25 +00:00
Robert Speicher 5627542fd4 Merge branch 'routing' into 'master'
Added & use Gitlab::Routing for URL helpers

Extracted from !3389

See merge request !3486
2016-04-01 16:51:20 +00:00
Robert Speicher 64106865df Merge branch 'fix/fogbugz-import' into 'master'
spec and fix for fogbugz lonely user problem

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14766

I encountered this issue while manually testing all import types for
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3066

This is really due to a horrible API

```
{ 'people' => { 'person' => array_of_people_or_single_person_as_hash } }
```

See merge request !3457
2016-04-01 16:32:00 +00:00
Yorick Peterse 84b0ab7766 Added & use Gitlab::Routing for URL helpers
Rails' "url_helpers" method creates an anonymous Module (which a bunch
of methods) on every call. By caching the output of this method in a
dedicated method we can shave off about 10 seconds of loading time for
an issue with around 200 comments.
2016-04-01 11:13:48 +02:00
Douwe Maan 2e3c2a355f Merge branch 'snippets-with-comments-cause-a-500-when-they-show-up-in-search-results-14764' into 'master'
Fix Error 500 when searching for a comment in a project snippet

Closes #14764. /cc @stanhu, and thank you for the spec! ;)

See merge request !3468
2016-04-01 08:38:16 +00:00
Douwe Maan 98df8aab7e Merge branch 'fix/issue-move-rewrite-uploads' into 'master'
Rewrite uploads when moving issue to another project

Closes #14531

See merge request !3382
2016-04-01 07:17:10 +00:00
Gabriel Mazetto 28266d9d61 Added WikiLinkFilter 2016-04-01 00:17:37 -03:00