diff --git a/changelogs/unreleased/dz-redirect-deprecated-pipeline-routes.yml b/changelogs/unreleased/dz-redirect-deprecated-pipeline-routes.yml new file mode 100644 index 0000000000000000000000000000000000000000..3ed396213bd85792e08ebbc1dd917815cf5ed7b8 --- /dev/null +++ b/changelogs/unreleased/dz-redirect-deprecated-pipeline-routes.yml @@ -0,0 +1,5 @@ +--- +title: Redirect deprecated pipeline routes +merge_request: 53990 +author: +type: removed diff --git a/config/routes/project.rb b/config/routes/project.rb index 21dfe17371530a66920ce4588db7a61445dac620..54fc735e497017d6f3339743fd036d3a33379aea 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -553,7 +553,6 @@ # Deprecated unscoped routing. scope as: 'deprecated' do # Issue https://gitlab.com/gitlab-org/gitlab/issues/118849 - draw :pipelines draw :repository # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/29572 @@ -576,7 +575,8 @@ :environments, :protected_environments, :error_tracking, :alert_management, :tracing, :serverless, :clusters, :audit_events, :wikis, :merge_requests, - :vulnerability_feedback, :security, :dependencies, :issues) + :vulnerability_feedback, :security, :dependencies, :issues, + :pipelines, :pipeline_schedules) end # rubocop: disable Cop/PutProjectRoutesUnderScope diff --git a/ee/spec/routing/project_routing_spec.rb b/ee/spec/routing/project_routing_spec.rb index 4a6735fad0579e8742483a49928a0dee81289451..2ceda31b35b2ceda20bfd114c7f804ad93278be3 100644 --- a/ee/spec/routing/project_routing_spec.rb +++ b/ee/spec/routing/project_routing_spec.rb @@ -37,7 +37,7 @@ # security_namespace_project_pipeline GET /:project_id/pipelines/:id/security(.:format) describe Projects::PipelinesController, 'routing' do it 'to #security' do - expect(get('/gitlab/gitlabhq/pipelines/12/security')).to route_to('projects/pipelines#security', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '12') + expect(get('/gitlab/gitlabhq/-/pipelines/12/security')).to route_to('projects/pipelines#security', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '12') end end diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index f7ed8d7d5dc6343d79ff818ac20f166e2b68919d..c9b6400d585cb8772741ab595f309fea5260a217 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -700,6 +700,26 @@ end end + describe Projects::PipelinesController, 'routing' do + it 'to #index' do + expect(get('/gitlab/gitlabhq/-/pipelines')).to route_to('projects/pipelines#index', namespace_id: 'gitlab', project_id: 'gitlabhq') + end + + it 'to #show' do + expect(get('/gitlab/gitlabhq/-/pipelines/12')).to route_to('projects/pipelines#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '12') + end + + it_behaves_like 'redirecting a legacy path', '/gitlab/gitlabhq/pipelines', '/gitlab/gitlabhq/-/pipelines' + end + + describe Projects::PipelineSchedulesController, 'routing' do + it 'to #index' do + expect(get('/gitlab/gitlabhq/-/pipeline_schedules')).to route_to('projects/pipeline_schedules#index', namespace_id: 'gitlab', project_id: 'gitlabhq') + end + + it_behaves_like 'redirecting a legacy path', '/gitlab/gitlabhq/pipeline_schedules', '/gitlab/gitlabhq/-/pipeline_schedules' + end + describe Projects::Settings::OperationsController, 'routing' do it 'to #reset_alerting_token' do expect(post('/gitlab/gitlabhq/-/settings/operations/reset_alerting_token')).to route_to('projects/settings/operations#reset_alerting_token', namespace_id: 'gitlab', project_id: 'gitlabhq')