summaryrefslogtreecommitdiff
path: root/config/routes/repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/routes/repository.rb')
-rw-r--r--config/routes/repository.rb67
1 files changed, 49 insertions, 18 deletions
diff --git a/config/routes/repository.rb b/config/routes/repository.rb
index 58de3d29bb0..d2be18c62f9 100644
--- a/config/routes/repository.rb
+++ b/config/routes/repository.rb
@@ -1,24 +1,8 @@
# frozen_string_literal: true
# All routing related to repository browsing
+# that is already under /-/ scope only
-resource :repository, only: [:create]
-
-resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
- member do
- get :branches
- get :pipelines
- post :revert
- post :cherry_pick
- get :diff_for_path
- get :diff_files
- get :merge_requests
- end
-end
-
-# NOTE: Add new routes to repository_scoped.rb instead (see
-# https://docs.gitlab.com/ee/development/routing.html#project-routes).
-#
# Don't use format parameter as file extension (old 3.0.x behavior)
# See http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
scope format: false do
@@ -39,6 +23,7 @@ scope format: false do
member do
# tree viewer logs
get 'logs_tree', constraints: { id: Gitlab::PathRegex.git_reference_regex }
+
# Directories with leading dots erroneously get rejected if git
# ref regex used in constraints. Regex verification now done in controller.
get 'logs_tree/*path', action: :logs_tree, as: :logs_file, format: false, constraints: {
@@ -48,6 +33,39 @@ scope format: false do
end
end
+ scope constraints: { id: Gitlab::PathRegex.git_reference_regex } do
+ resources :network, only: [:show]
+
+ resources :graphs, only: [:show] do
+ member do
+ get :charts
+ get :commits
+ get :ci
+ get :languages
+ end
+ end
+
+ get '/branches/:state', to: 'branches#index', as: :branches_filtered, constraints: { state: /active|stale|all/ }
+ resources :branches, only: [:index, :new, :create, :destroy] do
+ get :diverging_commit_counts, on: :collection
+ end
+
+ delete :merged_branches, controller: 'branches', action: :destroy_all_merged
+ resources :tags, only: [:index, :show, :new, :create, :destroy] do
+ resource :release, controller: 'tags/releases', only: [:edit, :update]
+ end
+
+ 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 controller: :static_site_editor do
+ get '/sse/:id(/*vueroute)', action: :show, as: :show_sse
+ get '/sse', as: :root_sse, action: :index
+ end
+ end
+ end
+
scope constraints: { id: /[^\0]+/ } do
scope controller: :blob do
get '/new/*id', action: :new, as: :new_blob
@@ -77,8 +95,21 @@ scope format: false do
scope controller: :find_file do
get '/find_file/*id', action: :show, as: :find_file
-
get '/files/*id', action: :list, as: :files
end
end
end
+
+resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
+ member do
+ get :branches
+ get :pipelines
+ post :revert
+ post :cherry_pick
+ get :diff_for_path
+ get :diff_files
+ get :merge_requests
+ end
+end
+
+resource :repository, only: [:create]