summaryrefslogtreecommitdiff
path: root/config/routes
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-18 21:07:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-18 21:07:37 +0000
commit7f8330873c1a5860b8a9a52d111083a65d210249 (patch)
treee6c7019f2942b8d2fff313545b7cb4bb996b6870 /config/routes
parentbbe243060399191abcba33c7ebd611f6ec34c6cd (diff)
downloadgitlab-ce-7f8330873c1a5860b8a9a52d111083a65d210249.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/routes')
-rw-r--r--config/routes/project.rb155
-rw-r--r--config/routes/repository.rb2
2 files changed, 78 insertions, 79 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 6ee6715facf..e8ad8ba2a63 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -271,82 +271,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
- resources :merge_requests, concerns: :awardable, except: [:new, :create, :show], constraints: { id: /\d+/ } do
- member do
- get :show # Insert this first to ensure redirections using merge_requests#show match this route
- get :commit_change_content
- post :merge
- post :cancel_auto_merge
- get :pipeline_status
- get :ci_environments_status
- post :toggle_subscription
- post :remove_wip
- post :assign_related_issues
- get :discussions, format: :json
- post :rebase
- get :test_reports
- get :exposed_artifacts
-
- scope constraints: ->(req) { req.format == :json }, as: :json do
- get :commits
- get :pipelines
- get :diffs, to: 'merge_requests/diffs#show'
- get :diffs_batch, to: 'merge_requests/diffs#diffs_batch'
- get :diffs_metadata, to: 'merge_requests/diffs#diffs_metadata'
- get :widget, to: 'merge_requests/content#widget'
- get :cached_widget, to: 'merge_requests/content#cached_widget'
- end
-
- scope action: :show do
- get :commits, defaults: { tab: 'commits' }
- get :pipelines, defaults: { tab: 'pipelines' }
- get :diffs, defaults: { tab: 'diffs' }
- end
-
- get :diff_for_path, controller: 'merge_requests/diffs'
-
- scope controller: 'merge_requests/conflicts' do
- get :conflicts, action: :show
- get :conflict_for_path
- post :resolve_conflicts
- end
- end
-
- collection do
- get :diff_for_path
- post :bulk_update
- end
-
- resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do
- member do
- post :resolve
- delete :resolve, action: :unresolve
- end
- end
- end
-
- scope path: 'merge_requests', controller: 'merge_requests/creations' do
- post '', action: :create, as: nil
-
- scope path: 'new', as: :new_merge_request do
- get '', action: :new
-
- scope constraints: ->(req) { req.format == :json }, as: :json do
- get :diffs
- get :pipelines
- end
-
- scope action: :new do
- get :diffs, defaults: { tab: 'diffs' }
- get :pipelines, defaults: { tab: 'pipelines' }
- end
-
- get :diff_for_path
- get :branch_from
- get :branch_to
- end
- end
-
# The wiki routing contains wildcard characters so
# its preferable to keep it below all other project routes
draw :wiki
@@ -404,6 +328,82 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ resources :merge_requests, concerns: :awardable, except: [:new, :create, :show], constraints: { id: /\d+/ } do
+ member do
+ get :show # Insert this first to ensure redirections using merge_requests#show match this route
+ get :commit_change_content
+ post :merge
+ post :cancel_auto_merge
+ get :pipeline_status
+ get :ci_environments_status
+ post :toggle_subscription
+ post :remove_wip
+ post :assign_related_issues
+ get :discussions, format: :json
+ post :rebase
+ get :test_reports
+ get :exposed_artifacts
+
+ scope constraints: ->(req) { req.format == :json }, as: :json do
+ get :commits
+ get :pipelines
+ get :diffs, to: 'merge_requests/diffs#show'
+ get :diffs_batch, to: 'merge_requests/diffs#diffs_batch'
+ get :diffs_metadata, to: 'merge_requests/diffs#diffs_metadata'
+ get :widget, to: 'merge_requests/content#widget'
+ get :cached_widget, to: 'merge_requests/content#cached_widget'
+ end
+
+ scope action: :show do
+ get :commits, defaults: { tab: 'commits' }
+ get :pipelines, defaults: { tab: 'pipelines' }
+ get :diffs, defaults: { tab: 'diffs' }
+ end
+
+ get :diff_for_path, controller: 'merge_requests/diffs'
+
+ scope controller: 'merge_requests/conflicts' do
+ get :conflicts, action: :show
+ get :conflict_for_path
+ post :resolve_conflicts
+ end
+ end
+
+ collection do
+ get :diff_for_path
+ post :bulk_update
+ end
+
+ resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do
+ member do
+ post :resolve
+ delete :resolve, action: :unresolve
+ end
+ end
+ end
+
+ scope path: 'merge_requests', controller: 'merge_requests/creations' do
+ post '', action: :create, as: nil
+
+ scope path: 'new', as: :new_merge_request do
+ get '', action: :new
+
+ scope constraints: ->(req) { req.format == :json }, as: :json do
+ get :diffs
+ get :pipelines
+ end
+
+ scope action: :new do
+ get :diffs, defaults: { tab: 'diffs' }
+ get :pipelines, defaults: { tab: 'pipelines' }
+ end
+
+ get :diff_for_path
+ get :branch_from
+ get :branch_to
+ end
+ end
+
resources :pipelines, only: [:index, :new, :create, :show] do
collection do
resource :pipelines_settings, path: 'settings', only: [:show, :update]
@@ -557,8 +557,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
:forks, :group_links, :import, :avatar, :mirror,
:cycle_analytics, :mattermost, :variables, :triggers,
:environments, :protected_environments, :error_tracking,
- :serverless, :clusters, :audit_events, :wikis, :merge_requests,
- :blob, :tree, :raw, :blame, :commits, :create_dir, :find_file, :files)
+ :serverless, :clusters, :audit_events, :wikis)
end
# rubocop: disable Cop/PutProjectRoutesUnderScope
diff --git a/config/routes/repository.rb b/config/routes/repository.rb
index e59168c6af4..4815575ba9f 100644
--- a/config/routes/repository.rb
+++ b/config/routes/repository.rb
@@ -65,7 +65,7 @@ scope format: false do
resources :protected_tags, only: [:index, :show, :create, :update, :destroy]
end
- scope path: '-', constraints: { id: /[^\0]+/ } do
+ scope constraints: { id: /[^\0]+/ } do
scope controller: :blob do
get '/new/*id', action: :new, as: :new_blob
post '/create/*id', action: :create, as: :create_blob