From 0013e6c00dc1743edb35b9b35a59c09fa0a0868e Mon Sep 17 00:00:00 2001 From: Robin Bobbitt Date: Fri, 15 Sep 2017 11:43:49 -0400 Subject: Clean up read_registry scope changes Closes #37789 --- config/initializers/doorkeeper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 40e635bf2cf..b89f0419b91 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -58,7 +58,7 @@ Doorkeeper.configure do # For more information go to # https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Scopes default_scopes(*Gitlab::Auth::DEFAULT_SCOPES) - optional_scopes(*Gitlab::Auth::OPTIONAL_SCOPES) + optional_scopes(*Gitlab::Auth.optional_scopes) # Change the way client credentials are retrieved from the request object. # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then -- cgit v1.2.1 From 46114fca5dd0f29ba4a98c715c15bd0895b07b0c Mon Sep 17 00:00:00 2001 From: Greg Stark Date: Mon, 18 Sep 2017 19:37:57 +0100 Subject: Fix regular expression used for opclasses to not be confused by partial index clause --- config/initializers/postgresql_opclasses_support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/postgresql_opclasses_support.rb b/config/initializers/postgresql_opclasses_support.rb index 820cc89ef57..c2f3023b330 100644 --- a/config/initializers/postgresql_opclasses_support.rb +++ b/config/initializers/postgresql_opclasses_support.rb @@ -127,7 +127,7 @@ module ActiveRecord orders = desc_order_columns.any? ? Hash[desc_order_columns.map {|order_column| [order_column, :desc]}] : {} where = inddef.scan(/WHERE (.+)$/).flatten[0] using = inddef.scan(/USING (.+?) /).flatten[0].to_sym - opclasses = Hash[inddef.scan(/\((.+)\)$/).flatten[0].split(',').map do |column_and_opclass| + opclasses = Hash[inddef.scan(/\((.+?)\)(?:$| WHERE )/).flatten[0].split(',').map do |column_and_opclass| column, opclass = column_and_opclass.split(' ').map(&:strip) [column, opclass] if opclass end.compact] -- cgit v1.2.1 From 64d7ec0a9e3ffd6233ccfbe9100f8a9391c648e5 Mon Sep 17 00:00:00 2001 From: Andrew Newdigate Date: Tue, 19 Sep 2017 10:55:37 +0000 Subject: Detect n+1 issues involving Gitaly --- config/initializers/lograge.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index 21fe8d72459..8560d24526f 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -12,13 +12,18 @@ unless Sidekiq.server? config.lograge.logger = ActiveSupport::Logger.new(filename) # Add request parameters to log output config.lograge.custom_options = lambda do |event| - { + payload = { time: event.time.utc.iso8601(3), params: event.payload[:params].except(*%w(controller action format)), remote_ip: event.payload[:remote_ip], user_id: event.payload[:user_id], username: event.payload[:username] } + + gitaly_calls = Gitlab::GitalyClient.get_request_count + payload[:gitaly_calls] = gitaly_calls if gitaly_calls > 0 + + payload end end end -- cgit v1.2.1 From b3566a01049cdfbde2a9221319601d8949c12a5a Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 20 Sep 2017 14:21:15 +0200 Subject: Stop using Sidekiq for updating Key#last_used_at This makes things simpler as no scheduling is involved. Further we remove the need for running a SELECT + UPDATE just to get the key and update it, whereas we only need an UPDATE when setting last_used_at directly in a request. The added service class takes care of updating Key#last_used_at without using Sidekiq. Further it makes sure we only try to obtain a Redis lease if we're confident that we actually need to do so, instead of always obtaining it. We also make sure to _only_ update last_used_at instead of also updating updated_at. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36663 --- config/sidekiq_queues.yml | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 24c001362c6..d169c38a693 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -38,7 +38,6 @@ - [invalid_gpg_signature_update, 2] - [create_gpg_signature, 2] - [upload_checksum, 1] - - [use_key, 1] - [repository_fork, 1] - [repository_import, 1] - [project_service, 1] -- cgit v1.2.1 From f4c45417fe4108a563e3900ff813ff53af7afcb0 Mon Sep 17 00:00:00 2001 From: Daniel Voogsgerd Date: Sat, 5 Nov 2016 14:47:38 +0100 Subject: Removed two legacy config options Removed the max_size and timeout options from the git config in gitlab.yml. --- config/gitlab.yml.example | 6 ------ 1 file changed, 6 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index cd44f888d3f..9b496822e93 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -577,12 +577,6 @@ production: &base # Use the default values unless you really know what you are doing git: bin_path: /usr/bin/git - # The next value is the maximum memory size grit can use - # Given in number of bytes per git object (e.g. a commit) - # This value can be increased if you have very large commits - max_size: 20971520 # 20.megabytes - # Git timeout to read a commit, in seconds - timeout: 10 ## Webpack settings # If enabled, this will tell rails to serve frontend assets from the webpack-dev-server running -- cgit v1.2.1 From 55f772bb98a67ad346442a2cacb5646f6719b987 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Fri, 22 Sep 2017 08:39:47 +0000 Subject: Resolve "Better SVG Usage in the Frontend" --- config/dependency_decisions.yml | 12 +++++++++++ config/svg.config.js | 48 +++++++++++++++++++++++++++++++++++++++++ config/webpack.config.js | 1 + 3 files changed, 61 insertions(+) create mode 100644 config/svg.config.js (limited to 'config') diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml index 6c5c8cad270..db31b01a7d2 100644 --- a/config/dependency_decisions.yml +++ b/config/dependency_decisions.yml @@ -452,3 +452,15 @@ :why: https://github.com/jaredhanson/utils-merge/blob/v1.0.0/LICENSE :versions: [] :when: 2017-09-16 05:18:26.193764000 Z +- - :approve + - svg4everybody + - :who: Tim Zallmann + :why: CC0 1.0 - https://github.com/jonathantneal/svg4everybody/blob/master/LICENSE.md + :versions: [] + :when: 2017-09-13 17:31:16.425819400 Z +- - :approve + - gitlab-svgs + - :who: Tim Zallmann + :why: Our own library - https://gitlab.com/gitlab-org/gitlab-svgs + :versions: [] + :when: 2017-09-19 14:36:32.795496000 Z diff --git a/config/svg.config.js b/config/svg.config.js new file mode 100644 index 00000000000..be72741abec --- /dev/null +++ b/config/svg.config.js @@ -0,0 +1,48 @@ +/* eslint-disable no-commonjs */ +const path = require('path'); +const fs = require('fs'); + +const sourcePath = path.join('node_modules', 'gitlab-svgs', 'dist'); +const sourcePathIllustrations = path.join('node_modules', 'gitlab-svgs', 'dist', 'illustrations'); +const destPath = path.normalize(path.join('app', 'assets', 'images')); + +// Actual Task copying the 2 files + all illustrations +copyFileSync(path.join(sourcePath, 'icons.svg'), destPath); +copyFileSync(path.join(sourcePath, 'icons.json'), destPath); +copyFolderRecursiveSync(sourcePathIllustrations, destPath); + +// Helper Functions +function copyFileSync(source, target) { + var targetFile = target; + //if target is a directory a new file with the same name will be created + if (fs.existsSync(target)) { + if (fs.lstatSync(target).isDirectory()) { + targetFile = path.join(target, path.basename(source)); + } + } + console.log(`Copy SVG File : ${targetFile}`); + fs.writeFileSync(targetFile, fs.readFileSync(source)); +} + +function copyFolderRecursiveSync(source, target) { + var files = []; + + //check if folder needs to be created or integrated + var targetFolder = path.join(target, path.basename(source)); + if (!fs.existsSync(targetFolder)) { + fs.mkdirSync(targetFolder); + } + + //copy + if (fs.lstatSync(source).isDirectory()) { + files = fs.readdirSync(source); + files.forEach(function (file) { + var curSource = path.join(source, file); + if (fs.lstatSync(curSource).isDirectory()) { + copyFolderRecursiveSync(curSource, targetFolder); + } else { + copyFileSync(curSource, targetFolder); + } + }); + } +} diff --git a/config/webpack.config.js b/config/webpack.config.js index 6b0cd023291..3404715fe30 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -45,6 +45,7 @@ var config = { group: './group.js', groups: './groups/index.js', groups_list: './groups_list.js', + help: './help/help.js', how_to_merge: './how_to_merge.js', issue_show: './issue_show/index.js', integrations: './integrations', -- cgit v1.2.1 From 8edc1d07ee3cc0ae95966bf31493ab4ff9317349 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 23 Sep 2017 15:30:58 -0400 Subject: Remove Grit settings from default settings This is a follow-up to https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1956 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7308. --- config/initializers/1_settings.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'config') diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 94429ee91a9..27c1ecc7b23 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -499,9 +499,7 @@ Settings.backup['upload']['storage_class'] ||= nil # Git # Settings['git'] ||= Settingslogic.new({}) -Settings.git['max_size'] ||= 20971520 # 20.megabytes -Settings.git['bin_path'] ||= '/usr/bin/git' -Settings.git['timeout'] ||= 10 +Settings.git['bin_path'] ||= '/usr/bin/git' # Important: keep the satellites.path setting until GitLab 9.0 at # least. This setting is fed to 'rm -rf' in -- cgit v1.2.1