Commit 90129226 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Move remaining EE project routes to EE file

So we don't need the Gitlab.ee conditional block
parent 7ef0f01a
resources :projects, only: [:index, :new, :create] # frozen_string_literal: true
Gitlab.ee do resources :projects, only: [:index, :new, :create]
scope "/-/push_from_secondary/:geo_node_id" do
draw :git_http
end
end
draw :git_http draw :git_http
...@@ -87,22 +83,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -87,22 +83,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resource :operations, only: [:show, :update] resource :operations, only: [:show, :update]
resource :integrations, only: [:show] resource :integrations, only: [:show]
Gitlab.ee do
resource :slack, only: [:destroy, :edit, :update] do
get :slack_auth
end
end
resource :repository, only: [:show], controller: :repository do resource :repository, only: [:show], controller: :repository do
post :create_deploy_token, path: 'deploy_token/create' post :create_deploy_token, path: 'deploy_token/create'
post :cleanup post :cleanup
end end
end end
Gitlab.ee do
resources :feature_flags
end
resources :autocomplete_sources, only: [] do resources :autocomplete_sources, only: [] do
collection do collection do
get 'members' get 'members'
...@@ -263,10 +249,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -263,10 +249,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
namespace :prometheus do namespace :prometheus do
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
get :active_common, on: :collection get :active_common, on: :collection
Gitlab.ee do
post :validate_query, on: :collection
end
end end
end end
...@@ -279,15 +261,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -279,15 +261,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :pipeline_status get :pipeline_status
get :ci_environments_status get :ci_environments_status
post :toggle_subscription post :toggle_subscription
Gitlab.ee do
get :approvals
post :approvals, action: :approve
delete :approvals, action: :unapprove
post :rebase
end
post :remove_wip post :remove_wip
post :assign_related_issues post :assign_related_issues
get :discussions, format: :json get :discussions, format: :json
...@@ -325,21 +298,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -325,21 +298,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
post :bulk_update post :bulk_update
end end
Gitlab.ee do
resources :approvers, only: :destroy
delete 'approvers', to: 'approvers#destroy_via_user_id', as: :approver_via_user_id
resources :approver_groups, only: :destroy
scope module: :merge_requests do
resources :drafts, only: [:index, :update, :create, :destroy] do
collection do
post :publish
delete :discard
end
end
end
end
resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do resources :discussions, only: [:show], constraints: { id: /\h{40}/ } do
member do member do
post :resolve post :resolve
...@@ -370,10 +328,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -370,10 +328,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
Gitlab.ee do
resources :push_rules, constraints: { id: /\d+/ }, only: [:update]
end
resources :pipelines, only: [:index, :new, :create, :show] do resources :pipelines, only: [:index, :new, :create, :show] do
collection do collection do
resource :pipelines_settings, path: 'settings', only: [:show, :update] resource :pipelines_settings, path: 'settings', only: [:show, :update]
...@@ -420,21 +374,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -420,21 +374,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', constraints: { format: nil } get '/terminal.ws/authorize', to: 'environments#terminal_websocket_authorize', constraints: { format: nil }
get '/prometheus/api/v1/*proxy_path', to: 'environments/prometheus_api#proxy', as: :prometheus_api get '/prometheus/api/v1/*proxy_path', to: 'environments/prometheus_api#proxy', as: :prometheus_api
Gitlab.ee do
get :logs
get '/pods/(:pod_name)/containers/(:container_name)/logs', to: 'environments#k8s_pod_logs', as: :k8s_pod_logs
end
end end
collection do collection do
get :metrics, action: :metrics_redirect get :metrics, action: :metrics_redirect
get :folder, path: 'folders/*id', constraints: { format: /(html|json)/ } get :folder, path: 'folders/*id', constraints: { format: /(html|json)/ }
get :search get :search
Gitlab.ee do
get :logs, action: :logs_redirect
end
end end
resources :deployments, only: [:index] do resources :deployments, only: [:index] do
...@@ -445,14 +390,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -445,14 +390,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
Gitlab.ee do
resources :protected_environments, only: [:create, :update, :destroy], constraints: { id: /\d+/ } do
collection do
get 'search'
end
end
end
namespace :serverless do namespace :serverless do
scope :functions do scope :functions do
get '/:environment_id/:id', to: 'functions#show' get '/:environment_id/:id', to: 'functions#show'
...@@ -495,14 +432,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -495,14 +432,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
Gitlab.ee do
namespace :security do
resource :dashboard, only: [:show], controller: :dashboard
end
resources :vulnerability_feedback, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ }
end
get :issues, to: 'issues#calendar', constraints: lambda { |req| req.format == :ics } get :issues, to: 'issues#calendar', constraints: lambda { |req| req.format == :ics }
resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do resources :issues, concerns: :awardable, constraints: { id: /\d+/ } do
...@@ -555,11 +484,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -555,11 +484,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
Gitlab.ee do
resources :approvers, only: :destroy
resources :approver_groups, only: :destroy
end
resources :runner_projects, only: [:create, :destroy] resources :runner_projects, only: [:create, :destroy]
resources :badges, only: [:index] do resources :badges, only: [:index] do
collection do collection do
...@@ -574,10 +498,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -574,10 +498,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
Gitlab.ee do
resources :audit_events, only: [:index]
end
resources :error_tracking, only: [:index], controller: :error_tracking do resources :error_tracking, only: [:index], controller: :error_tracking do
collection do collection do
get ':issue_id/details', get ':issue_id/details',
...@@ -599,10 +519,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -599,10 +519,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
draw :wiki draw :wiki
draw :repository draw :repository
Gitlab.ee do
resources :managed_licenses, only: [:index, :show, :new, :create, :edit, :update, :destroy]
end
# Legacy routes. # Legacy routes.
# Introduced in 12.0. # Introduced in 12.0.
# Should be removed with https://gitlab.com/gitlab-org/gitlab/issues/28848. # Should be removed with https://gitlab.com/gitlab-org/gitlab/issues/28848.
......
# frozen_string_literal: true # frozen_string_literal: true
scope "/-/push_from_secondary/:geo_node_id" do
draw :git_http
end
constraints(::Constraints::ProjectUrlConstrainer.new) do constraints(::Constraints::ProjectUrlConstrainer.new) do
scope(path: '*namespace_id', scope(path: '*namespace_id',
as: :namespace, as: :namespace,
...@@ -26,6 +30,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -26,6 +30,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
resources :feature_flags
resource :feature_flags_client, only: [] do resource :feature_flags_client, only: [] do
post :reset_token post :reset_token
end end
...@@ -37,11 +42,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -37,11 +42,15 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
namespace :settings do namespace :settings do
resource :operations, only: [:show, :update] do resource :operations, only: [] do
member do member do
post :reset_alerting_token post :reset_alerting_token
end end
end end
resource :slack, only: [:destroy, :edit, :update] do
get :slack_auth
end
end end
resources :designs, only: [], constraints: { id: /\d+/ } do resources :designs, only: [], constraints: { id: /\d+/ } do
...@@ -64,6 +73,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -64,6 +73,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) 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
post :notify, on: :collection post :notify, on: :collection
end end
resources :metrics, constraints: { id: %r{[^\/]+} }, only: [] do
post :validate_query, on: :collection
end
end end
post 'alerts/notify', to: 'alerting/notifications#create' post 'alerts/notify', to: 'alerting/notifications#create'
...@@ -107,9 +120,32 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -107,9 +120,32 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :dependency_scanning_reports get :dependency_scanning_reports
get :sast_reports get :sast_reports
get :dast_reports get :dast_reports
get :approvals
post :approvals, action: :approve
delete :approvals, action: :unapprove
post :rebase
end
resources :approvers, only: :destroy
delete 'approvers', to: 'approvers#destroy_via_user_id', as: :approver_via_user_id
resources :approver_groups, only: :destroy
scope module: :merge_requests do
resources :drafts, only: [:index, :update, :create, :destroy] do
collection do
post :publish
delete :discard
end
end
end end
end end
resources :approvers, only: :destroy
resources :approver_groups, only: :destroy
resources :push_rules, constraints: { id: /\d+/ }, only: [:update]
resources :pipelines, only: [] do resources :pipelines, only: [] do
member do member do
get :security get :security
...@@ -124,6 +160,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -124,6 +160,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
namespace :security do namespace :security do
resource :dashboard, only: [:show], controller: :dashboard
resources :dependencies, only: [:index] resources :dependencies, only: [:index]
resources :licenses, only: [:index] resources :licenses, only: [:index]
# We have to define both legacy and new routes for Vulnerability Findings # We have to define both legacy and new routes for Vulnerability Findings
...@@ -143,8 +180,30 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -143,8 +180,30 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
resources :vulnerability_feedback, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ }
resource :dependencies, only: [:show] resource :dependencies, only: [:show]
resource :licenses, only: [:show] resource :licenses, only: [:show]
resources :managed_licenses, only: [:index, :show, :new, :create, :edit, :update, :destroy]
resources :environments, only: [] do
member do
get :logs
get '/pods/(:pod_name)/containers/(:container_name)/logs', to: 'environments#k8s_pod_logs', as: :k8s_pod_logs
end
collection do
get :logs, action: :logs_redirect
end
end
resources :protected_environments, only: [:create, :update, :destroy], constraints: { id: /\d+/ } do
collection do
get 'search'
end
end
resources :audit_events, only: [:index]
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment