Commit Graph

1692 Commits

Author SHA1 Message Date
Yorick Peterse 229f3ce9ce
Configuring of points per UDP packet
This allows users to configure the number of points stored in a single
UDP packet. This in turn can be used to reduce the number of UDP packets
being sent at the cost of these packets being somewhat larger.

The default setting is 1 point per packet so nothing changes for
existing users.
2016-04-19 14:35:25 +02:00
Gabriel Mazetto 5330af3fa6 Using single builder for push and tag events 2016-04-19 11:00:30 +02:00
Gabriel Mazetto ee1090e2b2 Added System Hooks for push and tag_push
Code is based on Project Webhooks, removing deprecations and without
commits listing.
2016-04-19 11:00:30 +02:00
Douglas Barbosa Alexandre f2fe4af19d Set GitHub milestones to Issue/Merge Request that were imported 2016-04-18 20:07:05 -03:00
Douglas Barbosa Alexandre 06ec511164 Import milestones from GitHub 2016-04-18 20:07:04 -03:00
Douglas Barbosa Alexandre 7462a8f90a Apply GitHub labels to Issue/Merge Request that were imported 2016-04-18 17:14:59 -03:00
Douglas Barbosa Alexandre 05a4f444c3 Import labels from GitHub 2016-04-18 17:14:59 -03:00
Douglas Barbosa Alexandre d13bba44f0 Use GitHub Issue/PR number as iid to keep references
With these changes we don’t lost the issue/pr references when importing
them to GitLab.
2016-04-18 12:15:50 -03:00
Yorick Peterse 7e6f0ac0e0
Count the number of SQL queries per transaction
Fixes gitlab-org/gitlab-ce#15335
2016-04-18 14:53:13 +02:00
Yorick Peterse 7b6785b3b1
Use Module#prepend for method instrumentation
By using Module#prepend we can define a Module containing all proxy
methods. This removes the need for setting up crazy method alias chains
and in turn prevents us from having to deal with all that madness (e.g.
methods calling each other recursively).

Fixes gitlab-org/gitlab-ce#15281
2016-04-18 11:16:31 +02:00
Robert Speicher 2e4d9c1de6 Merge branch 'fix/project-import_url' into 'master'
Fix for import_url fields on projects containing third-party credentials

Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/2658 

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

See merge request !3066
2016-04-15 21:52:00 +00:00
Robert Speicher 34b0561560 Merge branch 'pmq20/gitlab-ce-psvr/change-head' into 'master'
Use rugged to change HEAD

_Originally opened at !2850 by @pmq20._

Needless to invoke gitlab_shell here, which is slow.

See merge request !3705
2016-04-15 16:44:21 +00:00
Rémy Coutable 8b7bf2a0e0 Merge branch 'rugged-delete-tag' into 'master'
Delete tags via rugged

Improve the performance by directly using rugged instead of shelling out to a git operation.

See merge request !3748
2016-04-15 14:42:05 +00:00
Robert Schilling 3c704c33e0 Delete tags via rugged 2016-04-15 16:05:04 +02:00
Robert Schilling 106c443e76 Remove unused backend methods 2016-04-15 13:30:33 +02:00
Rémy Coutable f8e8a61c9c
Remove Gitlab::Shell#update_repository_head since it's not used anymore
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-15 11:38:59 +02:00
James Lopez 05985b49a4 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-15 08:49:08 +02:00
Robert Speicher 95a867e0af Merge branch 'auto-fsck' into 'master'
Auto git fsck

Closes https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3232

See merge request !3232
2016-04-14 17:15:58 +00:00
James Lopez e5f7a54530 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-14 18:12:10 +02:00
Rémy Coutable dd9ced0af9 Merge branch 'connorshea/gitlab-ce-revoke-authorized-application' into 'master'
Fix revoking of authorized OAuth applications

Users were not able to revoke access to authorized OAuth applications. Clicking the "Revoke" button would result in a 404 page, and the application would still be authorized.

Added a spec and also found that the `gon` variables were not being set for this view.

Closes #14370

See merge request !3690
2016-04-14 15:26:09 +00:00
Stan Hu e450892f56 Include GonHelper separately and remove created_at in factory 2016-04-14 07:25:27 -07:00
Stan Hu c7e384aab2 Add spec for deletion of authorized OAuth2 application
Closes #14370

Move gon function into its own helper
2016-04-14 07:24:58 -07:00
Rémy Coutable c71cdb194f Merge branch 'simplify-gitlab-url_builder-15202' into 'master'
Refactor and expose only Gitlab::UrlBuilder.build(record)

