Replace registries index with registries and upstreams index route

What does this MR do and why?

Replace registries index with registries and upstreams index route

Update routes for Maven registries and upstreams

Updated routes:

  • Route changed from /maven/<id> to /maven/registries/<id>.
  • Route changed from /maven/<id> to /maven/upstreams/<id>.

Updated breadcrumbs

  • Breadcrumb changed from Maven virtual registries to Maven registries and upstreams.
  • Breadcrumb changed from Maven > <id> to Maven registries > <id>.
  • Breadcrumb changed from Maven > Upstreams > <id> to Maven upstreams > <id>.

The breadcrumbs Maven registries and Maven upstreams point to the same link for now & will be updated to point to the upstreams tab in the follow-up MRs

This is prep for Maven virtual registry Upstreams list view (#556837 - closed)

EE: true

AI summary

This code change reorganizes the Maven virtual registry feature by combining the separate "registries" and "upstreams" pages into a single unified page called "registries and upstreams".

The main changes include:

  • Creating a new controller and page that shows both registries and upstreams together in one view
  • Removing the old separate index page for just registries
  • Updating all navigation links, breadcrumbs, and redirects to point to the new combined page
  • Moving the JavaScript file to match the new page structure
  • Updating the URL routing to reflect the new page organization
  • Modifying test files to test the new combined functionality instead of the old separate pages

The end result is a cleaner user experience where users can see and manage both Maven registries and their upstream sources from a single location, rather than having to navigate between separate pages. All the existing functionality for creating, editing, and deleting registries remains the same - it's just organized differently in the user interface.

References

Screenshots or screen recordings

Notice the change in routes & breadcrumb

Change After
No change Screenshot_2025-09-16_at_10.58.26_am
Breadcrumb changed from Maven virtual registries to Maven registries and upstreams Screenshot_2025-09-16_at_11.02.33_am
Route changed from /maven/<id> to /maven/registries/<id>
Breadcrumb changed from Maven > <id> to Maven registries > <id>
Screenshot_2025-09-16_at_11.13.10_am
Screenshot_2025-09-16_at_11.14.10_am
Screenshot_2025-09-16_at_11.14.38_am
Route changed from /maven/<id> to /maven/upstreams/<id>
Breadcrumb changed from Maven > Upstreams > <id> to Maven upstreams > <id>
Screenshot_2025-09-16_at_11.13.29_am
Screenshot_2025-09-16_at_11.13.44_am

How to set up and validate locally

  1. Ensure you have enabled the following feature flags
$ gdk rails console
Feature.enable(:maven_virtual_registry)
Feature.enable(:ui_for_virtual_registries)
  1. Go to a top-level group

  2. Go to Deploy -> Virtual Registry

  3. Create a new maven registry

  4. Click on the Add upstream button

  5. The required fields are name, url. For the URL, you can use https://repo.maven.apache.org/maven2

  6. Click on Create upstream

  7. Visit the upstream details groups/<group>/-/virtual_registries/maven/upstreams/<upstream-id>

  8. Confirm that empty state is displayed

  9. Run the script to generate lot of upstream entries

    group = Group.find(<id>)
    upstream = VirtualRegistries::Packages::Maven::Upstream.find(<id>)
    40.times do |i|
      components = ['com', 'org', 'net', 'io'].sample
      project = ['example', 'test', 'demo', 'sample', 'library'].sample
      artifact = ['core', 'api', 'client', 'utils', 'common'].sample
      version = "#{rand(1..5)}.#{rand(0..9)}.#{rand(0..9)}"
      
      relative_path = "/#{components}/#{project}/#{artifact}/#{version}/#{artifact}-#{version}.jar"
      
      storage_key = "cache-entry-#{Time.now.to_i}-#{i}-#{SecureRandom.hex(8)}"
      
      VirtualRegistries::Packages::Maven::Cache::Entry.create!(
        group: group,
        upstream: upstream,
        relative_path: relative_path,
        size: rand(10..1000), 
        file: Tempfile.new("cache-#{i}"),
        file_sha1: SecureRandom.hex(20),     
        object_storage_key: storage_key
      )
    end
  10. Go through registry new, edit & show pages to confirm that routing, breadcrumb & routes are updated.

  11. Go through upstream show & edit pages to confirm that breadcrumb & routes are updated.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #556837 (closed)

Edited by Rahul Chanila

Merge request reports

Loading