summaryrefslogtreecommitdiff
path: root/config/initializers
Commit message (Collapse)AuthorAgeFilesLines
* Add methods for injecting EE modulesYorick Peterse2019-07-301-0/+17
| | | | | | | | | | | This adds the methods prepend_if_ee, extend_if_ee, and include_if_ee that can be used to inject EE specific modules in EE. These methods are exposed as an initializer that is loaded as soon as possible. For tests that use fast_spec_helper.rb we must load this initializer manually, as the Rails environment is not loaded. This is not the most pretty setup, but unfortunately there is no alternative that we can use.
* Remove line profiler from performance barSean McGivern2019-07-301-1/+0
| | | | | | | | | 1. The output isn't great. It can be hard to find hotspots and, even when you do find them, to find why those are hotspots. 2. It uses some jQuery-specific frontend code which we can remove now that we don't have this any more. 3. It's only possible to profile the initial request, not any subsequent AJAX requests.
* Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhqRobert Speicher2019-07-291-0/+1
|\
| * Merge branch 'security-github-ssrf-redirect' into 'master'GitLab Release Tools Bot2019-07-261-0/+1
| |\ | | | | | | | | | | | | Do not allow localhost url redirection in GitHub Integration See merge request gitlab/gitlabhq!3188
| | * Do not allow localhost url redirection in GitHub Integrationmanojmj2019-07-051-0/+1
| | |
* | | Merge branch 'remove-peek-pg' into 'master'Stan Hu2019-07-291-35/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Replace peek-pg with our own implementation Closes #44441 See merge request gitlab-org/gitlab-ce!31187
| * | | Replace peek-pg with our own implementationremove-peek-pgSean McGivern2019-07-261-35/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses an ActiveRecord subscriber to get queries and calculate the total query time from that. This means that the total will always be consistent with the queries in the table. It does however mean that we could potentially miss some queries that don't go through ActiveRecord. Making this change also allows us to unify the response JSON a little bit, making the frontend slightly simpler as a result.
* | | | Adds direct monitoring for sidekiq metricsRyan Cobb2019-07-291-0/+1
|/ / / | | | | | | | | | | | | This adds diirect monitoring for sidekiq metrics. This is done via sidekiq middleware and a sampler to pull from sidekiqs api.
* | | Remove unneeded monkey-patch54478-table_exists-not-compatible-with-rails-5-1Heinrich Lee Yu2019-07-253-12/+2
| | | | | | | | | | | | | | | Changes all calls to data_source_exists? to table_exists? since that is the intent of these calls
* | | Merge branch 'ce-docker_image_replication-event-generation' into 'master'Douglas Barbosa Alexandre2019-07-241-0/+1
|\ \ \ | |/ / |/| | | | | | | | Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14597 See merge request gitlab-org/gitlab-ce!30520
| * | Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14597ce-docker_image_replication-event-generationValery Sizov2019-07-241-0/+1
| | | | | | | | | | | | | | | This is the first part of Docker Registry replication for secondary Geo node.
* | | Add Rugged calls to performance barStan Hu2019-07-231-0/+1
|/ / | | | | | | | | | | This will help diagnose the source of excessive I/O from Rugged calls. To implement this, we need to obtain the full list of arguments sent to each request method.
* | Merge branch '52442-initial-mysql-support-removal' into 'master'Robert Speicher2019-07-238-251/+32
|\ \ | | | | | | | | | | | | | | | | | | Remove dead mysql code Closes #63191 See merge request gitlab-org/gitlab-ce!29608
| * | Remove dead MySQL codeNick Thomas2019-07-238-251/+32
| | | | | | | | | | | | None of this code can be reached any more, so it can all be removed
* | | Remove PostgreSQL opclasses monkey patchsh-remove-opclasses-patchStan Hu2019-07-231-211/+0
|/ / | | | | | | | | | | | | | | | | | | | | This is no longer needed with Rails 5.2. opclass is the attribute used per https://github.com/rails/rails/pull/19090/files. Now that we've removed the monkey patch and restored the Rails schema dumper, it appears Rails has dropped the inclusion of `using: :btree` as well (https://github.com/rails/rails/pull/27981). Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64529
* | Port EE specific settings to CELin Jen-Shin2019-07-221-0/+1
| |
* | Merge branch 'sh-add-rugged-logs' into 'master'Douglas Barbosa Alexandre2019-07-181-0/+7
|\ \ | | | | | | | | | | | | | | | | | | Add Rugged calls and duration to API and Rails logs Closes #64676 See merge request gitlab-org/gitlab-ce!30871
| * | Add Rugged calls and duration to API and Rails logsStan Hu2019-07-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This adds `rugged_duration_ms` and `rugged_calls` fields to `api_json.log` and `production_json.log`. This will make it easier to identify performance issues caused by excessive I/O. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64676
* | | Fix pid providing for PrometheusAleksei Lipniagov2019-07-181-2/+1
| | | | | | | | | | | | | | | | | | | | | Use relative worker identifier for metrics (instead of Process.pid) and identify when Unicorn/Puma/Sidekiq is used. Previously, it was assumed that all metrics are gathered from Unicorn due to hardcoded implementation which was incorrect.
* | | Merge branch 'sh-fix-redis-performance-bar' into 'master'Mayra Cabrera2019-07-181-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Fix inconsistency in Redis performance bar stats Closes #64707 See merge request gitlab-org/gitlab-ce!30866
| * | Fix inconsistency in Redis performance bar statssh-fix-redis-performance-barStan Hu2019-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | peek-redis resets its counters at the start of an ActionController notification (`start_processing.action_controller`), which causes it to miss some Redis queries that precede it, such as the database load balancer and Rack Attack queries. This produces inconsistencies in the performance bar between the number of calls and their durations with the actual calls in the detailed view. We fix this by getting rid of peek-redis in favor of consolidating all logic into the `RedisDetailed` view, which tracks Redis queries using `RequestStore`. This has the nice property of removing thread-specific counters as well. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64707
* | | Merge branch 'rs-zz-metrics' into 'master'Lin Jen-Shin2019-07-171-0/+31
|\ \ \ | |/ / |/| | | | | | | | Add EE-only class instrumentation See merge request gitlab-org/gitlab-ce!30802
| * | Add EE-only class instrumentationrs-zz-metricsRobert Speicher2019-07-161-0/+31
| | |
* | | Rename Redactor classes to ReferenceRedactorSarah Yasonik2019-07-161-1/+1
|/ /
* | Make httpclient respect system SSL configurationsh-fix-httpclient-sslStan Hu2019-07-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | By default, httpclient (and hence anything that uses rack-oauth2) ignores the system-wide SSL certificate configuration in favor of its own `cacert.pem`. This makes it impossible to use custom certificates without patching that file. Until https://github.com/nahi/httpclient/pull/386 is merged, we work around this limitation by forcing the `HTTPClient` SSL store to use the default system configuration. Closes https://gitlab.com/charts/gitlab/issues/1436
* | Merge branch 'js-specs-transactions' into 'master'Andreas Brandl2019-07-121-0/+3
|\ \ | | | | | | | | | | | | | | | | | | Use transactions in JS feature specs Closes #60207 See merge request gitlab-org/gitlab-ce!27496
| * | Use transactions in JS feature specsjs-specs-transactionsHeinrich Lee Yu2019-07-121-0/+3
| | | | | | | | | | | | | | | Uses Rails transactional tests instead of DatabaseCleaner transaction strategy because that doesn't work with JS tests
* | | Upgrade to Rails 5.2upgrade-rails-5-2-ceHeinrich Lee Yu2019-07-128-84/+32
|/ / | | | | | | Updates changed method names and fixes spec failures
* | Merge branch '490-enable-puma-by-default-in-GDK' into 'master'Grzegorz Bizon2019-07-111-2/+2
|\ \ | | | | | | | | | | | | | | | | | | Enable puma by default in GDK Closes gitlab-development-kit#490 See merge request gitlab-org/gitlab-ce!30285
| * | Enable puma by default in GDK490-enable-puma-by-default-in-GDKQingyu Zhao2019-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two changes: 1. Move bin/web to bin/web_unicorn(removed PUMA switching logic) Introduce new shadow script bin/web. Now we have 3 scripts working together: bin/web, bin/web_puma, bin/web_unicorn In bin/web, it checks ENV['USE_WEB_SERVER']: - if value is 'puma' or value is not set, call bin/web_puma - if value is 'unicorn', call bin/web_unicorn - report error if other values given 2. Gitlab rails allow ENV setting to override timeout - ENV['GITLAB_RAILS_RACK_TIMEOUT'] for service_timeout - ENV['GITLAB_RAILS_WAIT_TIMEOUT'] for wait_timeout
* | | Add a rubocop for Rails.loggerMayra Cabrera2019-07-105-8/+8
| | | | | | | | | | | | | | | | | | Suggests to use a JSON structured log instead Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
* | | CE-EE parity for shared config filesRobert Speicher2019-07-091-1/+2
| | | | | | | | | | | | | | | This copies over EE-specific changes to shared configuration files in CE.
* | | Merge branch 'rs-basic-config-files' into 'master'Lin Jen-Shin2019-07-099-2/+162
|\ \ \ | | | | | | | | | | | | | | | | CE-EE parity for config/initializers See merge request gitlab-org/gitlab-ce!30484
| * | | Add frozen_string_literal to EE files now in CErs-basic-config-filesRobert Speicher2019-07-085-0/+10
| | | |
| * | | Move lib/gitlab dependency to applicationRobert Speicher2019-07-081-2/+0
| | | | | | | | | | | | | | | | We use the `Gitlab.ee` and `.ee?` methods in several initializers now.
| * | | CE-EE parity for files in config/initializersRobert Speicher2019-07-084-2/+31
| | | |
| * | | Add EE-only initializersRobert Speicher2019-07-085-0/+123
| |/ / | | | | | | | | | | | | These files are only used by EE, and are now wrapped in `Gitlab.ee` blocks for file parity.
* | | Limit user information to RackAttack throttlesMayra Cabrera2019-07-091-1/+1
|/ / | | | | | | | | | | | | | | rack.attack.match_discriminator is only return on throttle_authenticated_api or throttle_authenticated_web requests, so we're avoiding logging user_id on blacklist requests Follow up of https://gitlab.com/gitlab-org/gitlab-ce/issues/62756
* | Fix race in forbid_sidekiq_in_transactions.rbfix-sidekiq-transaction-check-raceKamil Trzciński2019-07-041-6/+7
|/ | | | | | Current code uses module attribute which stores value global instead of locally (thread locally). This results in concurrent accesses to overwrite the each other values
* Only save Peek session in Redis when Peek is enabledRémy Coutable2019-07-031-0/+3
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch ↵Kamil Trzciński2019-07-021-4/+16
|\ | | | | | | | | | | | | | | | | '63869-store-prometheus-metrics-in-separate-dirs-in-test-and-prod' into 'master' Use separate Prometheus metrics dirs in dev/test Closes #63869 See merge request gitlab-org/gitlab-ce!30253
| * Use separate Prometheus metrics dirs in dev/test63869-store-prometheus-metrics-in-separate-dirs-in-test-and-prodAleksei Lipniagov2019-07-021-4/+16
| | | | | | | | | | Store Sidekiq and Web server metrics from Prometheus in separate directories in `development` and `test` environments.
* | Include user id and username in auth logMayra Cabrera2019-07-021-2/+12
| | | | | | | | | | | | Fetches user based on the value of 'rack.attack.match_discriminator' Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62756
* | Start UnicornSampler in master processJan Provaznik2019-07-021-6/+4
|/ | | | | Using `on_master_start` assures that the sampler is started in master process and not in worker processes.
* Includes logic to persist namespace statisticsMayra Cabrera2019-07-021-0/+3
| | | | | | | | | | | | | | | | | | | | | - Add two new ActiveRecord models: - RootNamespaceStoragestatistics will persist root namespace statistics - NamespaceAggregationSchedule will save information when a new update to the namespace statistics needs to be scheduled - Inject into UpdateProjectStatistics concern a new callback that will call an async job to insert a new row onto NamespaceAggregationSchedule table - When a new row is inserted a new job is scheduled. This job will update call an specific service to update the statistics and after that it will delete thee aggregated scheduled row - The RefresherServices makes heavy use of arel to build composable queries to update Namespace::RootStorageStatistics attributes. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows
* Add a memory cache local to the thread to reduce Redis loadStan Hu2019-07-011-0/+3
| | | | | | | | | | | | Loading `ApplicationSetting` from Redis was responsible for at least 50% of the CPU load of the Redis cluster on GitLab.com. Since these values generally don't change very much, we can load this from the database and cache it in memory, skipping Redis altogther. We use `ActiveSupport::Cache::MemoryStore` as a drop-in replacement for `RedisCacheStore` even though we probably don't need synchronized access within `Thread.current`. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63977
* Run do_master_restart callback on server startJan Provaznik2019-07-011-4/+11
| | | | | | | | | | We want to call master_restart callback on start too - this callback is used for cleaning up prometheus files. It has been added to Omnibus already: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/3350 So make sure that Unicorn example configs are up-to-date and that the same callback is called for Puma too.
* Merge branch 'zj-circuit-breaker-removal-part-deux' into 'master'Bob Van Landuyt2019-07-011-15/+6
|\ | | | | | | | | Remove ignored circuit_breaker columns See merge request gitlab-org/gitlab-ce!30159
| * Remove ignored circuit_breaker columnsZeger-Jan van de Weg2019-06-281-15/+6
| | | | | | | | | | | | The circuit breaker itself got removed a while ago, when that happened some parts got left behind. Using grep old stale settings and validations were found and are now removed.
* | Merge branch 'rs-config-settings' into 'master'Lin Jen-Shin2019-06-291-8/+136
|\ \ | | | | | | | | | | | | Copy Settings initializer from EE See merge request gitlab-org/gitlab-ce!30140