diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /config/routes | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'config/routes')
-rw-r--r-- | config/routes/admin.rb | 9 | ||||
-rw-r--r-- | config/routes/issues.rb | 1 | ||||
-rw-r--r-- | config/routes/merge_requests.rb | 2 | ||||
-rw-r--r-- | config/routes/pipelines.rb | 37 | ||||
-rw-r--r-- | config/routes/project.rb | 109 | ||||
-rw-r--r-- | config/routes/repository_scoped.rb | 4 |
6 files changed, 92 insertions, 70 deletions
diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 96cd6e5f587..f3b7fb5ed45 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -81,7 +81,6 @@ namespace :admin do post :preview, on: :collection end - resource :logs, only: [:show] resource :health_check, controller: 'health_check', only: [:show] resource :background_jobs, controller: 'background_jobs', only: [:show] @@ -116,10 +115,6 @@ namespace :admin do end resource :application_settings, only: :update do - # This redirect should be removed with 13.0 release. - # https://gitlab.com/gitlab-org/gitlab/issues/199427 - get '/', to: redirect('admin/application_settings/general'), as: nil - resources :services, only: [:index, :edit, :update] resources :integrations, only: [:edit, :update] do member do @@ -159,6 +154,10 @@ namespace :admin do end end + namespace :ci do + resource :variables, only: [:show, :update] + end + concerns :clusterable get '/dashboard/stats', to: 'dashboard#stats' diff --git a/config/routes/issues.rb b/config/routes/issues.rb index 51b4637b89f..04a935c1016 100644 --- a/config/routes/issues.rb +++ b/config/routes/issues.rb @@ -13,6 +13,7 @@ resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do get :realtime_changes post :create_merge_request get :discussions, format: :json + get '/designs(/*vueroute)', to: 'issues#designs', as: :designs, format: false end collection do diff --git a/config/routes/merge_requests.rb b/config/routes/merge_requests.rb index fe58649b684..f6c45081ce0 100644 --- a/config/routes/merge_requests.rb +++ b/config/routes/merge_requests.rb @@ -14,7 +14,9 @@ resources :merge_requests, concerns: :awardable, except: [:new, :create, :show], post :rebase get :test_reports get :exposed_artifacts + get :accessibility_reports get :coverage_reports + get :terraform_reports scope constraints: ->(req) { req.format == :json }, as: :json do get :commits diff --git a/config/routes/pipelines.rb b/config/routes/pipelines.rb new file mode 100644 index 00000000000..cc3c3400526 --- /dev/null +++ b/config/routes/pipelines.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +resources :pipelines, only: [:index, :new, :create, :show, :destroy] do + collection do + resource :pipelines_settings, path: 'settings', only: [:show, :update] + get :charts + scope '(*ref)', constraints: { ref: Gitlab::PathRegex.git_reference_regex } do + get :latest, action: :show, defaults: { latest: true } + end + end + + member do + get :stage + get :stage_ajax + post :cancel + post :retry + get :builds + get :dag + get :failures + get :status + get :test_report + get :test_reports_count + end + + member do + resources :stages, only: [], param: :name do + post :play_manual + end + end +end + +resources :pipeline_schedules, except: [:show] do + member do + post :play + post :take_ownership + end +end diff --git a/config/routes/project.rb b/config/routes/project.rb index 29e83b8dd5d..020bfa7687d 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -65,6 +65,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do namespace :ci do resource :lint, only: [:show, :create] + resources :daily_build_group_report_results, only: [:index], constraints: { format: 'csv' } end namespace :settings do @@ -90,6 +91,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do post :create_deploy_token, path: 'deploy_token/create' post :cleanup end + + resources :access_tokens, only: [:index, :create] do + member do + put :revoke + end + end end resources :autocomplete_sources, only: [] do @@ -277,6 +284,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + resources :alert_management, only: [:index] do + get 'details', on: :member + end + namespace :error_tracking do resources :projects, only: :index end @@ -295,6 +306,13 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end + namespace :design_management do + namespace :designs, path: 'designs/:design_id(/:sha)', constraints: -> (params) { params[:sha].nil? || Gitlab::Git.commit_id?(params[:sha]) } do + resource :raw_image, only: :show + resources :resized_image, only: :show, constraints: -> (params) { DesignManagement::DESIGN_IMAGE_SIZES.include?(params[:id]) } + end + end + draw :issues draw :merge_requests @@ -314,7 +332,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # All new routes should go under /-/ scope. # Look for scope '-' at the top of the file. - # rubocop: disable Cop/PutProjectRoutesUnderScope # # Templates @@ -330,8 +347,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do defaults: { format: 'json' }, constraints: { template_type: %r{issue|merge_request}, format: 'json' } - resource :pages, only: [:show, :update, :destroy] do - resources :domains, except: :index, controller: 'pages_domains', constraints: { id: %r{[^/]+} } 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 @@ -340,7 +357,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do + resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do get :raw post :mark_as_spam @@ -348,14 +365,14 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end namespace :prometheus do - resources :alerts, constraints: { id: /\d+/ }, only: [:index, :create, :show, :update, :destroy] do + resources :alerts, constraints: { id: /\d+/ }, only: [:index, :create, :show, :update, :destroy] do # rubocop: disable Cop/PutProjectRoutesUnderScope post :notify, on: :collection member do get :metrics_dashboard end end - resources :metrics, constraints: { id: %r{[^\/]+} }, only: [:index, :new, :create, :edit, :update, :destroy] do + 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 end @@ -363,65 +380,41 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do post 'alerts/notify', to: 'alerting/notifications#create' - resources :pipelines, only: [:index, :new, :create, :show, :destroy] do - collection do - resource :pipelines_settings, path: 'settings', only: [:show, :update] - get :charts - scope '(*ref)', constraints: { ref: Gitlab::PathRegex.git_reference_regex } do - get :latest, action: :show, defaults: { latest: true } - end - end - - member do - get :stage - get :stage_ajax - post :cancel - post :retry - get :builds - get :failures - get :status - get :test_report - get :test_reports_count - end - - member do - resources :stages, only: [], param: :name do - post :play_manual - end - end - end + # Unscoped route. It will be replaced with redirect to /-/pipelines/ + # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 + draw :pipelines - resources :pipeline_schedules, except: [:show] do - member do - post :play - post :take_ownership - end + # 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/118849 + scope '-', as: 'scoped' do + draw :pipelines end draw :legacy_builds - resources :hooks, only: [:index, :create, :edit, :update, :destroy], constraints: { id: /\d+/ } do + resources :hooks, only: [:index, :create, :edit, :update, :destroy], constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do post :test end - resources :hook_logs, only: [:show] do + resources :hook_logs, only: [:show] do # rubocop: disable Cop/PutProjectRoutesUnderScope member do post :retry end end end - resources :container_registry, only: [:index, :destroy, :show], + resources :container_registry, only: [:index, :destroy, :show], # rubocop: disable Cop/PutProjectRoutesUnderScope controller: 'registry/repositories' namespace :registry do - resources :repository, only: [] do + resources :repository, only: [] do # rubocop: disable Cop/PutProjectRoutesUnderScope # 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], + resources :tags, only: [:index, :destroy], # rubocop: disable Cop/PutProjectRoutesUnderScope constraints: { id: Gitlab::Regex.container_registry_tag_regex } do collection do delete :bulk_destroy @@ -431,13 +424,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - # Unscoped route. It will be replaced with redirect to /-/issues/ - # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 - scope as: 'deprecated' do - draw :issues - end - - resources :notes, only: [:create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do + resources :notes, only: [:create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope member do delete :delete_attachment post :resolve @@ -447,16 +434,16 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes' - resources :todos, only: [:create] + resources :todos, only: [:create] # rubocop: disable Cop/PutProjectRoutesUnderScope - resources :uploads, only: [:create] do + 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 end end - resources :runners, only: [:index, :edit, :update, :destroy, :show] do + resources :runners, only: [:index, :edit, :update, :destroy, :show] do # rubocop: disable Cop/PutProjectRoutesUnderScope member do post :resume post :pause @@ -468,8 +455,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - resources :runner_projects, only: [:create, :destroy] - resources :badges, only: [:index] do + resources :runner_projects, only: [:create, :destroy] # rubocop: disable Cop/PutProjectRoutesUnderScope + resources :badges, only: [:index] do # rubocop: disable Cop/PutProjectRoutesUnderScope collection do scope '*ref', constraints: { ref: Gitlab::PathRegex.git_reference_regex } do constraints format: /svg/ do @@ -482,6 +469,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do scope :usage_ping, controller: :usage_ping do post :web_ide_clientside_preview + post :web_ide_pipelines_count end # Deprecated unscoped routing. @@ -492,20 +480,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do # All new routes should go under /-/ scope. # Look for scope '-' at the top of the file. - # rubocop: enable Cop/PutProjectRoutesUnderScope # Legacy routes. # Introduced in 12.0. # Should be removed with https://gitlab.com/gitlab-org/gitlab/issues/28848. - Gitlab::Routing.redirect_legacy_paths(self, :settings, :branches, :tags, - :network, :graphs, :autocomplete_sources, - :project_members, :deploy_keys, :deploy_tokens, - :labels, :milestones, :services, :boards, :releases, - :forks, :group_links, :import, :avatar, :mirror, + Gitlab::Routing.redirect_legacy_paths(self, :mirror, :tags, :cycle_analytics, :mattermost, :variables, :triggers, - :environments, :protected_environments, :error_tracking, + :environments, :protected_environments, :error_tracking, :alert_management, :serverless, :clusters, :audit_events, :wikis, :merge_requests, - :vulnerability_feedback, :security, :dependencies) + :vulnerability_feedback, :security, :dependencies, :issues) end # rubocop: disable Cop/PutProjectRoutesUnderScope diff --git a/config/routes/repository_scoped.rb b/config/routes/repository_scoped.rb index 42ec8ca1806..865a5bdb5a9 100644 --- a/config/routes/repository_scoped.rb +++ b/config/routes/repository_scoped.rb @@ -31,9 +31,9 @@ scope format: false do resources :protected_branches, only: [:index, :show, :create, :update, :destroy, :patch], constraints: { id: Gitlab::PathRegex.git_reference_regex } resources :protected_tags, only: [:index, :show, :create, :update, :destroy] - scope constraints: { id: /[^\0]+/ } do + scope constraints: { id: /[^\0]+?/ } do scope controller: :static_site_editor do - get '/sse/*id', action: :show, as: :show_sse + get '/sse/:id(/*vueroute)', action: :show, as: :show_sse end end end |