Extract EE specific files/lines for config/routes
We have the following files containing EE specific code. We should move them to ee/
- config/routes/admin.rb
- config/routes/api.rb
- config/routes/group.rb
- config/routes/profile.rb
- config/routes/project.rb
- config/routes/repository.rb
- config/routes/user.rb
Differences:
config/routes/profile.rb
diff --git a/config/routes/profile.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/profile.rb
index c1cac3905f1..6f2b8664e3b 100644
--- a/config/routes/profile.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/profile.rb
@@ -36,6 +36,14 @@ resource :profile, only: [:show, :update] do
put :resend_confirmation_instructions
end
end
+
+ ## EE-specific
+ resource :slack, only: [:edit] do
+ member do
+ get :slack_link
+ end
+ end
+
resources :chat_names, only: [:index, :new, :create, :destroy] do
collection do
delete :deny
@@ -59,5 +67,10 @@ resource :profile, only: [:show, :update] do
end
resources :u2f_registrations, only: [:destroy]
+
+ ## EE-specific
+ resources :pipeline_quota, only: [:index]
+ resources :billings, only: [:index]
+ ## EE-specific
end
end
config/routes/project.rb
diff --git a/config/routes/project.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/project.rb
index b4ebc7df4fe..f9e4a46b2f4 100644
--- a/config/routes/project.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/project.rb
@@ -79,9 +79,16 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resource :mattermost, only: [:new, :create]
namespace :prometheus do
- resources :metrics, constraints: { id: %r{[^\/]+} }, only: [] do
+ resources :metrics, constraints: { id: %r{[^\/]+} }, only: [:index, :new, :create, :edit, :update, :destroy] do
+ post :validate_query, on: :collection
get :active_common, on: :collection
end
+
+ # EE-specific
+ resources :alerts, constraints: { id: /\d+/ }, only: [:index, :create, :show, :update, :destroy] do
+ post :notify, on: :collection
+ end
+ # EE-specific
end
resources :deploy_keys, constraints: { id: /\d+/ }, only: [:index, :new, :create, :edit, :update] do
@@ -109,6 +116,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :pipeline_status
get :ci_environments_status
post :toggle_subscription
+
+ ## EE-specific
+ get :approvals
+ post :approvals, action: :approve
+ delete :approvals, action: :unapprove
+
+ post :rebase
+ ## EE-specific
+
post :remove_wip
post :assign_related_issues
get :discussions, format: :json
@@ -141,6 +157,23 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
post :bulk_update
end
+ ## EE-specific
+ resources :approvers, only: :destroy
+ delete 'approvers', to: 'approvers#destroy_via_user_id', as: :approver_via_user_id
+ resources :approver_groups, only: :destroy
+ ## EE-specific
+
+ ## EE-specific
+ scope module: :merge_requests do
+ resources :drafts, only: [:index, :update, :create, :destroy] do
+ collection do
+ post :publish
+ delete :discard
+ end
+ end
+ end
+ ## EE-specific
+
resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do
member do
post :resolve
@@ -171,6 +204,17 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ ## EE-specific
+ resources :path_locks, only: [:index, :destroy] do
+ collection do
+ post :toggle
+ end
+ end
+
+ ## EE-specific
+ get '/service_desk' => 'service_desk#show', as: :service_desk
+ put '/service_desk' => 'service_desk#update', as: :service_desk_refresh
+
resource :variables, only: [:show, :update]
resources :triggers, only: [:index, :create, :edit, :update, :destroy] do
@@ -186,6 +230,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ ## EE-specific
+ resources :push_rules, constraints: { id: /\d+/ }, only: [:update]
+ ## EE-specific
+
resources :pipelines, only: [:index, :new, :create, :show] do
collection do
resource :pipelines_settings, path: 'settings', only: [:show, :update]
@@ -200,6 +248,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :builds
get :failures
get :status
+ get :security
+ get :licenses
end
end
@@ -219,6 +269,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :metrics
get :additional_metrics
get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', constraints: { format: nil }
+
+ # EE
+ get :logs
end
collection do
@@ -235,6 +288,14 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ ## EE-specific
+ resources :protected_environments, only: [:create, :update, :destroy], constraints: { id: /\d+/ } do
+ collection do
+ get 'search'
+ end
+ end
+ ## EE-specific
+
resource :cycle_analytics, only: [:show]
namespace :cycle_analytics do
@@ -293,6 +354,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
namespace :ci do
resource :lint, only: [:show, :create]
end
+
+ ## EE-specific
+ resources :feature_flags
+ ## EE-specific
end
draw :legacy_builds
@@ -324,6 +389,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ # EE-specific start
+ namespace :security do
+ resource :dashboard, only: [:show], controller: :dashboard
+ end
+ # EE-specific end
+
resources :milestones, constraints: { id: /\d+/ } do
member do
post :promote
@@ -348,6 +419,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ ## EE-specific
+ resources :vulnerability_feedback, only: [:index, :create, :destroy], constraints: { id: /\d+/ }
+
get :issues, to: 'issues#calendar', constraints: lambda { |req| req.format == :ics }
resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do
member do
@@ -364,7 +438,14 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
collection do
post :bulk_update
post :import_csv
+
+ ## EE-specific START
+ post :export_csv
+ get :service_desk
+ ## EE-specific END
end
+
+ resources :issue_links, only: [:index, :create, :destroy], as: 'links', path: 'links'
end
resources :project_members, except: [:show, :new, :edit], constraints: { id: %r{[a-zA-Z./0-9_\-#%+]+} }, concerns: :access_requestable do
@@ -395,7 +476,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get 'noteable/:target_type/:target_id/notes' => 'notes#index', as: 'noteable_notes'
# On CE only index and show are needed
- resources :boards, only: [:index, :show]
+ resources :boards, only: [:index, :show, :create, :update, :destroy]
resources :todos, only: [:create]
@@ -418,6 +499,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
+ ## EE-specific
+ resources :approvers, only: :destroy
+ resources :approver_groups, only: :destroy
+ ## EE-specific
+
resources :runner_projects, only: [:create, :destroy]
resources :badges, only: [:index] do
collection do
@@ -431,6 +517,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
end
+
+ ## EE-specific
+ resources :audit_events, only: [:index]
+ ## EE-specific
+
namespace :settings do
get :members, to: redirect("%{namespace_id}/%{project_id}/project_members")
resource :ci_cd, only: [:show, :update], controller: 'ci_cd' do
@@ -438,6 +529,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
put :reset_registration_token
end
resource :integrations, only: [:show]
+
+ resource :slack, only: [:destroy, :edit, :update] do
+ get :slack_auth
+ end
+
resource :repository, only: [:show], controller: :repository do
post :create_deploy_token, path: 'deploy_token/create'
post :cleanup
@@ -455,6 +551,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
draw :wiki
draw :repository
+ ## EE-specific
+ resources :managed_licenses, only: [:index, :show, :new, :create, :edit, :update, :destroy]
+ ## EE-specific
+
namespace :settings do
resource :operations, only: [:show, :update]
end
config/routes/repository.rb
diff --git a/config/routes/repository.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/repository.rb
index f5201b9ddbb..fb48ec394b3 100644
--- a/config/routes/repository.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/repository.rb
@@ -58,7 +58,7 @@ scope format: false do
resource :release, controller: 'tags/releases', only: [:edit, :update]
end
- resources :protected_branches, only: [:index, :show, :create, :update, :destroy]
+ 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]
end
config/routes/user.rb
diff --git a/config/routes/user.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/user.rb
index e0ae264e2c0..a6a697416af 100644
--- a/config/routes/user.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/config/routes/user.rb
@@ -1,3 +1,8 @@
+## EE-specific
+get 'unsubscribes/:email', to: 'unsubscribes#show', as: :unsubscribe
+post 'unsubscribes/:email', to: 'unsubscribes#create'
+## EE-specific
+
# Allows individual providers to be directed to a chosen controller
# Call from inside devise_scope
def override_omniauth(provider, controller, path_prefix = '/users/auth')
@@ -25,6 +30,17 @@ devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks,
devise_scope :user do
get '/users/auth/:provider/omniauth_error' => 'omniauth_callbacks#omniauth_error', as: :omniauth_error
get '/users/almost_there' => 'confirmations#almost_there'
+
+ ## EE-specific
+ get '/users/auth/kerberos_spnego/negotiate' => 'omniauth_kerberos_spnego#negotiate'
+ ## EE-specific
+end
+
+scope '-/users', module: :users do
+ resources :terms, only: [:index] do
+ post :accept, on: :member
+ post :decline, on: :member
+ end
end
scope '-/users', module: :users do
Edited by Yorick Peterse