Skip to content

Inform virtual registry users when limits are reached

What does this MR do and why?

This change adds limits and visual indicators to a virtual registry system for Maven packages. The main updates include:

Upstream Limits: Each registry can now have a maximum of 20 upstreams (external package sources). When this limit is reached, users see a message saying "Maximum number of upstreams reached" instead of the button to add more upstreams. A counter badge shows "X of 20" to display current usage.

Registry Limits: Each top-level group can have a maximum of 20 registries. When this limit is reached, the "Create registry" button is replaced with a "Maximum number of registries reached" message.

User Interface Improvements: The interface now displays helpful information like "You can add up to 20 upstreams per registry" and "You can add up to 20 registries per top-level group" to inform users about these limits upfront.

Backend Logic: New helper functions were added to check if limits have been reached, and the display logic was updated to show appropriate messages or buttons based on current usage versus maximum allowed.

These changes help prevent users from hitting unexpected limits and provide clear guidance about constraints.

Also addresses Extract checks for showing create button into a... (#569884 - closed)

EE: true

References

Screenshots or screen recordings

Page After
Virtual registry landing page Screenshot_2025-10-08_at_1.31.34_pm
Maven registries & upstreams page Screenshot_2025-10-08_at_1.31.44_pm
Maven registry details page Screenshot_2025-10-08_at_1.44.17_pm

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 top-level group
  2. Go to Deploy -> Virtual Registry
  3. Create a new maven registry
  4. Click on the Add upstream button
  5. Confirm that description related to using locally hosted repositories is added for Upstream URL and Password fields.
  6. The required fields are name, url. Example URL can be something like: https://repo.maven.apache.org/maven2
  7. Click on Create upstream
  8. Similarly create 19 more registries & a registry with 20 upstreams
    g = Group.find(<group-id>)
    19.times.each { |i|  VirtualRegistries::Packages::Maven::Registry.create(group: g, name: "maven registry - #{i}") }
    
  9. Confirm that buttons are replaced with limit messages as per screenshot section.

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 #569942

Edited by Rahul Chanila

Merge request reports

Loading