diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /config/routes | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/import.rb | 4 | ||||
-rw-r--r-- | config/routes/issues.rb | 1 | ||||
-rw-r--r-- | config/routes/pipelines.rb | 10 | ||||
-rw-r--r-- | config/routes/project.rb | 34 | ||||
-rw-r--r-- | config/routes/snippets.rb | 9 | ||||
-rw-r--r-- | config/routes/user.rb | 2 | ||||
-rw-r--r-- | config/routes/wiki.rb | 6 |
7 files changed, 55 insertions, 11 deletions
diff --git a/config/routes/import.rb b/config/routes/import.rb index cd8278f6fd0..1dc27d489f0 100644 --- a/config/routes/import.rb +++ b/config/routes/import.rb @@ -24,14 +24,12 @@ namespace :import do resource :gitlab, only: [:create], controller: :gitlab do get :status get :callback - get :jobs get :realtime_changes end resource :bitbucket, only: [:create], controller: :bitbucket do get :status get :callback - get :jobs get :realtime_changes end @@ -39,7 +37,6 @@ namespace :import do post :configure get :status get :callback - get :jobs get :realtime_changes end @@ -55,7 +52,6 @@ namespace :import do resource :fogbugz, only: [:create, :new], controller: :fogbugz do get :status post :callback - get :jobs get :realtime_changes get :new_user_map, path: :user_map diff --git a/config/routes/issues.rb b/config/routes/issues.rb index 04a935c1016..eae1cacfcf7 100644 --- a/config/routes/issues.rb +++ b/config/routes/issues.rb @@ -17,6 +17,7 @@ resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do end collection do + get :service_desk post :bulk_update post :import_csv post :export_csv diff --git a/config/routes/pipelines.rb b/config/routes/pipelines.rb index cc3c3400526..c7f9bf8791c 100644 --- a/config/routes/pipelines.rb +++ b/config/routes/pipelines.rb @@ -22,9 +22,13 @@ resources :pipelines, only: [:index, :new, :create, :show, :destroy] do get :test_reports_count end - member do - resources :stages, only: [], param: :name do - post :play_manual + resources :stages, only: [], param: :name, controller: 'pipelines/stages' do + post :play_manual + end + + resources :tests, only: [:show], param: :suite_name, controller: 'pipelines/tests' do + collection do + get :summary end end end diff --git a/config/routes/project.rb b/config/routes/project.rb index 78dcc189d5b..3bd72dbf87c 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -25,6 +25,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # Use this scope for all new project routes. scope '-' do get 'archive/*id', constraints: { format: Gitlab::PathRegex.archive_formats_regex, id: /.+?/ }, to: 'repositories#archive', as: 'archive' + get 'metrics(/:dashboard_path)', constraints: { dashboard_path: /.+\.yml/ }, + to: 'metrics_dashboard#show', as: :metrics_dashboard, format: false resources :artifacts, only: [:index, :destroy] @@ -80,6 +82,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resource :operations, only: [:show, :update] do member do post :reset_alerting_token + post :reset_pagerduty_token end end @@ -181,7 +184,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - resources :releases, only: [:index, :show, :edit], param: :tag, constraints: { tag: %r{[^/]+} } do + resources :releases, only: [:index, :new, :show, :edit], param: :tag, constraints: { tag: %r{[^/]+} } do member do get :downloads, path: 'downloads/*filepath', format: false scope module: :releases do @@ -257,7 +260,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # This route is also defined in gitlab-workhorse. Make sure to update accordingly. get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', format: false - get '/prometheus/api/v1/*proxy_path', to: 'environments/prometheus_api#proxy', as: :prometheus_api + get '/prometheus/api/v1/*proxy_path', to: 'environments/prometheus_api#prometheus_proxy', as: :prometheus_api get '/sample_metrics', to: 'environments/sample_metrics#query' end @@ -313,6 +316,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + get '/snippets/:snippet_id/raw/:ref/*path', + to: 'snippets/blobs#raw', + format: false, + as: :snippet_blob_raw, + constraints: { snippet_id: /\d+/ } + draw :issues draw :merge_requests draw :pipelines @@ -333,6 +342,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # Look for scope '-' at the top of the file. # + # Service Desk + # + get '/service_desk' => 'service_desk#show', as: :service_desk + put '/service_desk' => 'service_desk#update', as: :service_desk_refresh + + # # Templates # get '/templates/:template_type/:key' => 'templates#show', @@ -363,6 +378,19 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + # Serve snippet routes under /-/snippets. + # To ensure an old unscoped routing is used for the UI we need to + # add prefix 'as' to the scope routing and place it below original routing. + # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/29572 + scope '-', as: :scoped do + resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope + member do + get :raw + post :mark_as_spam + end + end + end + namespace :prometheus do resources :alerts, constraints: { id: /\d+/ }, only: [:index, :create, :show, :update, :destroy] do # rubocop: disable Cop/PutProjectRoutesUnderScope post :notify, on: :collection @@ -379,6 +407,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do post 'alerts/notify', to: 'alerting/notifications#create' + post 'incidents/pagerduty', to: 'incident_management/pager_duty_incidents#create' + draw :legacy_builds resources :hooks, only: [:index, :create, :edit, :update, :destroy], constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index ba6da3ac57e..1ea9a6431d8 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -17,5 +17,14 @@ resources :snippets, concerns: :awardable do end end +# Use this /-/ scope for all new snippet routes. +scope path: '-' do + get '/snippets/:snippet_id/raw/:ref/*path', + to: 'snippets/blobs#raw', + as: :snippet_blob_raw, + format: false, + constraints: { snippet_id: /\d+/ } +end + get '/s/:username', to: redirect('users/%{username}/snippets'), constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } diff --git a/config/routes/user.rb b/config/routes/user.rb index 9db3a71a270..3bf13908d39 100644 --- a/config/routes/user.rb +++ b/config/routes/user.rb @@ -56,7 +56,7 @@ end constraints(::Constraints::UserUrlConstrainer.new) do # Get all keys of user - get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: Gitlab::PathRegex.root_namespace_route_regex } + get ':username.keys', controller: :users, action: :ssh_keys, constraints: { username: Gitlab::PathRegex.root_namespace_route_regex } scope(path: ':username', as: :user, diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb index d439c99270e..49ad39e8369 100644 --- a/config/routes/wiki.rb +++ b/config/routes/wiki.rb @@ -3,13 +3,17 @@ scope(controller: :wikis) do get :git_access get :pages get :new - get '/', to: redirect('%{namespace_id}/%{project_id}/wikis/home') + get '/', to: redirect { |params, request| "#{request.path}/home" } post '/', to: 'wikis#create' + scope '-' do + resource :confluence, only: :show + end end scope(path: 'wikis/*id', as: :wiki, format: false) do get :edit get :history + get :diff post :preview_markdown get '/', action: :show put '/', action: :update |