summaryrefslogtreecommitdiff
path: root/config/initializers
Commit message (Collapse)AuthorAgeFilesLines
* Properly handle `sidekiq` skipsidekiq-interrupt-running-jobsKamil Trzciński2019-08-211-4/+3
| | | | Transform `CancelledError` into `JobRetry::Skip`
* Rework `Sidekiq::JobsThreads` into `Monitor`Kamil Trzciński2019-08-211-2/+4
| | | | | | | | | | This makes: - very shallow `Middleware::Monitor` to only request tracking of sidekiq jobs, - `SidekiqStatus::Monitor` to be responsible to maintain persistent connection to receive messages, - `SidekiqStatus::Monitor` to always use structured logging and instance variables
* Allow to interrupt running jobsKamil Trzciński2019-08-211-0/+3
| | | | | | | | | | | | | | | | | This adds a middleware to track all threads for running jobs. This makes sidekiq to watch for redis-delivered notifications. This makes be able to send notification to interrupt running sidekiq jobs. This does not take into account any native code, as `Thread.raise` generates exception once the control gets back to Ruby. The separate measure should be taken to interrupt gRPC, shellouts, or anything else that escapes Ruby.
* Standardize remote_ip and path keys for auth.log and api_json.logStan Hu2019-08-201-2/+2
| | | | | | | | Current `auth.log` uses `fullpath` and `ip`, while `api_json.log` uses `remote_ip` and `path` for the same fields. Let's standardize these namings to make it easier for people working with the data. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66167
* Merge branch 'qa-backport-fix-remaining-prepend-lines' into 'master'Rémy Coutable2019-08-191-0/+2
|\ | | | | | | | | Update qa/Dockerfile to be built from the project root context See merge request gitlab-org/gitlab-ce!31533
| * Support X_if_ee methods for QA testsYorick Peterse2019-08-191-0/+2
| | | | | | | | | | For the QA tests to use the new injection methods, we must require the initializer and ensure that the "constantize" method is available.
* | Clean Sidekiq metrics from multiproc dir on startAleksei Lipniagov2019-08-191-0/+3
|/ | | | | | | After moving the multiproc dir cleanup into `config.ru`:`warmup`, we stopped cleaning Sidekiq metrics dir which is not correct. This MR intended to fix that. More details: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31668
* Merge branch ↵Grzegorz Bizon2019-08-161-1/+1
|\ | | | | | | | | | | | | | | | | '47003-user-onboarding-replace-current-email-confirmation-flow-with-a-soft-email-confirmation-flow' into 'master' Soft email confirmation flow Closes #47003 See merge request gitlab-org/gitlab-ce!31245
| * Set Devise's allow_unconfirmed_access_forAlex Buijs2019-08-081-1/+1
| | | | | | | | to 30 days
* | Merge branch ↵Stan Hu2019-08-141-0/+7
|\ \ | | | | | | | | | | | | | | | | | | '46548-open-source-alternative-to-recaptcha-for-gitlab-com-registration' into 'master' Open source alternative to reCAPTCHA for GitLab.com registration See merge request gitlab-org/gitlab-ce!31625
| * | Add invisible captchaAlex Buijs2019-08-101-0/+7
| | | | | | | | | | | | | | | | | | With a time treshold of 4 seconds and a firstname and lastname honeypot input fields when signing up
* | | Merge branch '328-versioned-search-ee' into 'master'Nick Thomas2019-08-141-39/+35
|\ \ \ | | | | | | | | | | | | | | | | Elasticsearch versioned schema for Snippet See merge request gitlab-org/gitlab-ce!31465
| * | | ES: sync with EE328-versioned-search-eeMark Chao2019-08-121-39/+35
| |/ /
* | | Fix metric files being wiped after the app startsAleksei Lipniagov2019-08-121-19/+0
|/ / | | | | | | | | | | | | | | | | When we hit our app with the initial request, in `warmup`, some metrics already being created as well as corresponding files. If we do `multiproc_file_dir` cleanup after that, we delete the files from the dir while keeping them in memory which leads to the incorrect behavior: the metric is being updated in in-memory, while is not present in the db, not sent to Prometheus as the result.
* | Add Gitaly and Rugged call timing in Sidekiq logsStan Hu2019-08-092-13/+2
|/ | | | | | | | | | This will help identify Sidekiq jobs that invoke excessive number of filesystem access. The timing data is stored in `RequestStore`, but this is only active within the middleware and is not directly accessible to the Sidekiq logger. However, it is possible for the middleware to modify the job hash to pass this data along to the logger.
* Merge branch 'sh-support-csp-nonce' into 'master'Ash McKenzie2019-08-072-0/+16
|\ | | | | | | | | | | | | Add support for Content-Security-Policy Closes #65330 See merge request gitlab-org/gitlab-ce!31402
| * Add support for Content-Security-PolicyStan Hu2019-08-072-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A nonce-based Content-Security-Policy thwarts XSS attacks by allowing inline JavaScript to execute if the script nonce matches the header value. Rails 5.2 supports nonce-based Content-Security-Policy headers, so provide configuration to enable this and make it work. To support this, we need to change all `:javascript` HAML filters to the following form: ``` = javascript_tag nonce: true do :plain ... ``` We use `%script` throughout our HAML to store JSON and other text, but since this doesn't execute, browsers don't appear to block this content from being used and require the nonce value to be present.
* | Remove GC metrics from performance barSean McGivern2019-08-061-5/+0
|/ | | | | | These were disabled in production mode, but that also broke the rest of the performance bar. As they were only enabled in development mode, we can just remove them for now.
* Revert "Merge branch 'backport-fix-remaining-prepend-lines' into 'master'"Mark Lapierre2019-08-051-2/+0
| | | This reverts merge request !31379
* Merge branch 'backport-fix-remaining-prepend-lines' into 'master'Robert Speicher2019-08-021-0/+2
|\ | | | | | | | | Support X_if_ee methods for QA tests See merge request gitlab-org/gitlab-ce!31379
| * Support X_if_ee methods for QA testsbackport-fix-remaining-prepend-linesYorick Peterse2019-08-011-0/+2
| | | | | | | | | | For the QA tests to use the new injection methods, we must require the initializer and ensure that the "constantize" method is available.
* | Call `GC::Profiler.clear` only in one placeAleksei Lipniagov2019-08-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, both InfluxSampler and RubySampler were relying on the `GC::Profiler.total_time` data which is the sum over the list of captured GC events. Also, both samplers asynchronously called `GC::Profiler.clear` which led to incorrect metric data because each sampler has the wrong assumption it is the only object who calls `GC::Profiler.clear` and thus could rely on the gathered results between such calls. We should ensure that `GC::Profiler.total_time` is called only in one place making it possible to rely on accumulated data between such wipes. Also, we need to track the amount of profiler reports we lost.
* | Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3809ce-docker_image_replicationValery Sizov2019-08-012-0/+10
|/ | | | Introducing Docker Registry replication
* 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