diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 20:36:07 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 20:36:07 +0100 |
commit | e3fafa7632e038927085cf8c8228c93be44b36bd (patch) | |
tree | 4fba0d291e945415b0f0eddd40c615cd6cd70013 /config | |
parent | e0401df1214397626e65e58166988fe62715d372 (diff) | |
parent | f2f58a60b76acd479e37bdbc9246ec9f9b2bea82 (diff) | |
download | gitlab-ce-e3fafa7632e038927085cf8c8228c93be44b36bd.tar.gz |
Merge commit 'f2f58a60b76acd479e37bdbc9246ec9f9b2bea82' into object-storage-ee-to-ce-backport
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 1 | ||||
-rw-r--r-- | config/database.yml.mysql | 21 | ||||
-rw-r--r-- | config/database.yml.postgresql | 21 | ||||
-rw-r--r-- | config/dependency_decisions.yml | 7 | ||||
-rw-r--r-- | config/environments/test.rb | 1 | ||||
-rw-r--r-- | config/gitlab.yml.example | 10 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 24 | ||||
-rw-r--r-- | config/initializers/7_prometheus_metrics.rb | 18 | ||||
-rw-r--r-- | config/initializers/8_metrics.rb | 9 | ||||
-rw-r--r-- | config/initializers/peek.rb | 1 | ||||
-rw-r--r-- | config/karma.config.js | 9 | ||||
-rw-r--r-- | config/locales/doorkeeper.en.yml | 5 | ||||
-rw-r--r-- | config/prometheus/additional_metrics.yml | 4 | ||||
-rw-r--r-- | config/routes.rb | 26 | ||||
-rw-r--r-- | config/routes/ci.rb | 2 | ||||
-rw-r--r-- | config/routes/google_api.rb | 8 | ||||
-rw-r--r-- | config/routes/group.rb | 81 | ||||
-rw-r--r-- | config/routes/help.rb | 9 | ||||
-rw-r--r-- | config/routes/profile.rb | 1 | ||||
-rw-r--r-- | config/routes/project.rb | 17 | ||||
-rw-r--r-- | config/routes/snippets.rb | 2 | ||||
-rw-r--r-- | config/routes/user.rb | 12 | ||||
-rw-r--r-- | config/webpack.config.js | 11 |
23 files changed, 171 insertions, 129 deletions
diff --git a/config/application.rb b/config/application.rb index 31e91835b9e..5100ec5d2b7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -29,6 +29,7 @@ module Gitlab #{config.root}/app/models/project_services #{config.root}/app/workers/concerns #{config.root}/app/services/concerns + #{config.root}/app/serializers/concerns #{config.root}/app/finders/concerns]) config.generators.templates.push("#{config.root}/generator_templates") diff --git a/config/database.yml.mysql b/config/database.yml.mysql index eb71d3f5fe1..98c2abe9f5e 100644 --- a/config/database.yml.mysql +++ b/config/database.yml.mysql @@ -10,7 +10,7 @@ production: pool: 10 username: git password: "secure password" - # host: localhost + host: localhost # socket: /tmp/mysql.sock # @@ -25,7 +25,22 @@ development: pool: 5 username: root password: "secure password" - # host: localhost + host: localhost + # socket: /tmp/mysql.sock + +# +# Staging specific +# +staging: + adapter: mysql2 + encoding: utf8 + collation: utf8_general_ci + reconnect: false + database: gitlabhq_staging + pool: 10 + username: git + password: "secure password" + host: localhost # socket: /tmp/mysql.sock # Warning: The database defined as "test" will be erased and @@ -40,6 +55,6 @@ test: &test pool: 5 username: root password: - # host: localhost + host: localhost # socket: /tmp/mysql.sock prepared_statements: false diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql index 4b30982fe82..baded682e46 100644 --- a/config/database.yml.postgresql +++ b/config/database.yml.postgresql @@ -6,10 +6,9 @@ production: encoding: unicode database: gitlabhq_production pool: 10 - # username: git - # password: - # host: localhost - # port: 5432 + username: git + password: "secure password" + host: localhost # # Development specific @@ -20,8 +19,8 @@ development: database: gitlabhq_development pool: 5 username: postgres - password: - # host: localhost + password: "secure password" + host: localhost # # Staging specific @@ -30,10 +29,10 @@ staging: adapter: postgresql encoding: unicode database: gitlabhq_staging - pool: 5 - username: postgres - password: - # host: localhost + pool: 10 + username: git + password: "secure password" + host: localhost # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". @@ -45,5 +44,5 @@ test: &test pool: 5 username: postgres password: - # host: localhost + host: localhost prepared_statements: false diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml index db31b01a7d2..3af7f7bd5c0 100644 --- a/config/dependency_decisions.yml +++ b/config/dependency_decisions.yml @@ -464,3 +464,10 @@ :why: Our own library - https://gitlab.com/gitlab-org/gitlab-svgs :versions: [] :when: 2017-09-19 14:36:32.795496000 Z +- - :license + - pikaday + - MIT + - :who: + :why: + :versions: [] + :when: 2017-10-17 17:46:12.367554000 Z diff --git a/config/environments/test.rb b/config/environments/test.rb index 1edb6fd39b8..d09e51e766a 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,6 +1,7 @@ Rails.application.configure do # Make sure the middleware is inserted first in middleware chain config.middleware.insert_before('ActionDispatch::Static', 'Gitlab::Testing::RequestBlockerMiddleware') + config.middleware.insert_before('ActionDispatch::Static', 'Gitlab::Testing::RequestInspectorMiddleware') # Settings specified here will take precedence over those in config/application.rb diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 40ee85a3667..dfc69e358cb 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -523,7 +523,7 @@ production: &base # Gitaly settings gitaly: # Path to the directory containing Gitaly client executables. - client_path: /home/git/gitaly + client_path: /home/git/gitaly/bin # Default Gitaly authentication token. Can be overriden per storage. Can # be left blank when Gitaly is running locally on a Unix socket, which # is the normal way to deploy Gitaly. @@ -544,11 +544,6 @@ production: &base path: /home/git/repositories/ gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port) # gitaly_token: 'special token' # Optional: override global gitaly.token for this storage. - 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: 30 # Time in seconds to wait before aborting a storage access attempt - ## Backup settings backup: @@ -703,9 +698,6 @@ 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 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index ec80045696b..224ae5aa56b 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -113,12 +113,14 @@ class Settings < Settingslogic URI.parse(url_without_path).host end - # Random cron time every Sunday to load balance usage pings - def cron_random_weekly_time + # Runs every minute in a random ten-minute period on Sundays, to balance the + # load on the server receiving these pings. The usage ping is safe to run + # multiple times because of a 24 hour exclusive lock. + def cron_for_usage_ping hour = rand(24) - minute = rand(60) + minute = rand(6) - "#{minute} #{hour} * * 0" + "#{minute}0-#{minute}9 #{hour} * * 0" end end end @@ -412,7 +414,7 @@ Settings.cron_jobs['stuck_import_jobs_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['stuck_import_jobs_worker']['cron'] ||= '15 * * * *' Settings.cron_jobs['stuck_import_jobs_worker']['job_class'] = 'StuckImportJobsWorker' Settings.cron_jobs['gitlab_usage_ping_worker'] ||= Settingslogic.new({}) -Settings.cron_jobs['gitlab_usage_ping_worker']['cron'] ||= Settings.__send__(:cron_random_weekly_time) +Settings.cron_jobs['gitlab_usage_ping_worker']['cron'] ||= Settings.__send__(:cron_for_usage_ping) Settings.cron_jobs['gitlab_usage_ping_worker']['job_class'] = 'GitlabUsagePingWorker' Settings.cron_jobs['schedule_update_user_activity_worker'] ||= Settingslogic.new({}) @@ -467,17 +469,6 @@ Settings.repositories.storages.each do |key, storage| # Expand relative paths storage['path'] = Settings.absolute(storage['path']) - # Set failure defaults - storage['failure_count_threshold'] ||= 10 - storage['failure_wait_time'] ||= 30 - storage['failure_reset_time'] ||= 1800 - storage['storage_timeout'] ||= 5 - # Set turn strings into numbers - storage['failure_count_threshold'] = storage['failure_count_threshold'].to_i - storage['failure_wait_time'] = storage['failure_wait_time'].to_i - 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 @@ -558,6 +549,7 @@ Settings.webpack.dev_server['port'] ||= 3808 Settings['monitoring'] ||= Settingslogic.new({}) Settings.monitoring['ip_whitelist'] ||= ['127.0.0.1/8'] Settings.monitoring['unicorn_sampler_interval'] ||= 10 +Settings.monitoring['ruby_sampler_interval'] ||= 60 Settings.monitoring['sidekiq_exporter'] ||= Settingslogic.new({}) Settings.monitoring.sidekiq_exporter['enabled'] ||= false Settings.monitoring.sidekiq_exporter['address'] ||= 'localhost' diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb index 31839297523..e8f33593fe0 100644 --- a/config/initializers/7_prometheus_metrics.rb +++ b/config/initializers/7_prometheus_metrics.rb @@ -11,7 +11,15 @@ Prometheus::Client.configure do |config| config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir') end - config.pid_provider = Prometheus::Client::Support::Unicorn.method(:worker_pid_provider) + config.pid_provider = -> do + wid = Prometheus::Client::Support::Unicorn.worker_id + wid = Process.pid if wid.nil? + if wid.nil? + "process_pid_#{Process.pid}" + else + "worker_id_#{wid}" + end + end end Sidekiq.configure_server do |config| @@ -19,3 +27,11 @@ Sidekiq.configure_server do |config| Gitlab::Metrics::SidekiqMetricsExporter.instance.start end end + +if Gitlab::Metrics.prometheus_metrics_enabled? + unless Sidekiq.server? + Gitlab::Metrics::Samplers::UnicornSampler.initialize_instance(Settings.monitoring.unicorn_sampler_interval).start + end + + Gitlab::Metrics::Samplers::RubySampler.initialize_instance(Settings.monitoring.ruby_sampler_interval).start +end diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index e1a59d8c152..7ef594836d6 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -77,7 +77,6 @@ def instrument_classes(instrumentation) instrumentation.instrument_instance_methods(Banzai::ObjectRenderer) instrumentation.instrument_instance_methods(Banzai::Redactor) - instrumentation.instrument_methods(Banzai::NoteRenderer) [Issuable, Mentionable, Participable].each do |klass| instrumentation.instrument_instance_methods(klass) @@ -116,15 +115,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) - instrumentation.instrument_instance_method(MergeRequest, :fetch_ref) end # rubocop:enable Metrics/AbcSize -Gitlab::Metrics::UnicornSampler.initialize_instance(Settings.monitoring.unicorn_sampler_interval).start - Gitlab::Application.configure do |config| # 0 should be Sentry to catch errors in this middleware config.middleware.insert(1, Gitlab::Metrics::RequestsRackMiddleware) @@ -190,7 +183,7 @@ if Gitlab::Metrics.enabled? GC::Profiler.enable - Gitlab::Metrics::InfluxSampler.initialize_instance.start + Gitlab::Metrics::Samplers::InfluxSampler.initialize_instance.start module TrackNewRedisConnections def connect(*args) diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index a54d53cbbe2..1cff355346c 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -16,6 +16,7 @@ Peek.into Peek::Views::Redis Peek.into Peek::Views::Sidekiq Peek.into Peek::Views::Rblineprof Peek.into Peek::Views::GC +Peek.into Peek::Views::Gitaly # rubocop:disable Style/ClassAndModuleCamelCase class PEEK_DB_CLIENT diff --git a/config/karma.config.js b/config/karma.config.js index e459f5cdac3..9f018d14b8f 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -67,14 +67,5 @@ module.exports = function(config) { karmaConfig.customLaunchers.ChromeHeadlessCustom.flags.push('--enable-logging', '--v=1'); } - 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); }; diff --git a/config/locales/doorkeeper.en.yml b/config/locales/doorkeeper.en.yml index 14d49885fb3..0da6b14c29e 100644 --- a/config/locales/doorkeeper.en.yml +++ b/config/locales/doorkeeper.en.yml @@ -58,9 +58,10 @@ en: expired: "The access token expired" unknown: "The access token is invalid" scopes: - api: Access your API - read_user: Read user information + api: Access the authenticated user's API + read_user: Read the authenticated user's personal information openid: Authenticate using OpenID Connect + sudo: Perform API actions as any user in the system (if the authenticated user is an admin) flash: applications: diff --git a/config/prometheus/additional_metrics.yml b/config/prometheus/additional_metrics.yml index 33b897f46e2..190eeb59a2c 100644 --- a/config/prometheus/additional_metrics.yml +++ b/config/prometheus/additional_metrics.yml @@ -145,7 +145,7 @@ - container_memory_usage_bytes weight: 1 queries: - - query_range: '(sum(container_memory_usage_bytes{container_name!="POD",%{environment_filter}}) / count(container_memory_usage_bytes{container_name!="POD",%{environment_filter}})) /1024/1024' + - query_range: '(sum(container_memory_usage_bytes{container_name!="POD",environment="%{ci_environment_slug}"}) / count(container_memory_usage_bytes{container_name!="POD",environment="%{ci_environment_slug}"})) /1024/1024' label: Average unit: MB - title: "CPU Utilization" @@ -154,7 +154,7 @@ - container_cpu_usage_seconds_total weight: 1 queries: - - query_range: 'sum(rate(container_cpu_usage_seconds_total{container_name!="POD",%{environment_filter}}[2m])) by (cpu) * 100' + - query_range: 'sum(rate(container_cpu_usage_seconds_total{container_name!="POD",environment="%{ci_environment_slug}"}[2m])) * 100' label: CPU unit: "%" series: diff --git a/config/routes.rb b/config/routes.rb index 405bfcc2d8e..fc13dc4865f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -44,6 +44,19 @@ Rails.application.routes.draw do get 'readiness' => 'health#readiness' resources :metrics, only: [:index] mount Peek::Railtie => '/peek' + + # Boards resources shared between group and projects + resources :boards, only: [] 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 end # Koding route @@ -74,19 +87,6 @@ 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 :google_api draw :import draw :uploads diff --git a/config/routes/ci.rb b/config/routes/ci.rb index cbd4c2db852..60c1724bc05 100644 --- a/config/routes/ci.rb +++ b/config/routes/ci.rb @@ -1,5 +1,5 @@ namespace :ci do resource :lint, only: [:show, :create] - root to: redirect('/') + root to: redirect('') end diff --git a/config/routes/google_api.rb b/config/routes/google_api.rb index 3fb236d3d51..a119b47c176 100644 --- a/config/routes/google_api.rb +++ b/config/routes/google_api.rb @@ -1,5 +1,7 @@ -namespace :google_api do - resource :auth, only: [], controller: :authorizations do - match :callback, via: [:get, :post] +scope '-' do + namespace :google_api do + resource :auth, only: [], controller: :authorizations do + match :callback, via: [:get, :post] + end end end diff --git a/config/routes/group.rb b/config/routes/group.rb index 23052a6c6dc..db99e10bb9a 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -1,51 +1,56 @@ require 'constraints/group_url_constrainer' -resources :groups, only: [:index, :new, :create] - -scope(path: 'groups/*group_id', - module: :groups, - as: :group, - constraints: { group_id: Gitlab::PathRegex.full_namespace_route_regex }) do - resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do - post :resend_invite, on: :member - delete :leave, on: :collection - end +resources :groups, only: [:index, :new, :create] do + post :preview_markdown +end - resource :avatar, only: [:destroy] - resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :edit, :update, :new, :create] do - member do - get :merge_requests - get :participants - get :labels +constraints(GroupUrlConstrainer.new) do + scope(path: 'groups/*id', + controller: :groups, + constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do + scope(path: '-') do + get :edit, as: :edit_group + get :issues, as: :issues_group + get :merge_requests, as: :merge_requests_group + get :projects, as: :projects_group + get :activity, as: :activity_group end - end - resources :labels, except: [:show] do - post :toggle_subscription, on: :member + get '/', action: :show, as: :group_canonical end - scope path: '-' do + scope(path: 'groups/*group_id/-', + module: :groups, + as: :group, + constraints: { group_id: Gitlab::PathRegex.full_namespace_route_regex }) do namespace :settings do resource :ci_cd, only: [:show], controller: 'ci_cd' end resources :variables, only: [:index, :show, :update, :create, :destroy] - end -end -scope(path: 'groups/*id', - controller: :groups, - constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do - get :edit, as: :edit_group - get :issues, as: :issues_group - get :merge_requests, as: :merge_requests_group - get :projects, as: :projects_group - get :activity, as: :activity_group - get :subgroups, as: :subgroups_group - get '/', action: :show, as: :group_canonical -end + resources :children, only: [:index] + + resources :labels, except: [:show] do + post :toggle_subscription, on: :member + end + + resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :edit, :update, :new, :create] do + member do + get :merge_requests + get :participants + get :labels + end + end + + resource :avatar, only: [:destroy] + + resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do + post :resend_invite, on: :member + delete :leave, on: :collection + end + end -constraints(GroupUrlConstrainer.new) do scope(path: '*id', as: :group, constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }, @@ -55,4 +60,12 @@ constraints(GroupUrlConstrainer.new) do put '/', action: :update delete '/', action: :destroy end + + # Legacy paths should be defined last, so they would be ignored if routes with + # one of the previously reserved words exist. + scope(path: 'groups/*group_id') do + Gitlab::Routing.redirect_legacy_paths(self, :labels, :milestones, :group_members, + :edit, :issues, :merge_requests, :projects, + :activity) + end end diff --git a/config/routes/help.rb b/config/routes/help.rb index d53822da9ec..2ea8bfd7aed 100644 --- a/config/routes/help.rb +++ b/config/routes/help.rb @@ -1,4 +1,5 @@ -get 'help' => 'help#index' -get 'help/shortcuts' => 'help#shortcuts' -get 'help/ui' => 'help#ui' -get 'help/*path' => 'help#show', as: :help_page +get 'help' => 'help#index' +get 'help/shortcuts' => 'help#shortcuts' +get 'help/ui' => 'help#ui' +get 'help/instance_configuration' => 'help#instance_configuration' +get 'help/*path' => 'help#show', as: :help_page diff --git a/config/routes/profile.rb b/config/routes/profile.rb index ddc852f0132..bcfc17a5f66 100644 --- a/config/routes/profile.rb +++ b/config/routes/profile.rb @@ -6,7 +6,6 @@ resource :profile, only: [:show, :update] do get :audit_log get :applications, to: 'oauth/applications#index' - put :reset_private_token put :reset_incoming_email_token put :reset_rss_token put :update_username diff --git a/config/routes/project.rb b/config/routes/project.rb index 7f0e056c884..bdafaba3ab3 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -186,10 +186,15 @@ constraints(ProjectUrlConstrainer.new) do resources :clusters, except: [:edit] do collection do get :login + get '/providers/gcp/new', action: :new_gcp end member do get :status, format: :json + + scope :applications do + post '/:application', to: 'clusters/applications#create', as: :install_applications + end end end @@ -281,13 +286,19 @@ constraints(ProjectUrlConstrainer.new) do namespace :registry do resources :repository, only: [] do - resources :tags, only: [:index, :destroy], - constraints: { id: Gitlab::Regex.container_registry_tag_regex } + # We default to JSON format in the controller to avoid ambiguity. + # `latest.json` could either be a request for a tag named `latest` + # in JSON format, or a request for tag named `latest.json`. + scope format: false do + resources :tags, only: [:index, :destroy], + constraints: { id: Gitlab::Regex.container_registry_tag_regex } + end end end resources :milestones, constraints: { id: /\d+/ } do member do + post :promote put :sort_issues put :sort_merge_requests get :merge_requests @@ -388,7 +399,7 @@ constraints(ProjectUrlConstrainer.new) do end end namespace :settings do - get :members, to: redirect('/%{namespace_id}/%{project_id}/project_members') + get :members, to: redirect("%{namespace_id}/%{project_id}/project_members") resource :ci_cd, only: [:show], controller: 'ci_cd' resource :integrations, only: [:show] resource :repository, only: [:show], controller: :repository diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index 0a4ebac3ca3..81bc890d86b 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -17,5 +17,5 @@ resources :snippets, concerns: :awardable do end end -get '/s/:username', to: redirect('/u/%{username}/snippets'), +get '/s/:username', to: redirect('u/%{username}/snippets'), constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } diff --git a/config/routes/user.rb b/config/routes/user.rb index e682dcd6663..733a3f6ce9a 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -22,17 +22,17 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d get :contributed, as: :contributed_projects get :snippets get :exists - get '/', to: redirect('/%{username}'), as: nil + get '/', to: redirect('%{username}'), as: nil end # Compatibility with old routing # TODO (dzaporozhets): remove in 10.0 - get '/u/:username', to: redirect('/%{username}') + get '/u/:username', to: redirect('%{username}') # TODO (dzaporozhets): remove in 9.0 - get '/u/:username/groups', to: redirect('/users/%{username}/groups') - get '/u/:username/projects', to: redirect('/users/%{username}/projects') - get '/u/:username/snippets', to: redirect('/users/%{username}/snippets') - get '/u/:username/contributed', to: redirect('/users/%{username}/contributed') + get '/u/:username/groups', to: redirect('users/%{username}/groups') + get '/u/:username/projects', to: redirect('users/%{username}/projects') + get '/u/:username/snippets', to: redirect('users/%{username}/snippets') + get '/u/:username/contributed', to: redirect('users/%{username}/contributed') end constraints(UserUrlConstrainer.new) do diff --git a/config/webpack.config.js b/config/webpack.config.js index 8cded750a66..67d7cae3ccf 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -84,6 +84,7 @@ var config = { vue_merge_request_widget: './vue_merge_request_widget/index.js', test: './test.js', two_factor_auth: './two_factor_auth.js', + users: './users/index.js', performance_bar: './performance_bar.js', webpack_runtime: './webpack.js', }, @@ -107,6 +108,10 @@ var config = { loader: 'vue-loader', }, { + test: /\.ts$/, + loader: 'ts-loader', + }, + { test: /\.svg$/, loader: 'raw-loader', }, @@ -215,7 +220,9 @@ var config = { name: 'common_d3', chunks: [ 'graphs', + 'graphs_show', 'monitoring', + 'users', ], }), @@ -233,7 +240,7 @@ var config = { from: path.join(ROOT_PATH, `node_modules/monaco-editor/${IS_PRODUCTION ? 'min' : 'dev'}/vs`), to: 'monaco-editor/vs', transform: function(content, path) { - if (/\.js$/.test(path) && !/worker/i.test(path)) { + if (/\.js$/.test(path) && !/worker/i.test(path) && !/typescript/i.test(path)) { return ( '(function(){\n' + 'var define = this.define, require = this.require;\n' + @@ -249,7 +256,7 @@ var config = { ], resolve: { - extensions: ['.js'], + extensions: ['.js', '.ts'], alias: { '~': path.join(ROOT_PATH, 'app/assets/javascripts'), 'emojis': path.join(ROOT_PATH, 'fixtures/emojis'), |