```
$ git grep Gitlab::UrlBuilder

app/models/commit.rb:      url: Gitlab::UrlBuilder.build(self),
app/services/issues/base_service.rb:      issue_url = Gitlab::UrlBuilder.build(issue)
app/services/merge_requests/base_service.rb:      hook_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(merge_request)
app/views/search/results/_note.html.haml:- note_url = Gitlab::UrlBuilder.build(note)
lib/gitlab/note_data_builder.rb:        base_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(note)
spec/lib/gitlab/note_data_builder_spec.rb:    expect(data[:object_attributes][:url]).to eq(Gitlab::UrlBuilder.build(note))
spec/lib/gitlab/url_builder_spec.rb:describe Gitlab::UrlBuilder, lib: true do
```

Fixes #15202.

See merge request !3696
2016-04-14 10:27:49 +00:00
James Lopez efff7e9e54 updated migration based on testing findings 2016-04-14 12:03:45 +02:00
Valery Sizov c0678f2d28 Merge branch 'redis_config_consistency' into 'master'
Redis configuration consistency

Related cf669551f6

See merge request !3697
2016-04-13 18:34:11 +00:00
Valery Sizov 2244aaf98f Redis configuration consistency 2016-04-13 20:57:19 +03:00
Robert Speicher 2b28fa14b3 Merge branch 'redis_improvements' into 'master'
Clean up ExclusiveLease

See merge request !3695
2016-04-13 16:22:45 +00:00
Jacob Vosmaer f07316f27c Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into auto-fsck 2016-04-13 17:38:59 +02:00
Rémy Coutable 02cfbf0db5
Refactor and expose only Gitlab::UrlBuilder.build(record)
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-13 16:07:04 +02:00
Marin Jankovski c746046992 Merge branch 'external-omniauth-providers' into 'master'
Allow Omniauth providers to be marked as external

Related to #4009 

With this MR we will be able to allow the user to set which Omniauth Providers they would like to have as external. All users login in via these providers will be marked as external, even if they already had an account before. If the provider is removed form the list of external providers, the users will be marked as internal at their next login.

MR for Omnibus: gitlab-org/omnibus-gitlab!727

/cc @dblessing @DouweM 

See merge request !3657
2016-04-13 13:09:47 +00:00
Valery Sizov 33f786b5d3 clean up ExclusiveLease 2016-04-13 13:12:05 +03:00
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
Robert Speicher d75ec6cd46 Merge branch 'fix-missing-saml-error-handling' into 'master'
Add proper nil and error handling to SAML login process

While writing the feature that would allow certain Omniauth providers to be marked as external I noticed that there is a scenario where the `gl_user` method can return `nil` and if this is not properly checked, it will lead to exceptions that will cause 500 errors. It is quite easy to land in this scenario, so I added `nil` checks.

I also noticed that the `saml` method in the `omniauth_callbacks_controller.rb` file lacked a `rescue` for `Gitlab::OAuth::SignupDisabledError`, which can happen if the default configuration from `1_settings.rb` is applied. So I also added this check.

See merge request !3609
2016-04-12 15:46:39 +00:00
Jacob Vosmaer 7b1bb0f4db Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into auto-fsck 2016-04-12 17:44:02 +02:00
Jacob Vosmaer 97f4ffff1e Add a 'circuit breaker' for repo checks 2016-04-12 17:07:54 +02:00
Patricio Cano 61fc9aa87e Better control flow. 2016-04-11 18:01:51 -05:00
Patricio Cano 05a611a091 Better control flow and added guard clause. 2016-04-11 17:25:18 -05:00
Patricio Cano 12e6084667 Allow `external_providers` for Omniauth to be defined to mark these users as external 2016-04-11 10:16:15 -05: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 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
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 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
Patricio Cano 1d2429af9b Add missing proper nil and error handling to SAML login process. 2016-04-07 16:45:33 -05:00
Jacob Vosmaer cf669551f6 Put CACHE_NAMESPACE in the Gitlab::Redis module 2016-04-07 15:42:07 +02:00
James Lopez a1a1d1f7de refactored create_or_update_import_data 2016-04-07 15:08:38 +02:00
James Lopez 15044e7d85 refactored a few things based on MR feedback 2016-04-07 15:00:20 +02:00
James Lopez e8b7e37c6d Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-07 14:15:48 +02:00