diff --git a/config/routes/group.rb b/config/routes/group.rb index a90c17202a1ece5e3254230b013ab0bf985b6605..0816970d0cf90946ff540e2562bbb15699d9393e 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -86,7 +86,8 @@ resources :packages, only: [:index, :show] - resources :infrastructure_registry, only: [:index] + resources :terraform_module_registry, only: [:index], as: :infrastructure_registry, controller: 'infrastructure_registry' + get :infrastructure_registry, to: redirect('groups/%{group_id}/-/terraform_module_registry') resources :milestones, constraints: { id: %r{[^/]+} } do member do diff --git a/config/routes/project.rb b/config/routes/project.rb index 487cbf652927b081e63caeafe53ed300f405ccf7..c4479ff2c6304f75870394652e9ebdd818c09ab6 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -45,7 +45,8 @@ end end - resources :infrastructure_registry, only: [:index, :show], module: :packages + resources :terraform_module_registry, only: [:index, :show], module: :packages, as: :infrastructure_registry, controller: 'infrastructure_registry' + get :infrastructure_registry, to: redirect('%{namespace_id}/%{project_id}/-/terraform_module_registry') resources :jobs, only: [:index, :show], constraints: { id: /\d+/ } do collection do diff --git a/spec/lib/api/entities/package_spec.rb b/spec/lib/api/entities/package_spec.rb index 9288f6fe8eb61fcca48beb89fbacde0c629c8481..2fe46a946327d37a8514d4c9214e585d9c20ad0b 100644 --- a/spec/lib/api/entities/package_spec.rb +++ b/spec/lib/api/entities/package_spec.rb @@ -29,7 +29,7 @@ let(:package) { create(:terraform_module_package) } it 'exposes correct web_path in _links' do - expect(subject[:_links][:web_path]).to match('/infrastructure_registry/') + expect(subject[:_links][:web_path]).to match('/terraform_module_registry/') end end diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb index 81b70f85c3aa323e37a8698cac4529398d309528..e0bbc39a102310c311d6d019a043622a62a5dc35 100644 --- a/spec/lib/gitlab/url_builder_spec.rb +++ b/spec/lib/gitlab/url_builder_spec.rb @@ -194,11 +194,11 @@ context 'when passing Packages::Package' do let(:package) { build_stubbed(:terraform_module_package) } - context 'with infrastructure package' do - it 'returns the url for infrastucture registry' do + context 'with terraform module package' do + it 'returns the url for terraform module registry' do url = subject.build(package) - expect(url).to eq "#{Gitlab.config.gitlab.url}/#{package.project.full_path}/-/infrastructure_registry/#{package.id}" + expect(url).to eq "#{Gitlab.config.gitlab.url}/#{package.project.full_path}/-/terraform_module_registry/#{package.id}" end end end diff --git a/spec/requests/api/graphql/packages/package_spec.rb b/spec/requests/api/graphql/packages/package_spec.rb index 4e40fd9a39906a17c05f7bfab353de01f5833918..20ad3d1965eebc59817c4fb392170fb5f7768bd3 100644 --- a/spec/requests/api/graphql/packages/package_spec.rb +++ b/spec/requests/api/graphql/packages/package_spec.rb @@ -312,7 +312,7 @@ def run_query(args) let(:package_global_id) { global_id_of(terraform_package) } it 'returns web_path correctly' do - expect(graphql_data_at(:package, :_links, :web_path)).to eq("/#{project.full_path}/-/infrastructure_registry/#{terraform_package.id}") + expect(graphql_data_at(:package, :_links, :web_path)).to eq("/#{project.full_path}/-/terraform_module_registry/#{terraform_package.id}") end end end diff --git a/spec/requests/api/project_packages_spec.rb b/spec/requests/api/project_packages_spec.rb index cfbaa3a5d9fd843e217806fa16914dafee56b779..498ef7e4138c786ec631f48322d03a60ab215b3d 100644 --- a/spec/requests/api/project_packages_spec.rb +++ b/spec/requests/api/project_packages_spec.rb @@ -68,10 +68,9 @@ expect(json_response).to include(a_hash_including('package_type' => 'terraform_module')) end - it 'returns the terraform module package with the infrastructure registry web_path' do + it 'returns the terraform module package with the terraform module registry web_path' do subject - - expect(json_response).to include(a_hash_including('_links' => a_hash_including('web_path' => include('infrastructure_registry')))) + expect(json_response).to include(a_hash_including('_links' => a_hash_including('web_path' => include('terraform_module_registry')))) end end