diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /config/routes/project.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'config/routes/project.rb')
-rw-r--r-- | config/routes/project.rb | 130 |
1 files changed, 74 insertions, 56 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb index 3bd72dbf87c..d02dc974434 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -25,11 +25,24 @@ 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/ }, + get 'metrics(/:dashboard_path)(/:page)', constraints: { dashboard_path: /.+\.yml/, page: 'panel/new' }, to: 'metrics_dashboard#show', as: :metrics_dashboard, format: false + namespace :metrics, module: :metrics do + namespace :dashboards do + post :builder, to: 'builder#panel_preview' + end + end + resources :artifacts, only: [:index, :destroy] + resources :packages, only: [:index, :show, :destroy], module: :packages + resources :package_files, only: [], module: :packages do + member do + get :download + end + end + resources :jobs, only: [:index, :show], constraints: { id: /\d+/ } do collection do resources :artifacts, only: [] do @@ -291,10 +304,22 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get 'details', on: :member end + post 'incidents/integrations/pagerduty', to: 'incident_management/pager_duty_incidents#create' + + resources :incidents, only: [:index] + namespace :error_tracking do resources :projects, only: :index end + resources :product_analytics, only: [:index] do + collection do + get :setup + get :test + get :graphs + end + end + resources :error_tracking, only: [:index], controller: :error_tracking do collection do get ':issue_id/details', @@ -335,6 +360,13 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do namespace :import do resource :jira, only: [:show], controller: :jira end + + resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do + member do + get :raw + post :mark_as_spam + end + end end # End of the /-/ scope. @@ -344,18 +376,18 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # # Service Desk # - get '/service_desk' => 'service_desk#show', as: :service_desk - put '/service_desk' => 'service_desk#update', as: :service_desk_refresh + get '/service_desk' => 'service_desk#show', as: :service_desk # rubocop:todo Cop/PutProjectRoutesUnderScope + put '/service_desk' => 'service_desk#update', as: :service_desk_refresh # rubocop:todo Cop/PutProjectRoutesUnderScope # # Templates # - get '/templates/:template_type/:key' => 'templates#show', + get '/templates/:template_type/:key' => 'templates#show', # rubocop:todo Cop/PutProjectRoutesUnderScope as: :template, defaults: { format: 'json' }, constraints: { key: %r{[^/]+}, template_type: %r{issue|merge_request}, format: 'json' } - get '/description_templates/names/:template_type', + get '/description_templates/names/:template_type', # rubocop:todo Cop/PutProjectRoutesUnderScope to: 'templates#names', as: :template_names, defaults: { format: 'json' }, @@ -364,61 +396,39 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resource :pages, only: [:show, :update, :destroy] do # rubocop: disable Cop/PutProjectRoutesUnderScope resources :domains, except: :index, controller: 'pages_domains', constraints: { id: %r{[^/]+} } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do - post :verify - post :retry_auto_ssl - delete :clean_certificate - end - end - end - - resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope - member do - get :raw - post :mark_as_spam - 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 + post :verify # rubocop:todo Cop/PutProjectRoutesUnderScope + post :retry_auto_ssl # rubocop:todo Cop/PutProjectRoutesUnderScope + delete :clean_certificate # rubocop:todo Cop/PutProjectRoutesUnderScope 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 + post :notify, on: :collection # rubocop:todo Cop/PutProjectRoutesUnderScope member do - get :metrics_dashboard + get :metrics_dashboard # rubocop:todo Cop/PutProjectRoutesUnderScope end end resources :metrics, constraints: { id: %r{[^\/]+} }, only: [:index, :new, :create, :edit, :update, :destroy] do # rubocop: disable Cop/PutProjectRoutesUnderScope - get :active_common, on: :collection - post :validate_query, on: :collection + get :active_common, on: :collection # rubocop:todo Cop/PutProjectRoutesUnderScope + post :validate_query, on: :collection # rubocop:todo Cop/PutProjectRoutesUnderScope end end - post 'alerts/notify', to: 'alerting/notifications#create' - - post 'incidents/pagerduty', to: 'incident_management/pager_duty_incidents#create' + post 'alerts/notify', to: 'alerting/notifications#create' # rubocop:todo Cop/PutProjectRoutesUnderScope draw :legacy_builds resources :hooks, only: [:index, :create, :edit, :update, :destroy], constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do - post :test + post :test # rubocop:todo Cop/PutProjectRoutesUnderScope end resources :hook_logs, only: [:show] do # rubocop: disable Cop/PutProjectRoutesUnderScope member do - post :retry + post :retry # rubocop:todo Cop/PutProjectRoutesUnderScope end end end @@ -435,7 +445,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resources :tags, only: [:index, :destroy], # rubocop: disable Cop/PutProjectRoutesUnderScope constraints: { id: Gitlab::Regex.container_registry_tag_regex } do collection do - delete :bulk_destroy + delete :bulk_destroy # rubocop:todo Cop/PutProjectRoutesUnderScope end end end @@ -444,32 +454,32 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do resources :notes, only: [:create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do - delete :delete_attachment - post :resolve - delete :resolve, action: :unresolve + delete :delete_attachment # rubocop:todo Cop/PutProjectRoutesUnderScope + post :resolve # rubocop:todo Cop/PutProjectRoutesUnderScope + delete :resolve, action: :unresolve # rubocop:todo Cop/PutProjectRoutesUnderScope end end - get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes' + get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes' # rubocop:todo Cop/PutProjectRoutesUnderScope resources :todos, only: [:create] # rubocop: disable Cop/PutProjectRoutesUnderScope resources :uploads, only: [:create] do # rubocop: disable Cop/PutProjectRoutesUnderScope collection do - get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} }, format: false, defaults: { format: nil } - post :authorize + get ":secret/:filename", action: :show, as: :show, constraints: { filename: %r{[^/]+} }, format: false, defaults: { format: nil } # rubocop:todo Cop/PutProjectRoutesUnderScope + post :authorize # rubocop:todo Cop/PutProjectRoutesUnderScope end end resources :runners, only: [:index, :edit, :update, :destroy, :show] do # rubocop: disable Cop/PutProjectRoutesUnderScope member do - post :resume - post :pause + post :resume # rubocop:todo Cop/PutProjectRoutesUnderScope + post :pause # rubocop:todo Cop/PutProjectRoutesUnderScope end collection do - post :toggle_shared_runners - post :toggle_group_runners + post :toggle_shared_runners # rubocop:todo Cop/PutProjectRoutesUnderScope + post :toggle_group_runners # rubocop:todo Cop/PutProjectRoutesUnderScope end end @@ -478,34 +488,42 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do collection do scope '*ref', constraints: { ref: Gitlab::PathRegex.git_reference_regex } do constraints format: /svg/ do - get :pipeline - get :coverage + get :pipeline # rubocop:todo Cop/PutProjectRoutesUnderScope + get :coverage # rubocop:todo Cop/PutProjectRoutesUnderScope end end end end scope :usage_ping, controller: :usage_ping do - post :web_ide_clientside_preview - post :web_ide_pipelines_count + post :web_ide_clientside_preview # rubocop:todo Cop/PutProjectRoutesUnderScope + post :web_ide_pipelines_count # rubocop:todo Cop/PutProjectRoutesUnderScope end resources :web_ide_terminals, path: :ide_terminals, only: [:create, :show], constraints: { id: /\d+/, format: :json } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do - post :cancel - post :retry + post :cancel # rubocop:todo Cop/PutProjectRoutesUnderScope + post :retry # rubocop:todo Cop/PutProjectRoutesUnderScope end collection do - post :check_config + post :check_config # rubocop:todo Cop/PutProjectRoutesUnderScope end end # Deprecated unscoped routing. - # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 scope as: 'deprecated' do + # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 draw :pipelines draw :repository + + # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/29572 + resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope + member do + get :raw # rubocop:todo Cop/PutProjectRoutesUnderScope + post :mark_as_spam # rubocop:todo Cop/PutProjectRoutesUnderScope + end + end end # All new routes should go under /-/ scope. |