Commit Graph
548 Commits
Author SHA1 Message Date
Yorick Peterse 3240ecfbef Added ability to add custom tags to transactions
One use case for this is manually setting the "action" tag for Grape API
calls. Due to Grape running blocks there are no human readable method
names that can be used for the "action" tag, thus we have to set these
manually on a case by case basis.
2016-04-13 11:22:37 +02:00
Yorick Peterse 7eed4608fe Fixed stubbing for Gitlab::Metrics specs
If the measure method uses Transaction.current directly the SQL
subscriber (Subscribers::ActiveRecord) will add timings of queries
triggered by DB cleaner.
2016-04-11 14:29:38 +02:00
Yorick Peterse d9110a7eca Track call counts in Gitlab::Metrics.measure_block 2016-04-11 13:27:52 +02:00
Yorick Peterse 185d78bcb3 Added specs for Gitlab::Metrics::System.cpu_time 2016-04-11 13:11:13 +02:00
Yorick Peterse 16926a676b Store block timings as transaction values
This makes it easier to query, simplifies the code, and makes it
possible to figure out what transaction the data belongs to (simply
because it's now stored _in_ the transaction).

This new setup keeps track of both the real/wall time _and_ CPU time
spent in a block, both measured using milliseconds (to keep all units
the same).
2016-04-11 13:09:36 +02: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
Jacob Schatz 0bbeebc8f9 Remove dumb debug statement and add many tests. 2016-04-07 08:47:29 -04: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 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
Patricio Cano 8110e75309 Implemented suggested fixes 2016-04-06 18:12:25 -05: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 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
Grzegorz Bizon b7fa7c4d59 Extend build status badge, add html/markdown methods 2016-04-06 19:56:34 +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 a3cf3d1982 Corrected some spec headers for Gitlab::Metrics 2016-04-06 14:31:52 +02:00
Patricio Cano 7efaf22bcc Removed extra LDAP tests and added tests for the external groups feature 2016-04-05 19:22:58 -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
Patricio Cano d14f080c0a Remove unnecessary LDAP tests from SAML tests 2016-04-04 19:09:46 -05: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
Grzegorz Bizon cf21fd7a95 Fix rubocop offenses in upload rewriter specs 2016-03-31 10:41:57 +02:00
Grzegorz Bizon ed6f524c49 Merge branch 'master' into fix/issue-move-rewrite-uploads
* master: (27 commits)
  Fix commit comment alignment
  minor cleanup in system_hook_spec
  Pre-calculate Emoji digests
  Clear .todo listener
  Change window.location to use turbolinks
  Make entire todo row clickable
  Add 8.6.2 CHANGELOG items
  Ensure uploads dir exists when running backup specs
  Move CarrierWave test env config to separate file
  Remove console logs
  Off the event initially
  Collapsed sidebar opens over instead of pushing content.
  Sidebar collapse update issue
  User selection from collapsed sidebar
  Add json response for user avatar in merge request
  Make changed values visible in minimized sidebar.
  Fixed MergeRequestController spec
  We need `sha` reference from `diff_base_commit` to generate the diff
  Use `diff_base_commit` instead of `target_branch` to generate diffs
  Isolate CarrierWave uploads in test enviroment
  ...
2016-03-31 10:07:13 +02:00
Grzegorz Bizon 57ea33bfd0 Extend specs for GFM uploads rewriter 2016-03-31 09:43:47 +02:00
James Lopez c2d5cc91c0 updated spec 2016-03-31 09:22:28 +02:00
James Lopez 2d544d5445 spec and fix for fogbugz lonely user problem 2016-03-30 18:48:28 +02:00
Douwe Maan c9a7cc4b37 Merge branch '2364-fallback-to-in-reply-to-header' into 'master'
Fall back to In-Reply-To and References headers when sub-addressing is not available

_Originally opened at !3024 by @dabit._

- - -

Fixes #2364 

Summary of the changes:
- No more need to have the `%{key}` placeholder in the `incoming_email.address`
- The fallback message id format is `reply-[key]@[gitlab_host]` (reminder: it doesn't have to be a real email address)
- The fallback message id that includes the reply key is added to both `References` header
- Documentation for the "Reply by email" feature updated

See merge request !3305
2016-03-30 16:16:37 +00:00
Grzegorz Bizon b9f5719285 Remove reduntant move_to_store override 2016-03-30 12:50:19 +02:00
Grzegorz Bizon f2674c7b98 Refactor uploads rewriter used when moving issue 2016-03-30 10:44:18 +02:00
Grzegorz Bizon 0b8cefd3b2 Get FileUploader into test harness using factory
This attempts to get CarrierWave's uploader - `FileUploader` into test
harness using a factory. that makes it easier to build an instance of
it.

Along with !3435 it may be easier to use uploaders in tests
2016-03-30 10:44:18 +02:00
Grzegorz Bizon 701976e081 Add uploads rewriter and use it when moving issue 2016-03-30 10:44:18 +02:00
Grzegorz Bizon d6097ca402 Extend specs for build badge 2016-03-29 09:01:24 +02:00
Grzegorz Bizon 4cd1b9f4d8 Refactor builds badge, encapsulate inside a class 2016-03-29 09:01:19 +02:00
Rémy Coutable 9f218fc184 Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature
A few things to note:
- The IncomingEmail feature is now enabled even without a
  correctly-formatted sub-address
- Message-ID for new thread mail are kept the same so that subsequent
  notifications to this thread are grouped in the thread by the email
  service that receives the notification
  (i.e. In-Reply-To of the answer == Message-ID of the first thread message)
- To maximize our chance to be able to retrieve the reply key, we look
  for it in the In-Reply-To header and the References header
- The pattern for the fallback reply message id is "reply-[key]@[gitlab_host]"
- Improve docs thanks to Axil
2016-03-25 13:05:15 +01:00
David PadillaandRémy Coutable 31e76baf61 Fix #2364. Fall back to In-Reply-To header when reply key not available 2016-03-25 13:05:15 +01:00
Grzegorz Bizon 6eb3105634 Find referable for each ref found in references rewriter 2016-03-20 10:52:01 +01:00
Grzegorz Bizon 323d328c86 Rename reference unfolder to rewriter, minor refactorings 2016-03-20 10:14:25 +01:00
Grzegorz Bizon 18f25bc942 Update reference unfolder according to recent ability changes
Commit 43d8bdb4f0 introduced additional
checks for permissions to read issue in references extractor.
2016-03-19 18:58:52 +01:00
Grzegorz Bizon 0115ad66d2 Merge branch 'master' into feature/issue-move
* master: (121 commits)
  Dedupe labels in labels selector in Dashboard pages
  Refactor colors and lists
  Add a safeguard in MergeRequest#compute_diverged_commits_count
  Fix an issue when the target branch of a MR had been deleted
  Add avatar to issue and MR pages header
  Cleanup somce css colors
  Re-group scss variables
  Refactor `Todo#target`
  Fixes issue with filter label missing on labels & milestones
  Rename `Todo#to_reference` to `Todo#target_reference`
  Fixed failing tests
  Updated controller with before_action Fixed other issues based on feedback
  Fixes issue on dashboard issues
  Full labels data in JSON
  Fixed issue with labels dropdown getting wrong labels
  Update CHANGELOG
  Use `Note#for_project_snippet?` to skip notes on project snippet
  Use `Commit#short_id` instead of `Commit.truncate_sha`
  Reuse `for_commit?` on conditional validations
  Update schema info comment on todo related files
  ...

Conflicts:
	app/models/issue.rb
	db/schema.rb
	spec/models/issue_spec.rb
2016-03-19 18:50:15 +01:00
Grzegorz Bizon 9b13ce0b7a Improvements in issue move feaure (refactoring)
According to endbosses' suggestions.
2016-03-19 18:46:01 +01:00
Douwe Maan 9813eac56b Merge branch 'confidential-issues' into 'master'
Add confidential issues

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/3678

More information: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/227

See merge request !3282
2016-03-18 12:04:56 +00:00
Yorick Peterse 3f0d780c19 Show a notice for diffs that are too large
This builds on the changes introduced in
https://gitlab.com/gitlab-org/gitlab_git/merge_requests/72 and results
in merge requests with large diffs (e.g. due to them containing minified
CSS) loading much faster.
2016-03-18 12:30:46 +01:00
Douglas Barbosa Alexandre f2ba4e3d36 Restrict access to confidential issues on search results 2016-03-17 20:55:59 -03:00
Douglas Barbosa Alexandre 43d8bdb4f0 Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
Grzegorz Bizon 4354bfaba5 Add implementation of reference unfolder using banzai 2016-03-17 07:39:16 +01:00
Grzegorz Bizon fd8394faae Move reference unfolder for GFM to separate class 2016-03-17 07:39:15 +01:00
Rubén Dávila 7e03b40221 Return an empty Array when there aren't lines to parse. 2016-03-15 19:51:27 -05:00
Stan Hu 74d7de8196 Revert "Revert "Merge branch 'support-go-subpackages' into 'master' ""
This reverts commit 5a586f364c
2016-03-12 21:05:23 +00:00
Douwe Maan 5a586f364c Revert "Merge branch 'support-go-subpackages' into 'master' "
This reverts merge request !3191
2016-03-12 17:42:51 +00:00
Douwe Maan 826bc72c12 Merge branch 'support-go-subpackages' into 'master'
Support Golang subpackage fetching

Closes #13805

See merge request !3191
2016-03-12 17:38:08 +00:00