From 1dc2b4693e4a58c94e556ae219ae6200044f95dc Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Thu, 4 May 2017 19:29:56 -0500 Subject: =?UTF-8?q?Add=20=E2=80=9Cgroups=E2=80=9D=20JS=20bundle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 0ec9e48845e..966b1e2283e 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -32,6 +32,7 @@ var config = { filtered_search: './filtered_search/filtered_search_bundle.js', graphs: './graphs/graphs_bundle.js', group: './group.js', + groups: './groups/index.js', groups_list: './groups_list.js', issuable: './issuable/issuable_bundle.js', issue_show: './issue_show/index.js', -- cgit v1.2.1 From 312d02ad6db5b38b7c393f9a84a73e9ead4adfe0 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 10 May 2017 13:30:30 -0500 Subject: Add GroupFilterableList to be used as filterable class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GroupFilterableList extends from FilterableList which is used in other places that doesn’t use Vue. - GroupFilterableList interacts with a Vue store object. - Deleted groups_list.js since is not needed anymore, filtering is handled via ajax in GroupFilterableList --- 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 966b1e2283e..e4a014d97d7 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -33,7 +33,6 @@ var config = { graphs: './graphs/graphs_bundle.js', group: './group.js', groups: './groups/index.js', - groups_list: './groups_list.js', issuable: './issuable/issuable_bundle.js', issue_show: './issue_show/index.js', main: './main.js', -- cgit v1.2.1 From 4464c22d6d23d893494682d309aec3fb31c11ae3 Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Wed, 3 May 2017 17:26:49 +0200 Subject: Support descriptions for snippets --- config/routes/snippets.rb | 3 +++ config/routes/uploads.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index dae83734fe6..0a4ebac3ca3 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -2,6 +2,9 @@ resources :snippets, concerns: :awardable do member do get :raw post :mark_as_spam + end + + collection do post :preview_markdown end diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index b315186b178..76c31260394 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -20,7 +20,7 @@ scope path: :uploads do constraints: { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: /[^\/]+/ } # create uploads for models, snippets (notes) available for now - post ':model/:id/', + post ':model', to: 'uploads#create', constraints: { model: /personal_snippet/, id: /\d+/ }, as: 'upload' -- cgit v1.2.1 From 3d70eeb5bb9dac8073a149547dc3b85c90d65e7d Mon Sep 17 00:00:00 2001 From: Alexander Randa Date: Fri, 31 Mar 2017 12:54:38 +0000 Subject: Implement ability to update deploy keys --- config/routes/admin.rb | 2 +- config/routes/project.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/routes/admin.rb b/config/routes/admin.rb index ccfd85aed63..f739dccfbfd 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -48,7 +48,7 @@ namespace :admin do end end - resources :deploy_keys, only: [:index, :new, :create, :destroy] + resources :deploy_keys, only: [:index, :new, :create, :edit, :update, :destroy] resources :hooks, only: [:index, :create, :edit, :update, :destroy] do member do diff --git a/config/routes/project.rb b/config/routes/project.rb index 5aac44fce10..343de4106f3 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -73,7 +73,7 @@ constraints(ProjectUrlConstrainer.new) do resource :mattermost, only: [:new, :create] - resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create] do + resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create, :edit, :update] do member do put :enable put :disable -- cgit v1.2.1 From 0f4050430d400daffbc5a68b15d79b896bb8a692 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Fri, 19 May 2017 17:03:10 +0200 Subject: Split metrics from health controller into metrics controller --- config/gitlab.yml.example | 5 +++++ config/initializers/1_settings.rb | 1 + 2 files changed, 6 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index d2aeb66ebf6..a6e4337912b 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -102,6 +102,11 @@ production: &base # The default is 'shared/cache/archive/' relative to the root of the Rails app. # repository_downloads_path: shared/cache/archive/ + ## Prometheus Client Data directory + # To be used efficiently in multiprocess Ruby setup like Unicorn, Prometheus client needs to share metrics with other instances. + # The default is 'tmp/prometheus_data_dir' relative to Rails.root + # prometheus_multiproc_dir: tmp/prometheus_data_dir + ## Reply by email # Allow users to comment on issues and merge requests by replying to notification emails. # For documentation on how to set this up, see http://doc.gitlab.com/ce/administration/reply_by_email.html diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 45ea2040d23..5db8746ef4c 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -242,6 +242,7 @@ Settings.gitlab['import_sources'] ||= %w[github bitbucket gitlab google_code fog Settings.gitlab['trusted_proxies'] ||= [] Settings.gitlab['no_todos_messages'] ||= YAML.load_file(Rails.root.join('config', 'no_todos_messages.yml')) Settings.gitlab['usage_ping_enabled'] = true if Settings.gitlab['usage_ping_enabled'].nil? +Settings.gitlab['prometheus_multiproc_dir'] ||= ENV['prometheus_multiproc_dir'] || 'tmp/prometheus_data_dir' # # CI -- cgit v1.2.1 From c10d55a6dafc6dafe0d3b2d9fad1dc66aee07ff6 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Fri, 19 May 2017 18:27:36 +0200 Subject: Use only ENV for metrics folder location --- config/gitlab.yml.example | 5 ----- config/initializers/1_settings.rb | 1 - config/routes.rb | 8 ++++---- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index a6e4337912b..d2aeb66ebf6 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -102,11 +102,6 @@ production: &base # The default is 'shared/cache/archive/' relative to the root of the Rails app. # repository_downloads_path: shared/cache/archive/ - ## Prometheus Client Data directory - # To be used efficiently in multiprocess Ruby setup like Unicorn, Prometheus client needs to share metrics with other instances. - # The default is 'tmp/prometheus_data_dir' relative to Rails.root - # prometheus_multiproc_dir: tmp/prometheus_data_dir - ## Reply by email # Allow users to comment on issues and merge requests by replying to notification emails. # For documentation on how to set this up, see http://doc.gitlab.com/ce/administration/reply_by_email.html diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 5db8746ef4c..45ea2040d23 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -242,7 +242,6 @@ Settings.gitlab['import_sources'] ||= %w[github bitbucket gitlab google_code fog Settings.gitlab['trusted_proxies'] ||= [] Settings.gitlab['no_todos_messages'] ||= YAML.load_file(Rails.root.join('config', 'no_todos_messages.yml')) Settings.gitlab['usage_ping_enabled'] = true if Settings.gitlab['usage_ping_enabled'].nil? -Settings.gitlab['prometheus_multiproc_dir'] ||= ENV['prometheus_multiproc_dir'] || 'tmp/prometheus_data_dir' # # CI diff --git a/config/routes.rb b/config/routes.rb index 846054e6917..4051c33d5d4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -38,10 +38,10 @@ Rails.application.routes.draw do # Health check get 'health_check(/:checks)' => 'health_check#index', as: :health_check - scope path: '-', controller: 'health' do - get :liveness - get :readiness - get :metrics + scope path: '-' do + get 'liveness' => 'health#liveness' + get 'readiness' => 'health#readiness' + get 'metrics' => 'metrics#metrics' end # Koding route -- cgit v1.2.1 From ae8f7666e597493ab404f8524c1216a924338291 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Mon, 29 May 2017 23:23:19 +0200 Subject: Add prometheus text formatter + rename controler method to #index from #metrics + remove assertion from nullMetric --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 4051c33d5d4..d909be38b42 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -41,7 +41,7 @@ Rails.application.routes.draw do scope path: '-' do get 'liveness' => 'health#liveness' get 'readiness' => 'health#readiness' - get 'metrics' => 'metrics#metrics' + resources :metrics, only: [:index] end # Koding route -- cgit v1.2.1 From bd951384142f3f5ec71bd78a23aae917f151b47f Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Tue, 6 Jun 2017 09:02:29 -0500 Subject: Remove non existent 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 d02143ac9ad..55f6e0a704b 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -40,7 +40,6 @@ var config = { graphs: './graphs/graphs_bundle.js', group: './group.js', groups: './groups/index.js', - issuable: './issuable/issuable_bundle.js', issue_show: './issue_show/index.js', locale: './locale/index.js', main: './main.js', -- cgit v1.2.1 From 2e311d9d1aac58bbd9c7d6c97c7cbcccf2715347 Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Mon, 29 May 2017 09:54:35 +0200 Subject: Support uploads for newly created personal snippets --- config/routes/uploads.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config') diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index 76c31260394..ae8747d766d 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -9,6 +9,11 @@ scope path: :uploads do to: 'uploads#show', constraints: { model: /personal_snippet/, id: /\d+/, filename: /[^\/]+/ } + # show temporary uploads + get 'temp/:secret/:filename', + to: 'uploads#show', + constraints: { filename: /[^\/]+/ } + # Appearance get ":model/:mounted_as/:id/:filename", to: "uploads#show", -- cgit v1.2.1 From ea71340f077ab2694fa473cf8238cf4b9513fda2 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 7 Jun 2017 05:51:34 -0500 Subject: Restore code to make explore groups work --- config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 55f6e0a704b..3b7f1c33c95 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -40,6 +40,7 @@ var config = { graphs: './graphs/graphs_bundle.js', group: './group.js', groups: './groups/index.js', + groups_list: './groups_list.js', issue_show: './issue_show/index.js', locale: './locale/index.js', main: './main.js', -- cgit v1.2.1 From a65f07a256b95ce1c38342518f9469cbf3abf609 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 7 Jun 2017 10:05:17 -0500 Subject: Address feedback --- config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 3b7f1c33c95..d67076ce06b 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -156,6 +156,7 @@ var config = { 'environments', 'environments_folder', 'filtered_search', + 'groups', 'issue_show', 'merge_conflicts', 'notebook_viewer', -- cgit v1.2.1 From 469acd190e497cda8516da0ee481f33e038d7e9e Mon Sep 17 00:00:00 2001 From: Robin Bobbitt Date: Tue, 6 Jun 2017 11:39:54 -0400 Subject: Sync email address from specified omniauth provider --- config/gitlab.yml.example | 4 ++++ config/initializers/1_settings.rb | 1 + 2 files changed, 5 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index d2aeb66ebf6..0b33783869b 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -337,6 +337,10 @@ 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 + # CAUTION! # This allows users to login without having a user account first. Define the allowed providers # using an array, e.g. ["saml", "twitter"], or as true/false to allow all providers or none. diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 45ea2040d23..8ddf8e4d2e4 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -156,6 +156,7 @@ 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['providers'] ||= [] Settings.omniauth['cas3'] ||= Settingslogic.new({}) -- cgit v1.2.1 From bdebe849b8251f390378dd446d9022fca1b2d55c Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 7 Jun 2017 20:13:44 +0000 Subject: Translate project & repository pages --- config/webpack.config.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 61f1eaaacd1..cbcf5ce996d 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -183,15 +183,7 @@ var config = { // create cacheable common library bundles new webpack.optimize.CommonsChunkPlugin({ - names: ['main', 'common', 'runtime'], - }), - - // locale common library - new webpack.optimize.CommonsChunkPlugin({ - name: 'locale', - chunks: [ - 'cycle_analytics', - ], + names: ['main', 'locale', 'common', 'runtime'], }), ], -- cgit v1.2.1 From 1d1363e2bb8a0aee7e2849fd463ea415035710d9 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Wed, 7 Jun 2017 20:32:38 -0700 Subject: Bring in security changes from the 9.2.5 release Ran: - git format-patch v9.2.2..v9.2.5 --stdout > patchfile.patch - git checkout -b 9-2-5-security-patch origin/v9.2.2 - git apply patchfile.patch - git commit - [Got the sha ref for the commit] - git checkout -b upstream-9-2-security master - git cherry-pick - [Resolved conflicts] - git cherry-pick --continue --- 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 ae8747d766d..a49e244af1a 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -1,6 +1,6 @@ scope path: :uploads do # Note attachments and User/Group/Project avatars - get ":model/:mounted_as/:id/:filename", + get "system/:model/:mounted_as/:id/:filename", to: "uploads#show", constraints: { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ } @@ -15,7 +15,7 @@ scope path: :uploads do constraints: { filename: /[^\/]+/ } # Appearance - get ":model/:mounted_as/:id/:filename", + get "system/:model/:mounted_as/:id/:filename", to: "uploads#show", constraints: { model: /appearance/, mounted_as: /logo|header_logo/, filename: /.+/ } -- cgit v1.2.1 From 46a578b4b07e7d4e9eb11bc87cd03e17f4caa183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Rosen=C3=B6gger?= <123haynes@gmail.com> Date: Thu, 8 Jun 2017 23:21:34 +0200 Subject: Add german translation for time_ago_in_words --- config/locales/de.yml | 37 +++++++++++++++++++++++++++++++++++++ config/locales/es.yml | 2 ++ 2 files changed, 39 insertions(+) (limited to 'config') diff --git a/config/locales/de.yml b/config/locales/de.yml index 533663a2704..38c3711c6c7 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -62,6 +62,43 @@ de: - :month - :year datetime: + # used in a custom scope that has been created to fix https://gitlab.com/gitlab-org/gitlab-ce/issues/32747 + time_ago_in_words: + half_a_minute: vor einer halben Minute + less_than_x_seconds: + one: vor weniger als einer Sekunde + other: "vor weniger als %{count} Sekunden" + x_seconds: + one: vor einer Sekunde + other: "vor %{count} Sekunden" + less_than_x_minutes: + one: vor weniger als einer Minute + other: vor weniger als %{count} Minuten + x_minutes: + one: vor einer Minute + other: "vor %{count} Minuten" + about_x_hours: + one: vor etwa einer Stunde + other: "vor etwa %{count} Stunden" + x_days: + one: vor einem Tag + other: "vor %{count} Tagen" + about_x_months: + one: vor etwa einem Monat + other: "vor etwa %{count} Monaten" + x_months: + one: vor einem Monat + other: "vor %{count} Monaten" + about_x_years: + one: vor etwa einem Jahr + other: "vor etwa %{count} Jahren" + over_x_years: + one: vor mehr als einem Jahr + other: "vor mehr als %{count} Jahren" + almost_x_years: + one: vor fast einem Jahr + other: "vor fast %{count} Jahren" + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() distance_in_words: about_x_hours: one: etwa eine Stunde diff --git a/config/locales/es.yml b/config/locales/es.yml index 0f9dc39535d..d71c6eb5047 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -61,6 +61,7 @@ es: - :month - :year datetime: + # used in a custom scope that has been created to fix https://gitlab.com/gitlab-org/gitlab-ce/issues/32747 time_ago_in_words: half_a_minute: "hace medio minuto" less_than_x_seconds: @@ -96,6 +97,7 @@ es: almost_x_years: one: "hace casi 1 año" other: "hace casi %{count} años" + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() distance_in_words: about_x_hours: one: alrededor de 1 hora -- cgit v1.2.1 From f331bbefec8a1101ac7f1eaa3d5a5f0afa61bd9e Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 8 Jun 2017 18:26:23 -0400 Subject: Add Bootsnap to all environments to reduce application startup time --- config/boot.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'config') diff --git a/config/boot.rb b/config/boot.rb index f2830ae3166..17a71148370 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -4,3 +4,15 @@ require 'rubygems' ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) + +# Default Bootsnap configuration from https://github.com/Shopify/bootsnap#usage +require 'bootsnap' +Bootsnap.setup( + cache_dir: 'tmp/cache', + development_mode: ENV['RAILS_ENV'] == 'development', + load_path_cache: true, + autoload_paths_cache: true, + disable_trace: false, + compile_cache_iseq: true, + compile_cache_yaml: true +) -- cgit v1.2.1 From c0c82368da57caac07f25227dac74d9c119b806e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 8 Jun 2017 17:43:05 +0100 Subject: Fixed dashboard milestone tabs not loading Closes #33477 --- config/routes/dashboard.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes/dashboard.rb b/config/routes/dashboard.rb index 8e380a0b0ac..d2437285cdf 100644 --- a/config/routes/dashboard.rb +++ b/config/routes/dashboard.rb @@ -4,7 +4,13 @@ resource :dashboard, controller: 'dashboard', only: [] do get :activity scope module: :dashboard do - resources :milestones, only: [:index, :show] + resources :milestones, only: [:index, :show] do + member do + get :merge_requests + get :participants + get :labels + end + end resources :labels, only: [:index] resources :groups, only: [:index] -- cgit v1.2.1 From d39ecf1ca7e9455abcdeb17c251a2d248a47d471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 17 May 2017 13:20:55 +0200 Subject: New performance bar that can be enabled with the `p b` shortcut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/application.rb | 1 + config/initializers/peek.rb | 9 +++++++++ config/routes.rb | 1 + config/webpack.config.js | 1 + 4 files changed, 12 insertions(+) create mode 100644 config/initializers/peek.rb (limited to 'config') diff --git a/config/application.rb b/config/application.rb index b0533759252..8bbecf3ed0f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -105,6 +105,7 @@ module Gitlab config.assets.precompile << "katex.css" config.assets.precompile << "katex.js" config.assets.precompile << "xterm/xterm.css" + config.assets.precompile << "peek.css" config.assets.precompile << "lib/ace.js" config.assets.precompile << "vendor/assets/fonts/*" config.assets.precompile << "test.css" diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb new file mode 100644 index 00000000000..73da7be7889 --- /dev/null +++ b/config/initializers/peek.rb @@ -0,0 +1,9 @@ +Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Redis.params) } + +Peek.into Peek::Views::Host +Peek.into Peek::Views::PerformanceBar +Peek.into Gitlab::Database.mysql? ? Peek::Views::Mysql2 : Peek::Views::PG +Peek.into Peek::Views::Redis +Peek.into Peek::Views::Sidekiq +Peek.into Peek::Views::Rblineprof +Peek.into Peek::Views::GC diff --git a/config/routes.rb b/config/routes.rb index d909be38b42..9a117711083 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,7 @@ Rails.application.routes.draw do post :toggle_award_emoji, on: :member end + mount Peek::Railtie => '/peek' draw :sherlock draw :development draw :ci diff --git a/config/webpack.config.js b/config/webpack.config.js index 7501acb7633..bb77c12f88a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -68,6 +68,7 @@ var config = { raven: './raven/index.js', vue_merge_request_widget: './vue_merge_request_widget/index.js', test: './test.js', + peek: './peek.js', }, output: { -- cgit v1.2.1 From 46273e14465f98ac1db306122cdf06d3d87b319e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 1 Jun 2017 16:10:17 +0200 Subject: Store Sherlock::Query in Peek adapter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/peek.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'config') diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index 73da7be7889..6cb0e711e48 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -7,3 +7,35 @@ Peek.into Peek::Views::Redis Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof Peek.into Peek::Views::GC + +if Gitlab::Database.mysql? + class Mysql2::Client + class << self + attr_accessor :query_details + end + self.query_details = Concurrent::Array.new + end + + module Peek + module Views + class Mysql2 < View + prepend ::Gitlab::PerformanceBar::PeekMysqlWithQueries + end + end + end +else + class PG::Connection + class << self + attr_accessor :query_details + end + self.query_details = Concurrent::Array.new + end + + module Peek + module Views + class PG < View + prepend ::Gitlab::PerformanceBar::PeekPgWithQueries + end + end + end +end -- cgit v1.2.1 From 47054451da0a3aa80cae02c8a096338c23be7b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 7 Jun 2017 09:57:21 +0200 Subject: Don't use Pygment,rb, use Rouge instead, and put peek-pg in the :postgres group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/peek.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index 6cb0e711e48..a8669ddba97 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -2,7 +2,13 @@ Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Re Peek.into Peek::Views::Host Peek.into Peek::Views::PerformanceBar -Peek.into Gitlab::Database.mysql? ? Peek::Views::Mysql2 : Peek::Views::PG +if Gitlab::Database.mysql? + require 'peek-mysql' + Peek.into Peek::Views::Mysql2 +else + require 'peek-pg' + Peek.into Peek::Views::PG +end Peek.into Peek::Views::Redis Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof -- cgit v1.2.1 From 651eb51ececf9c256416eabe87c062ef33f45502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 7 Jun 2017 16:53:13 +0200 Subject: Display queries duration in performance bar queries modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/peek.rb | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) (limited to 'config') diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index a8669ddba97..6c008e53af6 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -4,44 +4,26 @@ Peek.into Peek::Views::Host Peek.into Peek::Views::PerformanceBar if Gitlab::Database.mysql? require 'peek-mysql' - Peek.into Peek::Views::Mysql2 + PEEK_DB_CLIENT = ::Mysql2::Client + PEEK_DB_VIEW = Peek::Views::Mysql2 + Peek.into PEEK_DB_VIEW else require 'peek-pg' - Peek.into Peek::Views::PG + PEEK_DB_CLIENT = ::PG::Connection + PEEK_DB_VIEW = Peek::Views::PG + Peek.into PEEK_DB_VIEW end Peek.into Peek::Views::Redis Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof Peek.into Peek::Views::GC -if Gitlab::Database.mysql? - class Mysql2::Client - class << self - attr_accessor :query_details - end - self.query_details = Concurrent::Array.new - end - module Peek - module Views - class Mysql2 < View - prepend ::Gitlab::PerformanceBar::PeekMysqlWithQueries - end - end - end -else - class PG::Connection - class << self - attr_accessor :query_details - end - self.query_details = Concurrent::Array.new - end - - module Peek - module Views - class PG < View - prepend ::Gitlab::PerformanceBar::PeekPgWithQueries - end - end +class PEEK_DB_CLIENT + class << self + attr_accessor :query_details end + self.query_details = Concurrent::Array.new end + +PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker -- cgit v1.2.1 From f45094a485f6378949acf3ac2d705020e4d7b126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 7 Jun 2017 17:20:09 +0200 Subject: Small adjustments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/application.rb | 1 + config/initializers/peek.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index 8bbecf3ed0f..31f975d538b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -104,6 +104,7 @@ module Gitlab config.assets.precompile << "mailers/*.css" config.assets.precompile << "katex.css" config.assets.precompile << "katex.js" + config.assets.precompile << "peek.js" config.assets.precompile << "xterm/xterm.css" config.assets.precompile << "peek.css" config.assets.precompile << "lib/ace.js" diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index 6c008e53af6..429960b7c3e 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -18,7 +18,6 @@ Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof Peek.into Peek::Views::GC - class PEEK_DB_CLIENT class << self attr_accessor :query_details -- cgit v1.2.1 From e85914532970d61d53f025f3ff0d85891bab2637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 7 Jun 2017 19:55:07 +0200 Subject: Fix Rubocop offenses, improve SQL duration format and changelog entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/peek.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index 429960b7c3e..c88ae4b62d2 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -3,16 +3,15 @@ Rails.application.config.peek.adapter = :redis, { client: ::Redis.new(Gitlab::Re Peek.into Peek::Views::Host Peek.into Peek::Views::PerformanceBar if Gitlab::Database.mysql? - require 'peek-mysql' + require 'peek-mysql2' PEEK_DB_CLIENT = ::Mysql2::Client PEEK_DB_VIEW = Peek::Views::Mysql2 - Peek.into PEEK_DB_VIEW else require 'peek-pg' PEEK_DB_CLIENT = ::PG::Connection PEEK_DB_VIEW = Peek::Views::PG - Peek.into PEEK_DB_VIEW end +Peek.into PEEK_DB_VIEW Peek.into Peek::Views::Redis Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof @@ -25,4 +24,5 @@ class PEEK_DB_CLIENT self.query_details = Concurrent::Array.new end +# rubocop:disable Style/ClassAndModuleCamelCase PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker -- cgit v1.2.1 From b173ae6b48323b22f5650e97cd797fa9c49e6cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 7 Jun 2017 23:51:13 +0200 Subject: Fix linting, route, and specs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/peek.rb | 2 +- config/routes.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index c88ae4b62d2..c1c65cedccf 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -17,6 +17,7 @@ Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof Peek.into Peek::Views::GC +# rubocop:disable Style/ClassAndModuleCamelCase class PEEK_DB_CLIENT class << self attr_accessor :query_details @@ -24,5 +25,4 @@ class PEEK_DB_CLIENT self.query_details = Concurrent::Array.new end -# rubocop:disable Style/ClassAndModuleCamelCase PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker diff --git a/config/routes.rb b/config/routes.rb index 9a117711083..4fd6cb5d439 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,6 @@ Rails.application.routes.draw do post :toggle_award_emoji, on: :member end - mount Peek::Railtie => '/peek' draw :sherlock draw :development draw :ci @@ -43,6 +42,7 @@ Rails.application.routes.draw do get 'liveness' => 'health#liveness' get 'readiness' => 'health#readiness' resources :metrics, only: [:index] + mount Peek::Railtie => '/peek' end # Koding route -- cgit v1.2.1 From 8a2d536ac3178c18a08cc107453c23c459b2cef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 8 Jun 2017 10:39:32 +0200 Subject: Fix vendor/peek.js so that it can be bundled with Webpack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/application.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index 31f975d538b..8bbecf3ed0f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -104,7 +104,6 @@ module Gitlab config.assets.precompile << "mailers/*.css" config.assets.precompile << "katex.css" config.assets.precompile << "katex.js" - config.assets.precompile << "peek.js" config.assets.precompile << "xterm/xterm.css" config.assets.precompile << "peek.css" config.assets.precompile << "lib/ace.js" -- cgit v1.2.1 From d1b4576a79660d0f3360616ec746a06ed0ce62bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 8 Jun 2017 18:09:08 +0200 Subject: Ensure peek-performance_bar doesn't break existing functionalities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- config/initializers/peek.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config') diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index c1c65cedccf..65432caac2a 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -26,3 +26,7 @@ class PEEK_DB_CLIENT end PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker + +class Peek::Views::PerformanceBar::ProcessUtilization + prepend ::Gitlab::PerformanceBar::PeekPerformanceBarWithRackBody +end -- cgit v1.2.1 From 010a83de19f3f1a992ee661c0b23449e8fd70a64 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 9 Jun 2017 12:28:30 -0500 Subject: fall back to gzip when zopfli compression is unavailable --- config/webpack.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index cbcf5ce996d..86b3bbaab70 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -18,6 +18,15 @@ var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false'; var WEBPACK_REPORT = process.env.WEBPACK_REPORT; var NO_COMPRESSION = process.env.NO_COMPRESSION; +// optional dependency `node-zopfli` is unavailable on CentOS 6 +var ZOPFLI_AVAILABLE; +try { + require.resolve('node-zopfli'); + ZOPFLI_AVAILABLE = true; +} catch(err) { + ZOPFLI_AVAILABLE = false; +} + var config = { // because sqljs requires fs. node: { @@ -222,7 +231,7 @@ if (IS_PRODUCTION) { config.plugins.push( new CompressionPlugin({ asset: '[path].gz[query]', - algorithm: 'zopfli', + algorithm: ZOPFLI_AVAILABLE ? 'zopfli' : 'gzip', }) ); } -- cgit v1.2.1 From 452202e36d3e20755b099a718a92d3f7b80fabb8 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 12 Jun 2017 09:20:19 +0000 Subject: Improve Job detail view to make it refreshed in real-time instead of reloading --- 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 7501acb7633..04f5a2beb2a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -44,6 +44,7 @@ var config = { groups_list: './groups_list.js', issue_show: './issue_show/index.js', integrations: './integrations', + job_details: './jobs/job_details_bundle.js', locale: './locale/index.js', main: './main.js', merge_conflicts: './merge_conflicts/merge_conflicts_bundle.js', @@ -158,6 +159,7 @@ var config = { 'filtered_search', 'groups', 'issue_show', + 'job_details', 'merge_conflicts', 'notebook_viewer', 'pdf_viewer', -- cgit v1.2.1 From d83ee2bbd10d8fe2f2e9521bb3c266cf696aa98c Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 2 Jun 2017 17:12:36 +0200 Subject: Add the ability to perform background migrations Background migrations can be used to perform long running data migrations without these blocking a deployment procedure. See MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11854 for more information. --- 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 93df2d6f5ff..1d9e69a2408 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -54,3 +54,4 @@ - [system_hook_push, 1] - [update_user_activity, 1] - [propagate_service_template, 1] + - [background_migration, 1] -- cgit v1.2.1 From ac26ce32baeee4186e1998ae1f2921dfc94f1461 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 9 Jun 2017 00:01:28 -0500 Subject: replace PhantomJS with headless Chrome as karma test runner --- config/karma.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index 40c58e7771d..8b2950b4496 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -21,7 +21,7 @@ module.exports = function(config) { var karmaConfig = { basePath: ROOT_PATH, - browsers: ['PhantomJS'], + browsers: ['ChromeHeadless'], frameworks: ['jasmine'], files: [ { pattern: 'spec/javascripts/test_bundle.js', watched: false }, -- cgit v1.2.1 From bc00806a4eec785068671f2c995febe01682c2d0 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Tue, 13 Jun 2017 22:44:13 +1100 Subject: Add database helpers 'add_timestamps_with_timezone' and 'timestamps_with_timezone' --- config/initializers/active_record_data_types.rb | 24 ++++++++++++++++++++++ .../initializers/active_record_table_definition.rb | 24 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 config/initializers/active_record_data_types.rb create mode 100644 config/initializers/active_record_table_definition.rb (limited to 'config') diff --git a/config/initializers/active_record_data_types.rb b/config/initializers/active_record_data_types.rb new file mode 100644 index 00000000000..beb97c6fce0 --- /dev/null +++ b/config/initializers/active_record_data_types.rb @@ -0,0 +1,24 @@ +# ActiveRecord custom data type for storing datetimes with timezone information. +# See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11229 + +if Gitlab::Database.postgresql? + require 'active_record/connection_adapters/postgresql_adapter' + + module ActiveRecord + module ConnectionAdapters + class PostgreSQLAdapter + NATIVE_DATABASE_TYPES.merge!(datetime_with_timezone: { name: 'timestamptz' }) + end + end + end +elsif Gitlab::Database.mysql? + require 'active_record/connection_adapters/mysql2_adapter' + + module ActiveRecord + module ConnectionAdapters + class AbstractMysqlAdapter + NATIVE_DATABASE_TYPES.merge!(datetime_with_timezone: { name: 'timestamp' }) + end + end + end +end diff --git a/config/initializers/active_record_table_definition.rb b/config/initializers/active_record_table_definition.rb new file mode 100644 index 00000000000..4f59e35f4da --- /dev/null +++ b/config/initializers/active_record_table_definition.rb @@ -0,0 +1,24 @@ +# ActiveRecord custom method definitions with timezone information. +# See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11229 + +require 'active_record/connection_adapters/abstract/schema_definitions' + +# Appends columns `created_at` and `updated_at` to a table. +# +# It is used in table creation like: +# create_table 'users' do |t| +# t.timestamps_with_timezone +# end +module ActiveRecord + module ConnectionAdapters + class TableDefinition + def timestamps_with_timezone(**options) + options[:null] = false if options[:null].nil? + + [:created_at, :updated_at].each do |column_name| + column(column_name, :datetime_with_timezone, options) + end + end + end + end +end -- cgit v1.2.1 From a526e619d96aa95a55110e540363c34ab782defc Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 13 Jun 2017 15:20:26 +0000 Subject: Revert "Merge branch 'karma-headless-chrome' into 'master'" This reverts merge request !12036 --- config/karma.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index 8b2950b4496..40c58e7771d 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -21,7 +21,7 @@ module.exports = function(config) { var karmaConfig = { basePath: ROOT_PATH, - browsers: ['ChromeHeadless'], + browsers: ['PhantomJS'], frameworks: ['jasmine'], files: [ { pattern: 'spec/javascripts/test_bundle.js', watched: false }, -- cgit v1.2.1 From e9bd861fe4ae9a6db5aa28a900920eb661a4bbee Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 9 Jun 2017 00:01:28 -0500 Subject: replace PhantomJS with headless Chrome as karma test runner --- config/karma.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index 40c58e7771d..8b2950b4496 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -21,7 +21,7 @@ module.exports = function(config) { var karmaConfig = { basePath: ROOT_PATH, - browsers: ['PhantomJS'], + browsers: ['ChromeHeadless'], frameworks: ['jasmine'], files: [ { pattern: 'spec/javascripts/test_bundle.js', watched: false }, -- cgit v1.2.1 From 413f7d314d8c13bc53763ccf2fc528f98a8bf237 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 13 Jun 2017 12:37:36 -0500 Subject: force chrome to produce debug output as it runs in CI --- config/karma.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index 8b2950b4496..cfb0a0cb101 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -21,7 +21,14 @@ module.exports = function(config) { var karmaConfig = { basePath: ROOT_PATH, - browsers: ['ChromeHeadless'], + browsers: ['ChromeDebug'], + customLaunchers: { + ChromeDebug: { + base: 'ChromeHeadless', + flags: ['--enable-logging', '--v=1'], + displayName: 'Chrome' + } + }, frameworks: ['jasmine'], files: [ { pattern: 'spec/javascripts/test_bundle.js', watched: false }, @@ -33,6 +40,7 @@ module.exports = function(config) { reporters: [progressReporter], webpack: webpackConfig, webpackMiddleware: { stats: 'errors-only' }, + logLevel: config.LOG_DEBUG, }; if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') { -- cgit v1.2.1 From d70be8f83c307869d634ab30d245d996f780c9fd Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 14 Jun 2017 03:00:29 -0500 Subject: run chrome with --no-sandbox flag to get around docker privilege limitations --- config/karma.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index cfb0a0cb101..ecbd7d4e3e8 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -21,11 +21,13 @@ module.exports = function(config) { var karmaConfig = { basePath: ROOT_PATH, - browsers: ['ChromeDebug'], + browsers: ['ChromeHeadlessNoSandbox'], customLaunchers: { - ChromeDebug: { + ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', - flags: ['--enable-logging', '--v=1'], + // chrome cannot run in sandboxed mode inside a docker container unless it is run with + // escalated kernel privileges: docker run --cap-add=CAP_SYS_ADMIN + flags: ['--no-sandbox'], displayName: 'Chrome' } }, @@ -40,7 +42,6 @@ module.exports = function(config) { reporters: [progressReporter], webpack: webpackConfig, webpackMiddleware: { stats: 'errors-only' }, - logLevel: config.LOG_DEBUG, }; if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') { -- cgit v1.2.1 From 54c0c0cd170f6c4be8242428f409950e16fcea91 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 14 Jun 2017 12:01:38 +0100 Subject: Instrument MergeRequestDiff#load_commits This instrumentation isn't needed strictly for performance measurements, but just to see which controller actions call this method at all. See for more details. --- 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 5e0eefdb154..508b886d6a0 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -113,6 +113,9 @@ 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/30224#note_32306159 + instrumentation.instrument_instance_method(MergeRequestDiff, :load_commits) end # rubocop:enable Metrics/AbcSize -- cgit v1.2.1 From 8868efd0f38df1f537878ee3ea5061dcfd5fa163 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 14 Jun 2017 13:04:50 +0000 Subject: Move vue components to vue files and match docs --- 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 120f9d3193d..3c2455ebf35 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -61,7 +61,7 @@ var config = { network: './network/network_bundle.js', notebook_viewer: './blob/notebook_viewer.js', pdf_viewer: './blob/pdf_viewer.js', - pipelines: './pipelines/index.js', + pipelines: './pipelines/pipelines_bundle.js', pipelines_details: './pipelines/pipeline_details_bundle.js', profile: './profile/profile_bundle.js', protected_branches: './protected_branches/protected_branches_bundle.js', -- cgit v1.2.1 From 50b2b3f5f000834144ccf41a4dbe278987b2ef75 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 14 Jun 2017 13:58:10 -0500 Subject: add DEBUG flag option to karma config --- config/karma.config.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index ecbd7d4e3e8..978850e5d70 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -21,14 +21,16 @@ module.exports = function(config) { var karmaConfig = { basePath: ROOT_PATH, - browsers: ['ChromeHeadlessNoSandbox'], + browsers: ['ChromeHeadlessCustom'], customLaunchers: { - ChromeHeadlessNoSandbox: { + ChromeHeadlessCustom: { base: 'ChromeHeadless', - // chrome cannot run in sandboxed mode inside a docker container unless it is run with - // escalated kernel privileges: docker run --cap-add=CAP_SYS_ADMIN - flags: ['--no-sandbox'], - displayName: 'Chrome' + displayName: 'Chrome', + flags: [ + // chrome cannot run in sandboxed mode inside a docker container unless it is run with + // escalated kernel privileges (e.g. docker run --cap-add=CAP_SYS_ADMIN) + '--no-sandbox', + ], } }, frameworks: ['jasmine'], @@ -54,5 +56,14 @@ module.exports = function(config) { }; } + if (process.env.DEBUG) { + karmaConfig.logLevel = config.LOG_DEBUG; + process.env.CHROME_LOG_FILE = process.env.CHROME_LOG_FILE || 'chrome_debug.log'; + } + + if (process.env.CHROME_LOG_FILE) { + karmaConfig.customLaunchers.ChromeHeadlessCustom.flags.push('--enable-logging', '--v=1'); + } + config.set(karmaConfig); }; -- cgit v1.2.1 From 96be3a4549e2621c5c931c8699295823fa2d6d84 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 12 Jun 2017 11:48:32 -0700 Subject: Support a configurable Rails asset_host to allow for CDNs Adds support for https://gitlab.com/gitlab-com/infrastructure/issues/57 --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/environments/production.rb b/config/environments/production.rb index 82a19085b1d..87b94d74506 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -50,7 +50,7 @@ Rails.application.configure do # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Enable serving of images, stylesheets, and JavaScripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" + config.action_controller.asset_host = ENV['CDN_HOST'] if ENV['CDN_HOST'].present? # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) # config.assets.precompile += %w( search.js ) -- cgit v1.2.1 From 38ed0b53d054d780a20ab1e7d498ad031702b60c Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 15 Jun 2017 12:52:41 -0700 Subject: Rename CDN_HOST to GITLAB_CDN_HOST --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/environments/production.rb b/config/environments/production.rb index 87b94d74506..c5cbfcf64cf 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -50,7 +50,7 @@ Rails.application.configure do # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Enable serving of images, stylesheets, and JavaScripts from an asset server - config.action_controller.asset_host = ENV['CDN_HOST'] if ENV['CDN_HOST'].present? + config.action_controller.asset_host = ENV['GITLAB_CDN_HOST'] if ENV['GITLAB_CDN_HOST'].present? # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) # config.assets.precompile += %w( search.js ) -- cgit v1.2.1 From f982fef9b523a87ff7e48158bd20713789a8ee89 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Thu, 15 Jun 2017 23:41:47 +0200 Subject: set ENV['prometheus_multiproc_dir'] in config/boot.rb instead of config.ru --- config/boot.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/boot.rb b/config/boot.rb index 17a71148370..db5ab918021 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -5,6 +5,9 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +# set default directory for multiproces metrics gathering +ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_multiproc_dir' + # Default Bootsnap configuration from https://github.com/Shopify/bootsnap#usage require 'bootsnap' Bootsnap.setup( -- cgit v1.2.1 From fe0898cc14606ec0cc0ca57db9d21bf1424f290f Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 16 Jun 2017 11:10:42 +0100 Subject: Speed up used languages calculation on charts page We removed calls from our code to Rugged::Repository#fetch_attributes: However, we didn't remove calls from within Linguist. This method is only called when calculating the languages for a repository on the Charts page: We can safely use our own Gitlab::Git::Attributes here. On staging, for the GitLab CE repo, this makes the calculation take about a third of the time: # Before Benchmark.realtime do Linguist::Repository.new(repository.rugged, repository.rugged.head.target_id).languages end #=> 23.67193900188431 # After Benchmark.realtime do Linguist::Repository.new(repository.rugged, repository.rugged.head.target_id).languages end #=> 8.945212290156633 --- .../rugged_use_gitlab_git_attributes.rb | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 config/initializers/rugged_use_gitlab_git_attributes.rb (limited to 'config') diff --git a/config/initializers/rugged_use_gitlab_git_attributes.rb b/config/initializers/rugged_use_gitlab_git_attributes.rb new file mode 100644 index 00000000000..7d652799786 --- /dev/null +++ b/config/initializers/rugged_use_gitlab_git_attributes.rb @@ -0,0 +1,25 @@ +# We don't want to ever call Rugged::Repository#fetch_attributes, because it has +# a lot of I/O overhead: +# +# +# While we don't do this from within the GitLab source itself, the Linguist gem +# has a dependency on Rugged and uses the gitattributes file when calculating +# repository-wide language statistics: +# +# +# The options passed by Linguist are those assumed by Gitlab::Git::Attributes +# anyway, and there is no great efficiency gain from just fetching the listed +# attributes with our implementation, so we ignore the additional arguments. +# +module Rugged + class Repository + module UseGitlabGitAttributes + def fetch_attributes(name, *) + @attributes ||= Gitlab::Git::Attributes.new(path) + @attributes.attributes(name) + end + end + + prepend UseGitlabGitAttributes + end +end -- cgit v1.2.1