diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-03 09:36:09 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-03 09:36:09 +0200 |
commit | fc550b398be6cdc4584dad79411929305815ffaa (patch) | |
tree | 0995b6990fa3599dddfed5bd2720589731bcdf31 /config | |
parent | 83d1fe9b5aeb947c1387666205ecaca81f2bf3a2 (diff) | |
parent | e7e9307219d1c81427f95444b36471c519dc06c2 (diff) | |
download | gitlab-ce-fc550b398be6cdc4584dad79411929305815ffaa.tar.gz |
Merge branch 'master' into feature/multi-level-container-registry-images
* master: (230 commits)
Fix N+1 query in loading pipelines in merge requests
Fix Spinach and Capybara dependencies
Prevent users from disconnecting gitlab account from CAS
30276 Move issue, mr, todos next to profile dropdown in top nav
Refactor SearchController#show
Properly eagerly-load the Capybara server for JS feature specs only
Updating documentation to include a missing step in the update procedure
Eager-load the Capybara server to prevent timeouts
Increase Capybara's timeout
Add metrics button to Environment Overview page
Fix link to Jira service documentation
Handle parsing OpenBSD ps output properly to display sidekiq infos on ...
Eliminate unnecessary queries that add ~500 ms of load time for a large issue
20914 Limits line length for project home page
Allow users to import GitHub projects to subgroups
Update dpl CI example
Fix the docs:check:links job
Don't clean up the gitlab-test-fork_bare repo
Make GitLab use Gitaly for commit_is_ancestor
Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery
...
Diffstat (limited to 'config')
-rw-r--r-- | config/gitlab.yml.example | 18 | ||||
-rw-r--r-- | config/initializers/0_inflections.rb | 2 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 31 | ||||
-rw-r--r-- | config/initializers/8_gitaly.rb | 20 | ||||
-rw-r--r-- | config/initializers/rspec_profiling.rb | 6 | ||||
-rw-r--r-- | config/routes/project.rb | 4 | ||||
-rw-r--r-- | config/webpack.config.js | 8 |
7 files changed, 64 insertions, 25 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 3747baf4c3b..bd27f01c872 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -443,14 +443,10 @@ production: &base # Gitaly settings gitaly: - # The socket_path setting is optional and obsolete. When this is set - # GitLab assumes it can reach a Gitaly services via a Unix socket at - # this path. When this is commented out GitLab will not use Gitaly. - # - # This setting is obsolete because we expect it to be moved under - # repositories/storages in GitLab 9.1. - # - # socket_path: tmp/sockets/private/gitaly.socket + # This setting controls whether GitLab uses Gitaly (new component + # introduced in 9.0). Eventually Gitaly use will become mandatory and + # this option will disappear. + enabled: false # # 4. Advanced settings @@ -465,6 +461,7 @@ production: &base storages: # You must have at least a `default` storage path. default: path: /home/git/repositories/ + gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket ## Backup settings backup: @@ -573,10 +570,15 @@ test: # In order to setup it correctly you need to specify # your system username you use to run GitLab # user: YOUR_USERNAME + pages: + path: tmp/tests/pages repositories: storages: default: path: tmp/tests/repositories/ + gitaly_address: unix:<%= Rails.root.join('tmp/sockets/private/gitaly.socket') %> + gitaly: + enabled: false backup: path: tmp/tests/backups gitlab_shell: diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb index d4197da3fa9..f977104ff9d 100644 --- a/config/initializers/0_inflections.rb +++ b/config/initializers/0_inflections.rb @@ -10,5 +10,5 @@ # end # ActiveSupport::Inflector.inflections do |inflect| - inflect.uncountable %w(award_emoji project_statistics) + inflect.uncountable %w(award_emoji project_statistics system_note_metadata) end diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 62020fa9a75..e8fef0000c1 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -79,6 +79,10 @@ class Settings < Settingslogic value end + def absolute(path) + File.expand_path(path, Rails.root) + end + private def base_url(config) @@ -178,7 +182,7 @@ if github_settings end Settings['shared'] ||= Settingslogic.new({}) -Settings.shared['path'] = File.expand_path(Settings.shared['path'] || "shared", Rails.root) +Settings.shared['path'] = Settings.absolute(Settings.shared['path'] || "shared") Settings['issues_tracker'] ||= {} @@ -237,7 +241,7 @@ Settings['gitlab_ci'] ||= Settingslogic.new({}) Settings.gitlab_ci['shared_runners_enabled'] = true if Settings.gitlab_ci['shared_runners_enabled'].nil? Settings.gitlab_ci['all_broken_builds'] = true if Settings.gitlab_ci['all_broken_builds'].nil? Settings.gitlab_ci['add_pusher'] = false if Settings.gitlab_ci['add_pusher'].nil? -Settings.gitlab_ci['builds_path'] = File.expand_path(Settings.gitlab_ci['builds_path'] || "builds/", Rails.root) +Settings.gitlab_ci['builds_path'] = Settings.absolute(Settings.gitlab_ci['builds_path'] || "builds/") Settings.gitlab_ci['url'] ||= Settings.send(:build_gitlab_ci_url) # @@ -251,7 +255,7 @@ Settings.incoming_email['enabled'] = false if Settings.incoming_email['enabled'] # Settings['artifacts'] ||= Settingslogic.new({}) Settings.artifacts['enabled'] = true if Settings.artifacts['enabled'].nil? -Settings.artifacts['path'] = File.expand_path(Settings.artifacts['path'] || File.join(Settings.shared['path'], "artifacts"), Rails.root) +Settings.artifacts['path'] = Settings.absolute(Settings.artifacts['path'] || File.join(Settings.shared['path'], "artifacts")) Settings.artifacts['max_size'] ||= 100 # in megabytes # @@ -265,14 +269,14 @@ Settings.registry['api_url'] ||= "http://localhost:5000/" Settings.registry['key'] ||= nil Settings.registry['issuer'] ||= nil Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':') -Settings.registry['path'] = File.expand_path(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry'), Rails.root) +Settings.registry['path'] = Settings.absolute(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry')) # # Pages # Settings['pages'] ||= Settingslogic.new({}) Settings.pages['enabled'] = false if Settings.pages['enabled'].nil? -Settings.pages['path'] = File.expand_path(Settings.pages['path'] || File.join(Settings.shared['path'], "pages"), Rails.root) +Settings.pages['path'] = Settings.absolute(Settings.pages['path'] || File.join(Settings.shared['path'], "pages")) Settings.pages['https'] = false if Settings.pages['https'].nil? Settings.pages['host'] ||= "example.com" Settings.pages['port'] ||= Settings.pages.https ? 443 : 80 @@ -286,7 +290,7 @@ Settings.pages['external_https'] ||= false unless Settings.pages['external_http # Settings['lfs'] ||= Settingslogic.new({}) Settings.lfs['enabled'] = true if Settings.lfs['enabled'].nil? -Settings.lfs['storage_path'] = File.expand_path(Settings.lfs['storage_path'] || File.join(Settings.shared['path'], "lfs-objects"), Rails.root) +Settings.lfs['storage_path'] = Settings.absolute(Settings.lfs['storage_path'] || File.join(Settings.shared['path'], "lfs-objects")) # # Mattermost @@ -350,8 +354,8 @@ Settings.cron_jobs['remove_unreferenced_lfs_objects_worker']['job_class'] = 'Rem # GitLab Shell # Settings['gitlab_shell'] ||= Settingslogic.new({}) -Settings.gitlab_shell['path'] ||= Settings.gitlab['user_home'] + '/gitlab-shell/' -Settings.gitlab_shell['hooks_path'] ||= Settings.gitlab['user_home'] + '/gitlab-shell/hooks/' +Settings.gitlab_shell['path'] = Settings.absolute(Settings.gitlab_shell['path'] || Settings.gitlab['user_home'] + '/gitlab-shell/') +Settings.gitlab_shell['hooks_path'] = Settings.absolute(Settings.gitlab_shell['hooks_path'] || Settings.gitlab['user_home'] + '/gitlab-shell/hooks/') Settings.gitlab_shell['secret_file'] ||= Rails.root.join('.gitlab_shell_secret') Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil? Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil? @@ -374,6 +378,11 @@ unless Settings.repositories.storages['default'] Settings.repositories.storages['default']['path'] ||= Settings.gitlab['user_home'] + '/repositories/' end +Settings.repositories.storages.values.each do |storage| + # Expand relative paths + storage['path'] = Settings.absolute(storage['path']) +end + # # The repository_downloads_path is used to remove outdated repository # archives, if someone has it configured incorrectly, and it points @@ -395,7 +404,7 @@ end Settings['backup'] ||= Settingslogic.new({}) Settings.backup['keep_time'] ||= 0 Settings.backup['pg_schema'] = nil -Settings.backup['path'] = File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root) +Settings.backup['path'] = Settings.absolute(Settings.backup['path'] || "tmp/backups/") Settings.backup['archive_permissions'] ||= 0600 Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'connection' => nil }) # Convert upload connection settings to use symbol keys, to make Fog happy @@ -418,7 +427,7 @@ Settings.git['timeout'] ||= 10 # least. This setting is fed to 'rm -rf' in # db/migrate/20151023144219_remove_satellites.rb Settings['satellites'] ||= Settingslogic.new({}) -Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) +Settings.satellites['path'] = Settings.absolute(Settings.satellites['path'] || "tmp/repo_satellites/") # # Extra customization @@ -440,7 +449,7 @@ Settings.rack_attack.git_basic_auth['bantime'] ||= 1.hour # Gitaly # Settings['gitaly'] ||= Settingslogic.new({}) -Settings.gitaly['socket_path'] ||= ENV['GITALY_SOCKET_PATH'] +Settings.gitaly['enabled'] ||= false # # Webpack settings diff --git a/config/initializers/8_gitaly.rb b/config/initializers/8_gitaly.rb index 07dd30f0a24..69c0a91d6f0 100644 --- a/config/initializers/8_gitaly.rb +++ b/config/initializers/8_gitaly.rb @@ -1,2 +1,18 @@ -# Make sure we initialize a Gitaly channel before Sidekiq starts multi-threaded execution. -Gitlab::GitalyClient.channel unless Rails.env.test? +require 'uri' + +# Make sure we initialize our Gitaly channels before Sidekiq starts multi-threaded execution. +if Gitlab.config.gitaly.enabled || Rails.env.test? + Gitlab.config.repositories.storages.each do |name, params| + address = params['gitaly_address'] + + unless address.present? + raise "storage #{name.inspect} is missing a gitaly_address" + end + + unless URI(address).scheme == 'unix' + raise "Unsupported Gitaly address: #{address.inspect}" + end + + Gitlab::GitalyClient.configure_channel(name, address) + end +end diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb index 70177995356..764c067c6f0 100644 --- a/config/initializers/rspec_profiling.rb +++ b/config/initializers/rspec_profiling.rb @@ -7,7 +7,11 @@ module RspecProfilingExt module Git def branch - ENV['CI_COMMIT_REF_NAME'] || super + if ENV['CI_COMMIT_REF_NAME'] + "#{defined?(Gitlab::License) ? 'ee' : 'ce'}:#{ENV['CI_COMMIT_REF_NAME']}" + else + super + end end end diff --git a/config/routes/project.rb b/config/routes/project.rb index 0269857f9fb..f85521fe6d3 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -102,6 +102,7 @@ constraints(ProjectUrlConstrainer.new) do get :merge_widget_refresh post :cancel_merge_when_pipeline_succeeds get :ci_status + get :pipeline_status get :ci_environments_status post :toggle_subscription post :remove_wip @@ -152,6 +153,7 @@ constraints(ProjectUrlConstrainer.new) do post :cancel post :retry get :builds + get :status end end @@ -164,7 +166,7 @@ constraints(ProjectUrlConstrainer.new) do end collection do - get :folder, path: 'folders/:id' + get :folder, path: 'folders/*id', constraints: { format: /(html|json)/ } end end diff --git a/config/webpack.config.js b/config/webpack.config.js index 0859c8416c8..70d98b022c1 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -37,6 +37,7 @@ var config = { merge_request_widget: './merge_request_widget/ci_bundle.js', monitoring: './monitoring/monitoring_bundle.js', network: './network/network_bundle.js', + notebook_viewer: './blob/notebook_viewer.js', profile: './profile/profile_bundle.js', protected_branches: './protected_branches/protected_branches_bundle.js', snippet: './snippet/snippet_bundle.js', @@ -105,6 +106,7 @@ var config = { 'environments_folder', 'issuable', 'merge_conflicts', + 'notebook_viewer', 'vue_pipelines', ], minChunks: function(module, count) { @@ -115,7 +117,11 @@ var config = { // create cacheable common library bundle for all d3 chunks new webpack.optimize.CommonsChunkPlugin({ name: 'common_d3', - chunks: ['graphs', 'users', 'monitoring'], + chunks: [ + 'graphs', + 'users', + 'monitoring', + ], }), // create cacheable common library bundles |