Commit d128545a authored by Etienne Baqué's avatar Etienne Baqué Committed by Rémy Coutable

Update route for create_deploy_token

parent d3b62b4a
...@@ -9,6 +9,8 @@ module CiVariablesHelper ...@@ -9,6 +9,8 @@ module CiVariablesHelper
if entity.is_a?(Group) if entity.is_a?(Group)
create_deploy_token_group_settings_ci_cd_path(entity, opts) create_deploy_token_group_settings_ci_cd_path(entity, opts)
else else
# TODO: change this path to 'create_deploy_token_project_settings_ci_cd_path'
# See MR comment for more detail: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27059#note_311585356
create_deploy_token_project_settings_repository_path(entity, opts) create_deploy_token_project_settings_repository_path(entity, opts)
end end
end end
......
...@@ -73,6 +73,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -73,6 +73,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resource :ci_cd, only: [:show, :update], controller: 'ci_cd' do resource :ci_cd, only: [:show, :update], controller: 'ci_cd' do
post :reset_cache post :reset_cache
put :reset_registration_token put :reset_registration_token
post :create_deploy_token, path: 'deploy_token/create'
end end
resource :operations, only: [:show, :update] do resource :operations, only: [:show, :update] do
...@@ -84,8 +85,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -84,8 +85,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resource :integrations, only: [:show] resource :integrations, only: [:show]
resource :repository, only: [:show], controller: :repository do resource :repository, only: [:show], controller: :repository do
# TODO: Move 'create_deploy_token' here to the ':ci_cd' resource above during 12.9. # TODO: Removed this "create_deploy_token" route after change was made in app/helpers/ci_variables_helper.rb:14
# More details here: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24102#note_287572556 # See MR comment for more detail: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27059#note_311585356
post :create_deploy_token, path: 'deploy_token/create', to: 'ci_cd#create_deploy_token' post :create_deploy_token, path: 'deploy_token/create', to: 'ci_cd#create_deploy_token'
post :cleanup post :cleanup
end end
......
...@@ -802,7 +802,7 @@ describe 'project routing' do ...@@ -802,7 +802,7 @@ describe 'project routing' do
# TODO: remove this test as part of https://gitlab.com/gitlab-org/gitlab/issues/207079 (12.9) # TODO: remove this test as part of https://gitlab.com/gitlab-org/gitlab/issues/207079 (12.9)
it 'to ci_cd#create_deploy_token' do it 'to ci_cd#create_deploy_token' do
expect(post('gitlab/gitlabhq/-/settings/repository/deploy_token/create')).to route_to('projects/settings/ci_cd#create_deploy_token', namespace_id: 'gitlab', project_id: 'gitlabhq') expect(post('gitlab/gitlabhq/-/settings/ci_cd/deploy_token/create')).to route_to('projects/settings/ci_cd#create_deploy_token', namespace_id: 'gitlab', project_id: 'gitlabhq')
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