From cb2287df0ad9396d1f075bde1c4f6de481d908e6 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Fri, 9 Jun 2017 01:50:11 +0300 Subject: Notes bundle for the issue discussions refactor. --- config/webpack.config.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index a7d92bc53b7..bcc64b1fccd 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -51,6 +51,7 @@ var config = { monitoring: './monitoring/monitoring_bundle.js', network: './network/network_bundle.js', notebook_viewer: './blob/notebook_viewer.js', + notes: './notes/index.js', pdf_viewer: './blob/pdf_viewer.js', pipelines: './pipelines/pipelines_bundle.js', pipelines_details: './pipelines/pipeline_details_bundle.js', @@ -166,6 +167,7 @@ var config = { 'merge_conflicts', 'monitoring', 'notebook_viewer', + 'notes', 'pdf_viewer', 'pipelines', 'pipelines_details', -- cgit v1.2.1 From 76c3d2d434d3c550c3de912abc0a5b1dc1455368 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 9 Jun 2017 16:24:54 -0500 Subject: Add full JSON endpoints for issue notes and discussions --- config/routes/project.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes/project.rb b/config/routes/project.rb index 672b5a9a160..d6fb309de8e 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -308,6 +308,7 @@ constraints(ProjectUrlConstrainer.new) do get :can_create_branch get :realtime_changes post :create_merge_request + get :discussions, format: :json end collection do post :bulk_update -- cgit v1.2.1 From 9770c57fab0315865a33c8b6df269eded0d57b5c Mon Sep 17 00:00:00 2001 From: Brian Neel Date: Thu, 3 Aug 2017 22:20:34 -0400 Subject: Re-enable SqlInjection and CommandInjection --- config/application.rb | 2 +- config/initializers/active_record_locking.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index 47887bf8596..f69dab4de39 100644 --- a/config/application.rb +++ b/config/application.rb @@ -176,7 +176,7 @@ module Gitlab next unless name.include?('namespace_project') define_method(name.sub('namespace_project', 'project')) do |project, *args| - send(name, project&.namespace, project, *args) + send(name, project&.namespace, project, *args) # rubocop:disable GitlabSecurity/PublicSend end end end diff --git a/config/initializers/active_record_locking.rb b/config/initializers/active_record_locking.rb index 9266ff0f615..150aaa2a8c2 100644 --- a/config/initializers/active_record_locking.rb +++ b/config/initializers/active_record_locking.rb @@ -18,7 +18,7 @@ module ActiveRecord lock_col = self.class.locking_column - previous_lock_value = send(lock_col).to_i + previous_lock_value = send(lock_col).to_i # rubocop:disable GitlabSecurity/PublicSend # This line is added as a patch previous_lock_value = nil if previous_lock_value == '0' || previous_lock_value == 0 @@ -48,7 +48,7 @@ module ActiveRecord # If something went wrong, revert the version. rescue Exception - send(lock_col + '=', previous_lock_value) + send(lock_col + '=', previous_lock_value) # rubocop:disable GitlabSecurity/PublicSend raise end end -- cgit v1.2.1 From c946ee1282655d332da4ba99c448d6f68cf87cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 9 Aug 2017 11:52:22 +0200 Subject: Enable the Layout/SpaceBeforeBlockBraces cop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/1_settings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 2699173fc61..5c6578d3531 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -71,7 +71,7 @@ class Settings < Settingslogic # check that `current` (string or integer) is a contant in `modul`. def verify_constant(modul, current, default) - constant = modul.constants.find{ |name| modul.const_get(name) == current } + constant = modul.constants.find { |name| modul.const_get(name) == current } value = constant.nil? ? default : modul.const_get(constant) if current.is_a? String value = modul.const_get(current.upcase) rescue default -- cgit v1.2.1 From 892ddd386a92eeeb53973fb81802af56b800c9a4 Mon Sep 17 00:00:00 2001 From: haseeb Date: Thu, 10 Aug 2017 08:49:11 +0000 Subject: alternative route for download archive --- config/routes/repository.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/routes/repository.rb b/config/routes/repository.rb index 2ba16035ece..57b7c55423d 100644 --- a/config/routes/repository.rb +++ b/config/routes/repository.rb @@ -3,6 +3,9 @@ resource :repository, only: [:create] do member do get ':ref/archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex, ref: /.+/ }, action: 'archive', as: 'archive' + + # deprecated since GitLab 9.5 + get 'archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex }, as: 'archive_alternative' end end -- cgit v1.2.1 From 180de2d20127f79773bf661f88cd7556b191d0b9 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 7 Aug 2017 19:43:11 +0200 Subject: Make sure uploads for personal snippets are correctly rendered --- config/routes/uploads.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index e9c9aa8b2f9..d7bca8310e4 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -5,12 +5,12 @@ scope path: :uploads do constraints: { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ } # show uploads for models, snippets (notes) available for now - get 'system/:model/:id/:secret/:filename', + get '-/system/:model/:id/:secret/:filename', to: 'uploads#show', constraints: { model: /personal_snippet/, id: /\d+/, filename: /[^\/]+/ } # show temporary uploads - get 'system/temp/:secret/:filename', + get '-/system/temp/:secret/:filename', to: 'uploads#show', constraints: { filename: /[^\/]+/ } -- cgit v1.2.1 From 260c8da060a6039cbd47cfe31c8ec6d6f9b43de0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 10 Aug 2017 12:39:26 -0400 Subject: Whitelist or fix additional `Gitlab/PublicSend` cop violations An upcoming update to rubocop-gitlab-security added additional violations. --- config/initializers/1_settings.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 5c6578d3531..38ade18bdc0 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -1,3 +1,5 @@ +# rubocop:disable GitlabSecurity/PublicSend + require_dependency Rails.root.join('lib/gitlab') # Load Gitlab as soon as possible class Settings < Settingslogic -- cgit v1.2.1 From 69c9c83a487e9380a4fc3c318506d45c1680f0d9 Mon Sep 17 00:00:00 2001 From: Joshua Lambert Date: Mon, 14 Aug 2017 16:23:32 +0000 Subject: Improve Prometheus docs, include nginx ingress --- config/prometheus/additional_metrics.yml | 38 ++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/prometheus/additional_metrics.yml b/config/prometheus/additional_metrics.yml index 5eb01d62924..0642a0b2fe9 100644 --- a/config/prometheus/additional_metrics.yml +++ b/config/prometheus/additional_metrics.yml @@ -1,3 +1,33 @@ +- group: Response metrics (NGINX Ingress) + priority: 10 + metrics: + - title: "Throughput" + y_label: "Requests / Sec" + required_metrics: + - nginx_upstream_requests_total + weight: 1 + queries: + - query_range: 'sum(rate(nginx_upstream_requests_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m]))' + label: Total + unit: req / sec + - title: "Latency" + y_label: "Latency (ms)" + required_metrics: + - nginx_upstream_response_msecs_avg + weight: 1 + queries: + - query_range: 'avg(nginx_upstream_response_msecs_avg{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"})' + label: Average + unit: ms + - title: "HTTP Error Rate" + y_label: "HTTP 500 Errors / Sec" + required_metrics: + - nginx_upstream_responses_total + weight: 1 + queries: + - query_range: 'sum(rate(nginx_upstream_responses_total{status_code="5xx", upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[2m]))' + label: HTTP Errors + unit: "errors / sec" - group: Response metrics (HA Proxy) priority: 10 metrics: @@ -68,18 +98,18 @@ - nginx_upstream_response_msecs_avg weight: 1 queries: - - query_range: 'avg(nginx_upstream_response_msecs_avg{%{environment_filter}}) * 1000' + - query_range: 'avg(nginx_upstream_response_msecs_avg{%{environment_filter}})' label: Upstream unit: ms - title: "HTTP Error Rate" - y_label: "Error Rate (%)" + y_label: "HTTP 500 Errors / Sec" required_metrics: - nginx_responses_total weight: 1 queries: - - query_range: 'sum(rate(nginx_responses_total{status_code="5xx", %{environment_filter}}[2m])) / sum(rate(nginx_requests_total{server_zone!="*", server_zone!="_", %{environment_filter}}[2m]))' + - query_range: 'sum(rate(nginx_responses_total{status_code="5xx", %{environment_filter}}[2m]))' label: HTTP Errors - unit: "%" + unit: "errors / sec" - group: System metrics (Kubernetes) priority: 5 metrics: -- cgit v1.2.1 From 60ed4aa568889e869b0e447dffdd1af7bbb51cae Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 8 Aug 2017 08:42:24 -0500 Subject: enable webpack scope hoisting --- config/webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 8e1b80cd39f..6a347c2e660 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -223,6 +223,9 @@ var config = { names: ['main', 'locale', 'common', 'webpack_runtime'], }), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // copy pre-compiled vendor libraries verbatim new CopyWebpackPlugin([ { -- cgit v1.2.1 From d6515aa3e427b8b1944086a10357fd34b1a91515 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 15 Aug 2017 19:07:28 +0800 Subject: Make sure MySQL would not use CURRENT_TIMESTAMP for timestamp columns magically. See: https://gitlab.com/gitlab-org/gitlab-ce/issues/36405 --- .../initializers/active_record_mysql_timestamp.rb | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 config/initializers/active_record_mysql_timestamp.rb (limited to 'config') diff --git a/config/initializers/active_record_mysql_timestamp.rb b/config/initializers/active_record_mysql_timestamp.rb new file mode 100644 index 00000000000..af74c4ff6fb --- /dev/null +++ b/config/initializers/active_record_mysql_timestamp.rb @@ -0,0 +1,30 @@ +# Make sure that MySQL won't try to use CURRENT_TIMESTAMP when the timestamp +# column is NOT NULL. See https://gitlab.com/gitlab-org/gitlab-ce/issues/36405 +# And also: https://bugs.mysql.com/bug.php?id=75098 +# This patch was based on: +# https://github.com/rails/rails/blob/15ef55efb591e5379486ccf53dd3e13f416564f6/activerecord/lib/active_record/connection_adapters/mysql/schema_creation.rb#L34-L36 + +if Gitlab::Database.mysql? + require 'active_record/connection_adapters/abstract/schema_creation' + + module MySQLTimestampFix + def add_column_options!(sql, options) + # By default, TIMESTAMP columns are NOT NULL, cannot contain NULL values, + # and assigning NULL assigns the current timestamp. To permit a TIMESTAMP + # column to contain NULL, explicitly declare it with the NULL attribute. + # See http://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html + if sql.end_with?('timestamp') && !options[:primary_key] + if options[:null] != false + sql << ' NULL' + elsif options[:column].default.nil? + sql << ' DEFAULT 0' + end + end + + super + end + end + + ActiveRecord::ConnectionAdapters::AbstractAdapter::SchemaCreation + .prepend(MySQLTimestampFix) +end -- cgit v1.2.1 From 4edfad96784e8f77ec8ead26f01b4012977ba58a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 15 Aug 2017 13:44:37 -0400 Subject: Enable Layout/TrailingWhitespace cop and auto-correct offenses --- config/initializers/0_acts_as_taggable.rb | 2 +- config/initializers/static_files.rb | 10 +++++----- config/initializers/trusted_proxies.rb | 2 +- config/routes/repository.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/initializers/0_acts_as_taggable.rb b/config/initializers/0_acts_as_taggable.rb index 54e9fcc31db..50dc47673ab 100644 --- a/config/initializers/0_acts_as_taggable.rb +++ b/config/initializers/0_acts_as_taggable.rb @@ -5,5 +5,5 @@ ActsAsTaggableOn.strict_case_match = true ActsAsTaggableOn.tags_counter = false # validate that counter cache is disabled -raise "Counter cache is not disabled" if +raise "Counter cache is not disabled" if ActsAsTaggableOn::Tagging.reflections["tag"].options[:counter_cache] diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb index 9ed96ddb0b4..943e01f1496 100644 --- a/config/initializers/static_files.rb +++ b/config/initializers/static_files.rb @@ -1,15 +1,15 @@ app = Rails.application if app.config.serve_static_files - # The `ActionDispatch::Static` middleware intercepts requests for static files - # by checking if they exist in the `/public` directory. + # The `ActionDispatch::Static` middleware intercepts requests for static files + # by checking if they exist in the `/public` directory. # We're replacing it with our `Gitlab::Middleware::Static` that does the same, # except ignoring `/uploads`, letting those go through to the GitLab Rails app. app.config.middleware.swap( - ActionDispatch::Static, - Gitlab::Middleware::Static, - app.paths["public"].first, + ActionDispatch::Static, + Gitlab::Middleware::Static, + app.paths["public"].first, app.config.static_cache_control ) diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb index fc4f02453d7..0c32528311e 100644 --- a/config/initializers/trusted_proxies.rb +++ b/config/initializers/trusted_proxies.rb @@ -2,7 +2,7 @@ # as the ActionDispatch::Request object. This is necessary for libraries # like rack_attack where they don't use ActionDispatch, and we want them # to block/throttle requests on private networks. -# Rack Attack specific issue: https://github.com/kickstarter/rack-attack/issues/145 +# Rack Attack specific issue: https://github.com/kickstarter/rack-attack/issues/145 module Rack class Request def trusted_proxy?(ip) diff --git a/config/routes/repository.rb b/config/routes/repository.rb index 57b7c55423d..9ffdebbcff1 100644 --- a/config/routes/repository.rb +++ b/config/routes/repository.rb @@ -3,7 +3,7 @@ resource :repository, only: [:create] do member do get ':ref/archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex, ref: /.+/ }, action: 'archive', as: 'archive' - + # deprecated since GitLab 9.5 get 'archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex }, as: 'archive_alternative' end -- cgit v1.2.1 From ee603a0089520ae22a97d9f5f5d7d083c2fe24ce Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Sun, 13 Aug 2017 14:52:44 +0200 Subject: Allow a `failure_wait_time` of 0 for storage access This allows testing every storage attempt after a failure. Which could be useful for tests --- config/initializers/6_validations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/initializers/6_validations.rb b/config/initializers/6_validations.rb index 92ce4dd03cd..f8e67ce04c9 100644 --- a/config/initializers/6_validations.rb +++ b/config/initializers/6_validations.rb @@ -37,12 +37,12 @@ def validate_storages_config storage_validation_error("#{name} is not a valid storage, because it has no `path` key. Refer to gitlab.yml.example for an updated example") end - %w(failure_count_threshold failure_wait_time failure_reset_time storage_timeout).each do |setting| + %w(failure_count_threshold failure_reset_time storage_timeout).each do |setting| # Falling back to the defaults is fine! next if repository_storage[setting].nil? unless repository_storage[setting].to_f > 0 - storage_validation_error("#{setting}, for storage `#{name}` needs to be greater than 0") + storage_validation_error("`#{setting}` for storage `#{name}` needs to be greater than 0") end end end -- cgit v1.2.1 From 93d56eb2a5763cb5f1ac89610bb2e1dc7f77a04a Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Sun, 13 Aug 2017 14:53:49 +0200 Subject: Use better higher threshold settings for storage access in tests `failure_count_threshold`: We should never need this, but we don't want to block access in tests because of this. `failure_wait_time`: Setting it to 0 now allows each storage attempt `storage_timeout`: Try a bit longer to access storage on CI in case the slow machines take a bit longer to spin up the process to perfom the check --- config/gitlab.yml.example | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index e73db08fcac..25285525846 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -649,6 +649,9 @@ test: default: path: tmp/tests/repositories/ gitaly_address: unix:tmp/tests/gitaly/gitaly.socket + failure_count_threshold: 999999 + failure_wait_time: 0 + storage_timeout: 30 broken: path: tmp/tests/non-existent-repositories gitaly_address: unix:tmp/tests/gitaly/gitaly.socket -- cgit v1.2.1 From ba7251fefd92b0ecb6365cfe55510e24c5343ac6 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 15 Aug 2017 13:22:55 +0200 Subject: Only create commit GPG signature when necessary --- .../initializers/active_record_array_type_casting.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/initializers/active_record_array_type_casting.rb (limited to 'config') diff --git a/config/initializers/active_record_array_type_casting.rb b/config/initializers/active_record_array_type_casting.rb new file mode 100644 index 00000000000..d94d592add6 --- /dev/null +++ b/config/initializers/active_record_array_type_casting.rb @@ -0,0 +1,20 @@ +module ActiveRecord + class PredicateBuilder + class ArrayHandler + module TypeCasting + def call(attribute, value) + # This is necessary because by default ActiveRecord does not respect + # custom type definitions (like our `ShaAttribute`) when providing an + # array in `where`, like in `where(commit_sha: [sha1, sha2, sha3])`. + model = attribute.relation&.engine + type = model.user_provided_columns[attribute.name] if model + value = value.map { |value| type.type_cast_for_database(value) } if type + + super(attribute, value) + end + end + + prepend TypeCasting + end + end +end -- cgit v1.2.1 From 1c3a2bc38987a659319314953a1a90263e329c3b Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Thu, 17 Aug 2017 15:05:56 -0700 Subject: Setup LDAP settings properly --- config/initializers/1_settings.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 38ade18bdc0..5de46eddab6 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -139,6 +139,8 @@ if Settings.ldap['enabled'] || Rails.env.test? end Settings.ldap['servers'].each do |key, server| + server = Settingslogic.new(server) + server['label'] ||= 'LDAP' server['timeout'] ||= 10.seconds server['block_auto_created_users'] = false if server['block_auto_created_users'].nil? @@ -165,6 +167,8 @@ if Settings.ldap['enabled'] || Rails.env.test? MSG Rails.logger.warn(message) end + + Settings.ldap['servers'][key] = server end end -- cgit v1.2.1 From a037a79130f7207840baf016316a62e5619ba98e Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Thu, 17 Aug 2017 15:09:03 -0700 Subject: Setup repositories settings properly --- config/initializers/1_settings.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 5de46eddab6..abaabad5d65 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -440,7 +440,9 @@ unless Settings.repositories.storages['default'] Settings.repositories.storages['default']['path'] ||= Settings.gitlab['user_home'] + '/repositories/' end -Settings.repositories.storages.values.each do |storage| +Settings.repositories.storages.each do |key, storage| + storage = Settingslogic.new(storage) + # Expand relative paths storage['path'] = Settings.absolute(storage['path']) # Set failure defaults @@ -454,6 +456,8 @@ Settings.repositories.storages.values.each do |storage| storage['failure_reset_time'] = storage['failure_reset_time'].to_i # We might want to have a timeout shorter than 1 second. storage['storage_timeout'] = storage['storage_timeout'].to_f + + Settings.repositories.storages[key] = storage end # -- cgit v1.2.1 From b8458dc88edfaa342e6e297dc103def656867ef3 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 16 Aug 2017 14:39:01 -0500 Subject: remove zopfli compression temporarily until a better solution is found --- config/webpack.config.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 6a347c2e660..2637e6ab732 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -277,14 +277,9 @@ if (IS_PRODUCTION) { }) ); - // zopfli requires a lot of compute time and is disabled in CI + // compression can require a lot of compute time and is disabled in CI if (!NO_COMPRESSION) { - // gracefully fall back to gzip if `node-zopfli` is unavailable (e.g. in CentOS 6) - try { - config.plugins.push(new CompressionPlugin({ algorithm: 'zopfli' })); - } catch(err) { - config.plugins.push(new CompressionPlugin({ algorithm: 'gzip' })); - } + config.plugins.push(new CompressionPlugin()); } } -- cgit v1.2.1 From 1ffd0c8562922de0e70eef2faf71108e0eecbb51 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Fri, 18 Aug 2017 10:14:13 +0200 Subject: Remove CI API v1 This API was mainly for internal usage, and has been moved to the general API: APIv4. The endpoints have been deprecated since 9.0, and won't see 10.0. :) --- config/routes/ci.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'config') diff --git a/config/routes/ci.rb b/config/routes/ci.rb index 8d23aa8fbf6..cbd4c2db852 100644 --- a/config/routes/ci.rb +++ b/config/routes/ci.rb @@ -1,8 +1,4 @@ namespace :ci do - # CI API - Ci::API::API.logger Rails.logger - mount Ci::API::API => '/api' - resource :lint, only: [:show, :create] root to: redirect('/') -- cgit v1.2.1 From 7b26de7e8cab684103e77cafc9a301e1d90e0e07 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 18 Aug 2017 17:02:00 -0500 Subject: remove superfluous users bundle --- config/webpack.config.js | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 6a347c2e660..b336320f43e 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -76,7 +76,6 @@ var config = { terminal: './terminal/terminal_bundle.js', u2f: ['vendor/u2f'], ui_development_kit: './ui_development_kit.js', - users: './users/index.js', raven: './raven/index.js', vue_merge_request_widget: './vue_merge_request_widget/index.js', test: './test.js', -- cgit v1.2.1 From ce274fd61bbe11c7a1353bff2176273e9b30e197 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 21 Aug 2017 13:32:00 +0200 Subject: Make it possible to check if worker uses a known queue --- config/sidekiq_queues.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 83abc83c9f0..7816c0fa92e 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -27,6 +27,7 @@ - [new_merge_request, 2] - [build, 2] - [pipeline, 2] + - [pipelines-pipeline-processing, 2] - [gitlab_shell, 2] - [email_receiver, 2] - [emails_on_push, 2] -- cgit v1.2.1 From 48776f2786d22cecab97417141d43060c6cdee26 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 21 Aug 2017 13:49:57 +0200 Subject: Simplify pipeline sidekiq queues naming scheme --- config/sidekiq_queues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 7816c0fa92e..8e13ed95f19 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -27,7 +27,7 @@ - [new_merge_request, 2] - [build, 2] - [pipeline, 2] - - [pipelines-pipeline-processing, 2] + - [pipeline_processing, 2] - [gitlab_shell, 2] - [email_receiver, 2] - [emails_on_push, 2] -- cgit v1.2.1 From 8417507201809daf0554c13ffb695b8142274f4f Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 21 Aug 2017 14:02:20 +0200 Subject: Assign all pipeline workers to specific queues --- config/sidekiq_queues.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 8e13ed95f19..28cfb9419de 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -28,6 +28,9 @@ - [build, 2] - [pipeline, 2] - [pipeline_processing, 2] + - [pipeline_cache, 2] + - [pipeline_metrics, 2] + - [pipeline_hooks, 2] - [gitlab_shell, 2] - [email_receiver, 2] - [emails_on_push, 2] -- cgit v1.2.1 From ad12ee2a78ed590194661b3d5365b0eaa14bff80 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 21 Aug 2017 14:24:05 +0200 Subject: Assign some CI/CD workers to pipeline default queue --- config/sidekiq_queues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 28cfb9419de..2eeb0762b76 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -28,8 +28,8 @@ - [build, 2] - [pipeline, 2] - [pipeline_processing, 2] + - [pipeline_default, 2] - [pipeline_cache, 2] - - [pipeline_metrics, 2] - [pipeline_hooks, 2] - [gitlab_shell, 2] - [email_receiver, 2] -- cgit v1.2.1 From 82056644d5c3be0b9cc4a268ff367944472bb11e Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 21 Aug 2017 14:25:58 +0200 Subject: Adjust sidekiq queues weights in queues config file --- config/sidekiq_queues.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 2eeb0762b76..24c001362c6 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -27,9 +27,9 @@ - [new_merge_request, 2] - [build, 2] - [pipeline, 2] - - [pipeline_processing, 2] - - [pipeline_default, 2] - - [pipeline_cache, 2] + - [pipeline_processing, 5] + - [pipeline_default, 3] + - [pipeline_cache, 3] - [pipeline_hooks, 2] - [gitlab_shell, 2] - [email_receiver, 2] -- cgit v1.2.1 From e9bd73e1e9634b044f0856632dd2697d954b09ce Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Mon, 21 Aug 2017 11:23:52 -0500 Subject: disable webpack.optimize.ModuleConcatenationPlugin during karma tests --- config/karma.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index 2f571978e08..e459f5cdac3 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -8,6 +8,7 @@ if (webpackConfig.plugins) { webpackConfig.plugins = webpackConfig.plugins.filter(function (plugin) { return !( plugin instanceof webpack.optimize.CommonsChunkPlugin || + plugin instanceof webpack.optimize.ModuleConcatenationPlugin || plugin instanceof webpack.DefinePlugin ); }); -- cgit v1.2.1 From 539dee96739f1dd8925bd890ec2f9549775a949a Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 21 Aug 2017 17:50:34 +0200 Subject: Update form to properly set the path Also includes a change in allowing uploaded files, as there was a mismatch in object_id between classes, disallowing params[:file], which is a UploadedFile, newly loaded. The params checked against the older version. Fixes gitlab-org/gitlab-ce#36519 --- config/initializers/workhorse_multipart.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'config') diff --git a/config/initializers/workhorse_multipart.rb b/config/initializers/workhorse_multipart.rb index 064e5964f09..4196e3a8f61 100644 --- a/config/initializers/workhorse_multipart.rb +++ b/config/initializers/workhorse_multipart.rb @@ -10,10 +10,8 @@ end # module Gitlab module StrongParameterScalars - GITLAB_PERMITTED_SCALAR_TYPES = [::UploadedFile].freeze - def permitted_scalar?(value) - super || GITLAB_PERMITTED_SCALAR_TYPES.any? { |type| value.is_a?(type) } + super || value.is_a?(::UploadedFile) end end end -- cgit v1.2.1 From f8865e9c1303be7302306bea9dd1057bf3b3f608 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 26 Jul 2017 11:57:05 +0200 Subject: Define ldap methods at runtime This avoids loading the `OmniAuthCallbacksController` at boot time so it doesn't mess up the `before_action`-chain --- config/initializers/omniauth.rb | 6 ------ 1 file changed, 6 deletions(-) (limited to 'config') diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 56c279ffcf4..fddb018e948 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -6,12 +6,6 @@ if Gitlab::LDAP::Config.enabled? const_set(server['provider_class'], Class.new(LDAP)) end end - - OmniauthCallbacksController.class_eval do - Gitlab::LDAP::Config.available_servers.each do |server| - alias_method server['provider_name'], :ldap - end - end end OmniAuth.config.full_host = Settings.gitlab['base_url'] -- cgit v1.2.1 From ad097512c9eb918e1fe83f502286fb8fed31ff50 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Mon, 21 Aug 2017 12:50:06 -0500 Subject: fix deprecation warning present during webpack compiles --- config/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 6a347c2e660..a75f9e86fd6 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -171,7 +171,7 @@ var config = { if (chunk.name) { return chunk.name; } - return chunk.modules.map((m) => { + return chunk.mapModules((m) => { var chunkPath = m.request.split('!').pop(); return path.relative(m.context, chunkPath); }).join('_'); -- cgit v1.2.1 From 7ba19ab620f5e89a6ff15df8603b315cd154bc6c Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Mon, 28 Aug 2017 15:21:05 +0200 Subject: Instrument MergeRequest#ensure_ref_fetched --- config/initializers/8_metrics.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 2aeb94d47cd..370a976b64a 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -119,6 +119,9 @@ def instrument_classes(instrumentation) # Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159 instrumentation.instrument_instance_method(MergeRequestDiff, :load_commits) + + # Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/36061 + instrumentation.instrument_instance_method(MergeRequest, :ensure_ref_fetched) end # rubocop:enable Metrics/AbcSize -- cgit v1.2.1 From f2a43ff5b7eec188ffc470649bf40d268cbdce2a Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Mon, 28 Aug 2017 18:56:49 -0300 Subject: Group boards CE backport --- config/routes.rb | 13 +++++++++++++ config/routes/project.rb | 14 +------------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 4fd6cb5d439..5d7166cad9a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -73,6 +73,19 @@ Rails.application.routes.draw do # Notification settings resources :notification_settings, only: [:create, :update] + # Boards resources shared between group and projects + resources :boards do + resources :lists, module: :boards, only: [:index, :create, :update, :destroy] do + collection do + post :generate + end + + resources :issues, only: [:index, :create, :update] + end + + resources :issues, module: :boards, only: [:index, :update] + end + draw :import draw :uploads draw :explore diff --git a/config/routes/project.rb b/config/routes/project.rb index 06928c7b9ce..3c7c218c356 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -341,19 +341,7 @@ constraints(ProjectUrlConstrainer.new) do get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes' - resources :boards, only: [:index, :show] do - scope module: :boards do - resources :issues, only: [:index, :update] - - resources :lists, only: [:index, :create, :update, :destroy] do - collection do - post :generate - end - - resources :issues, only: [:index, :create] - end - end - end + resources :boards, only: [:index, :show, :create, :update, :destroy] resources :todos, only: [:create] -- cgit v1.2.1 From eb51ec08941df7d1d0593e14df378ee380c5369c Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Tue, 29 Aug 2017 15:45:19 +0200 Subject: Update Prometheus Client MMAP gem to version that fixes performance degradation caused by workers churn --- config/initializers/7_prometheus_metrics.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb index 54c797e0714..31839297523 100644 --- a/config/initializers/7_prometheus_metrics.rb +++ b/config/initializers/7_prometheus_metrics.rb @@ -1,4 +1,5 @@ require 'prometheus/client' +require 'prometheus/client/support/unicorn' Prometheus::Client.configure do |config| config.logger = Rails.logger @@ -9,6 +10,8 @@ Prometheus::Client.configure do |config| if Rails.env.development? || Rails.env.test? config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir') end + + config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider) end Sidekiq.configure_server do |config| -- cgit v1.2.1 From 7187395ef13d8d84a145d1b5251882ebada3f7f2 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Wed, 30 Aug 2017 07:48:55 +0000 Subject: Add filter by my reaction --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 4fd6cb5d439..ce7ab1d20f6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,6 +27,7 @@ Rails.application.routes.draw do get '/autocomplete/users' => 'autocomplete#users' get '/autocomplete/users/:id' => 'autocomplete#user' get '/autocomplete/projects' => 'autocomplete#projects' + get '/autocomplete/award_emojis' => 'autocomplete#award_emojis' # Search get 'search' => 'search#show' -- cgit v1.2.1 From dd3e7ff036401b4c3b754a24bfdf9248ae8a8fe5 Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Tue, 29 Aug 2017 16:47:43 -0700 Subject: Default LDAP config verify_certificates to true --- config/gitlab.yml.example | 5 ++--- config/initializers/1_settings.rb | 17 +++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 25285525846..545c01e1156 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -273,9 +273,8 @@ production: &base encryption: 'plain' # Enables SSL certificate verification if encryption method is - # "start_tls" or "simple_tls". (Defaults to false for backward- - # compatibility) - verify_certificates: false + # "start_tls" or "simple_tls". Defaults to true. + verify_certificates: true # Specifies the path to a file containing a PEM-format CA certificate, # e.g. if you need to use an internal CA. diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index abaabad5d65..360b72cdea3 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -155,18 +155,11 @@ if Settings.ldap['enabled'] || Rails.env.test? server['encryption'] = 'simple_tls' if server['encryption'] == 'ssl' server['encryption'] = 'start_tls' if server['encryption'] == 'tls' - # Certificates are not verified for backwards compatibility. - # This default should be flipped to true in 9.5. - if server['verify_certificates'].nil? - server['verify_certificates'] = false - - message = <<-MSG.strip_heredoc - LDAP SSL certificate verification is disabled for backwards-compatibility. - Please add the "verify_certificates" option to gitlab.yml for each LDAP - server. Certificate verification will be enabled by default in GitLab 9.5. - MSG - Rails.logger.warn(message) - end + # Certificate verification was added in 9.4.2, and defaulted to false for + # backwards-compatibility. + # + # Since GitLab 10.0, verify_certificates defaults to true for security. + server['verify_certificates'] = true if server['verify_certificates'].nil? Settings.ldap['servers'][key] = server end -- cgit v1.2.1 From d74fecac031df1c3b4e817f49f7bafe2b175be11 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 30 Aug 2017 21:14:29 -0700 Subject: Filter additional secrets from Rails logs Upon inspection of logs, there were a number of fields not filtered. For example: * authenticity_token: CSRF token * rss_token: Used for RSS feeds * secret: Used with Projects::UploadController Rails provides a way to match regexps, so we now filter: * Any parameter ending with `_token` * Any parameter containing `password` * Any parameter containing `secret` --- config/application.rb | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index f69dab4de39..32a290f2002 100644 --- a/config/application.rb +++ b/config/application.rb @@ -51,31 +51,24 @@ module Gitlab # Configure sensitive parameters which will be filtered from the log file. # # Parameters filtered: - # - Password (:password, :password_confirmation) - # - Private tokens + # - Any parameter ending with `_token` + # - Any parameter containing `password` + # - Any parameter containing `secret` # - Two-factor tokens (:otp_attempt) # - Repo/Project Import URLs (:import_url) # - Build variables (:variables) # - GitLab Pages SSL cert/key info (:certificate, :encrypted_key) # - Webhook URLs (:hook) - # - GitLab-shell secret token (:secret_token) # - Sentry DSN (:sentry_dsn) # - Deploy keys (:key) + config.filter_parameters += [/_token$/, /password/, /secret/] config.filter_parameters += %i( - authentication_token certificate encrypted_key hook import_url - incoming_email_token - rss_token key otp_attempt - password - password_confirmation - private_token - runners_token - secret_token sentry_dsn variables ) -- cgit v1.2.1 From 1eb30cfb758d9fa576f1164fe7c5f520867ce378 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Thu, 20 Jul 2017 08:54:27 +0200 Subject: Ignore fuzzy translations --- config/initializers/fast_gettext.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb index eb589ecdb52..fd0167aa476 100644 --- a/config/initializers/fast_gettext.rb +++ b/config/initializers/fast_gettext.rb @@ -1,4 +1,7 @@ -FastGettext.add_text_domain 'gitlab', path: File.join(Rails.root, 'locale'), type: :po +FastGettext.add_text_domain 'gitlab', + path: File.join(Rails.root, 'locale'), + type: :po, + ignore_fuzzy: true FastGettext.default_text_domain = 'gitlab' FastGettext.default_available_locales = Gitlab::I18n.available_locales FastGettext.default_locale = :en -- cgit v1.2.1 From 5883ce95efcc4cc04f949f9b4e66d73fbede94e2 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Thu, 31 Aug 2017 10:47:03 +0100 Subject: `current_application_settings` belongs on `Gitlab::CurrentSettings` The initializers including this were doing so at the top level, so every object loaded after them had a `current_application_settings` method. However, if someone had rack-attack enabled (which was loaded before these initializers), it would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't have that method. To fix this: 1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need `Object.new.current_application_settings` to work. 2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it like that in several places. 3. Change the initializers to use that new form. --- config/initializers/sentry.rb | 5 ++--- config/initializers/session_store.rb | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'config') diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 6b0cff75653..62d0967009a 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,19 +1,18 @@ # Be sure to restart your server when you modify this file. require 'gitlab/current_settings' -include Gitlab::CurrentSettings if Rails.env.production? # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done begin - sentry_enabled = current_application_settings.sentry_enabled + sentry_enabled = Gitlab::CurrentSettings.current_application_settings.sentry_enabled rescue sentry_enabled = false end if sentry_enabled Raven.configure do |config| - config.dsn = current_application_settings.sentry_dsn + config.dsn = Gitlab::CurrentSettings.current_application_settings.sentry_dsn config.release = Gitlab::REVISION # Sanitize fields based on those sanitized from Rails. diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index e8213ac8ba4..f2fde1e0048 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,11 +1,10 @@ # Be sure to restart your server when you modify this file. require 'gitlab/current_settings' -include Gitlab::CurrentSettings # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done begin - Settings.gitlab['session_expire_delay'] = current_application_settings.session_expire_delay || 10080 + Settings.gitlab['session_expire_delay'] = Gitlab::CurrentSettings.current_application_settings.session_expire_delay || 10080 rescue Settings.gitlab['session_expire_delay'] ||= 10080 end -- cgit v1.2.1 From 6ed490401f49a8941dc7a9e3757ec4012f14ef0b Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 24 Aug 2017 13:01:33 +0200 Subject: Implement the implied CI/CD config for AutoDevOps Behind an application setting, which defaults to false, this commit implements the implied CI/CD config. Which means that in the case we can't find the `.gitlab-ci.yml` on the commit we want to start a pipeline for, we fall back to an implied configuration. For now the Bash template has been copied to `Auto-Devops.gitlab-ci.yml` so the tests actually work. Fixes #34777 --- config/initializers/0_inflections.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb index f977104ff9d..1ad9ddca877 100644 --- a/config/initializers/0_inflections.rb +++ b/config/initializers/0_inflections.rb @@ -10,5 +10,10 @@ # end # ActiveSupport::Inflector.inflections do |inflect| - inflect.uncountable %w(award_emoji project_statistics system_note_metadata) + inflect.uncountable %w( + award_emoji + project_statistics + system_note_metadata + project_auto_devops + ) end -- cgit v1.2.1 From 658e89a8b70b4b60581fe9fa26a1a0adb04c8039 Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Fri, 1 Sep 2017 09:36:37 +0200 Subject: Instrument MergeRequest#fetch_ref --- config/initializers/8_metrics.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 370a976b64a..5b455a8065a 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -122,6 +122,7 @@ def instrument_classes(instrumentation) # Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/36061 instrumentation.instrument_instance_method(MergeRequest, :ensure_ref_fetched) + instrumentation.instrument_instance_method(MergeRequest, :fetch_ref) end # rubocop:enable Metrics/AbcSize -- cgit v1.2.1 From 3699362e9fe2dc67247f9ea9c1b74816054b2a74 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Fri, 1 Sep 2017 18:18:08 +0100 Subject: Approve the Unlicense --- config/dependency_decisions.yml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config') diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml index ca5b941aebf..c9018f3bf0e 100644 --- a/config/dependency_decisions.yml +++ b/config/dependency_decisions.yml @@ -404,3 +404,9 @@ :why: https://github.com/mafintosh/thunky/blob/master/README.md#license :versions: [] :when: 2017-08-07 05:56:09.907045000 Z +- - :whitelist + - Unlicense + - :who: Nick Thomas + :why: https://gitlab.com/gitlab-com/organization/issues/116 + :versions: [] + :when: 2017-09-01 17:17:51.996511844 Z -- cgit v1.2.1 From 90c60138db4e1f86026aac5760febe4ba066ca30 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 14 Aug 2017 02:26:19 -0500 Subject: Move "Move to different project" to sidebar Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/34261 --- config/routes/project.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes/project.rb b/config/routes/project.rb index c703a7294ed..a15e7f8a344 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -303,6 +303,7 @@ constraints(ProjectUrlConstrainer.new) do member do post :toggle_subscription post :mark_as_spam + post :move get :referenced_merge_requests get :related_branches get :can_create_branch -- cgit v1.2.1 From 78dad4cf321eb84aa5decdea34704145adca0c3e Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 4 Sep 2017 09:27:09 +0200 Subject: Fix tests --- config/initializers/0_inflections.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb index 1ad9ddca877..da19c765f50 100644 --- a/config/initializers/0_inflections.rb +++ b/config/initializers/0_inflections.rb @@ -14,6 +14,6 @@ ActiveSupport::Inflector.inflections do |inflect| award_emoji project_statistics system_note_metadata - project_auto_devops + auto_devops ) end -- cgit v1.2.1 From d3ca6c0f25f29db220fcc67fe7070358f4543057 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 4 Sep 2017 09:41:55 +0200 Subject: Increase the timeout before aborting a storage access attempt There are peaks of IO-wait time, most of them stay below 30 seconds. --- config/gitlab.yml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 545c01e1156..c5704ac5857 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -508,7 +508,7 @@ production: &base failure_count_threshold: 10 # number of failures before stopping attempts failure_wait_time: 30 # Seconds after an access failure before allowing access again failure_reset_time: 1800 # Time in seconds to expire failures - storage_timeout: 5 # Time in seconds to wait before aborting a storage access attempt + storage_timeout: 30 # Time in seconds to wait before aborting a storage access attempt ## Backup settings -- cgit v1.2.1 From 9f48181885d2e276aa237c48a99f05601460d01e Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 4 Sep 2017 13:58:17 +0100 Subject: Add Facebook BSD+PATENTS license to the "unacceptable" list --- config/dependency_decisions.yml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config') diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml index c9018f3bf0e..d6c3c84851b 100644 --- a/config/dependency_decisions.yml +++ b/config/dependency_decisions.yml @@ -410,3 +410,9 @@ :why: https://gitlab.com/gitlab-com/organization/issues/116 :versions: [] :when: 2017-09-01 17:17:51.996511844 Z +- - :blacklist + - Facebook BSD+PATENTS + - :who: Nick Thomas + :why: https://gitlab.com/gitlab-com/organization/issues/117 + :versions: [] + :when: 2017-09-04 12:59:51.150798717 Z -- cgit v1.2.1 From bcd70c4c46ae71366580c7352ddb28075cdf0e60 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 4 Sep 2017 15:44:46 +0200 Subject: Incorporate review --- config/initializers/0_inflections.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb index da19c765f50..1ad9ddca877 100644 --- a/config/initializers/0_inflections.rb +++ b/config/initializers/0_inflections.rb @@ -14,6 +14,6 @@ ActiveSupport::Inflector.inflections do |inflect| award_emoji project_statistics system_note_metadata - auto_devops + project_auto_devops ) end -- cgit v1.2.1 From 29990051f31fcf252f14a04f8461936d62ac7f21 Mon Sep 17 00:00:00 2001 From: kushalpandya Date: Mon, 4 Sep 2017 21:22:59 +0530 Subject: Move `common_vue` into vendor bundle --- config/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index ad88e48550d..6b0cd023291 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -30,7 +30,7 @@ var config = { blob: './blob_edit/blob_bundle.js', boards: './boards/boards_bundle.js', common: './commons/index.js', - common_vue: ['vue', './vue_shared/common_vue.js'], + common_vue: './vue_shared/vue_resource_interceptor.js', common_d3: ['d3'], cycle_analytics: './cycle_analytics/cycle_analytics_bundle.js', commit_pipelines: './commit/pipelines/pipelines_bundle.js', -- cgit v1.2.1 From 4df54f260751a832ebf0b8c18524020d6604994b Mon Sep 17 00:00:00 2001 From: Alexander Keramidas Date: Tue, 29 Aug 2017 11:57:41 +0300 Subject: Profile updates from providers --- config/gitlab.yml.example | 13 ++++++++++--- config/initializers/1_settings.rb | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index c5704ac5857..e9661090844 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -372,9 +372,16 @@ production: &base # showing GitLab's sign-in page (default: show the GitLab sign-in page) # auto_sign_in_with_provider: saml - # Sync user's email address from the specified Omniauth provider every time the user logs - # in (default: nil). And consequently make this field read-only. - # sync_email_from_provider: cas3 + # Sync user's profile from the specified Omniauth providers every time the user logs in (default: empty). + # Define the allowed providers using an array, e.g. ["cas3", "saml", "twitter"], + # or as true/false to allow all providers or none. + # sync_profile_from_provider: [] + + # Select which info to sync from the providers above. (default: email). + # Define the synced profile info using an array. Available options are "name", "email" and "location" + # e.g. ["name", "email", "location"] or as true to sync all available. + # This consequently will make the selected attributes read-only. + # sync_profile_attributes: true # CAUTION! # This allows users to login without having a user account first. Define the allowed providers diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 360b72cdea3..7c1ca05a57b 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -173,7 +173,20 @@ Settings.omniauth['external_providers'] = [] if Settings.omniauth['external_prov Settings.omniauth['block_auto_created_users'] = true if Settings.omniauth['block_auto_created_users'].nil? Settings.omniauth['auto_link_ldap_user'] = false if Settings.omniauth['auto_link_ldap_user'].nil? Settings.omniauth['auto_link_saml_user'] = false if Settings.omniauth['auto_link_saml_user'].nil? -Settings.omniauth['sync_email_from_provider'] ||= nil + +Settings.omniauth['sync_profile_from_provider'] = false if Settings.omniauth['sync_profile_from_provider'].nil? +Settings.omniauth['sync_profile_attributes'] = ['email'] if Settings.omniauth['sync_profile_attributes'].nil? + +# Handle backwards compatibility with merge request 11268 +if Settings.omniauth['sync_email_from_provider'] + if Settings.omniauth['sync_profile_from_provider'].is_a?(Array) + Settings.omniauth['sync_profile_from_provider'] |= [Settings.omniauth['sync_email_from_provider']] + elsif !Settings.omniauth['sync_profile_from_provider'] + Settings.omniauth['sync_profile_from_provider'] = [Settings.omniauth['sync_email_from_provider']] + end + + Settings.omniauth['sync_profile_attributes'] |= ['email'] unless Settings.omniauth['sync_profile_attributes'] == true +end Settings.omniauth['providers'] ||= [] Settings.omniauth['cas3'] ||= Settingslogic.new({}) -- cgit v1.2.1 From 6d8e102c740b75ac9e1d168a84f532f6d9ebaa65 Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Wed, 23 Aug 2017 17:53:29 +0100 Subject: Adds cacheless render to Banzai object render --- config/initializers/8_metrics.rb | 3 --- 1 file changed, 3 deletions(-) (limited to 'config') diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 5b455a8065a..e1a59d8c152 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -114,9 +114,6 @@ def instrument_classes(instrumentation) # This is a Rails scope so we have to instrument it manually. instrumentation.instrument_method(Project, :visible_to_user) - # Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/34509 - instrumentation.instrument_method(MarkupHelper, :link_to_gfm) - # Needed for https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159 instrumentation.instrument_instance_method(MergeRequestDiff, :load_commits) -- cgit v1.2.1 From 6c49a628000605d1beb120431003abb329b9fd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20D=C3=A1vila?= Date: Thu, 17 Aug 2017 10:37:36 -0500 Subject: Restore some changes from !9199 --- config/gitlab.yml.example | 10 +++++++++- config/initializers/1_settings.rb | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index e9661090844..1ca0f263f13 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -76,6 +76,14 @@ production: &base # default_can_create_group: false # default: true # username_changing_enabled: false # default: true - User can change her username/namespace + ## Default theme ID + ## 1 - Graphite + ## 2 - Charcoal + ## 3 - Green + ## 4 - Gray + ## 5 - Violet + ## 6 - Blue + # default_theme: 2 # default: 2 ## Automatic issue closing # If a commit message matches this regular expression, all issues referenced from the matched text will be closed. @@ -741,4 +749,4 @@ test: admin_group: '' staging: - <<: *base + <<: *base \ No newline at end of file diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 7c1ca05a57b..40fbdd3ef9b 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -232,6 +232,7 @@ Settings['gitlab'] ||= Settingslogic.new({}) Settings.gitlab['default_projects_limit'] ||= 100000 Settings.gitlab['default_branch_protection'] ||= 2 Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? +Settings.gitlab['default_theme'] = Gitlab::Themes::APPLICATION_DEFAULT if Settings.gitlab['default_theme'].nil? Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost' Settings.gitlab['ssh_host'] ||= Settings.gitlab.host Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? -- cgit v1.2.1 From 3c815f97d32d78abc0eea4f0dd2397e646cd9fd6 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Thu, 31 Aug 2017 15:08:30 -0500 Subject: Add functionality for two themes --- config/gitlab.yml.example | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 1ca0f263f13..5439cd3d4a2 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -77,13 +77,9 @@ production: &base # default_can_create_group: false # default: true # username_changing_enabled: false # default: true - User can change her username/namespace ## Default theme ID - ## 1 - Graphite - ## 2 - Charcoal - ## 3 - Green - ## 4 - Gray - ## 5 - Violet - ## 6 - Blue - # default_theme: 2 # default: 2 + ## 1 - Indigo + ## 2 - Dark + # default_theme: 1 # default: 1 ## Automatic issue closing # If a commit message matches this regular expression, all issues referenced from the matched text will be closed. @@ -749,4 +745,4 @@ test: admin_group: '' staging: - <<: *base \ No newline at end of file + <<: *base -- cgit v1.2.1 From c3ac7311525bc23bd8b75addec34654aa87ebbae Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Tue, 5 Sep 2017 16:57:31 -0700 Subject: Add blue theme --- config/gitlab.yml.example | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 5439cd3d4a2..2213a1188ee 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -79,6 +79,7 @@ production: &base ## Default theme ID ## 1 - Indigo ## 2 - Dark + ## 3 - Blue # default_theme: 1 # default: 1 ## Automatic issue closing -- cgit v1.2.1 From 7b567597eef25ca3af8af63a71bcc4dfefc2a694 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Wed, 6 Sep 2017 08:09:54 -0700 Subject: Fix specs; start on light theme --- config/gitlab.yml.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 2213a1188ee..cd44f888d3f 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -79,7 +79,9 @@ production: &base ## Default theme ID ## 1 - Indigo ## 2 - Dark - ## 3 - Blue + ## 3 - Light + ## 4 - Blue + ## 5 - Green # default_theme: 1 # default: 1 ## Automatic issue closing -- cgit v1.2.1