Add clear upstream cache functionality to Maven upstreams list
What does this MR do and why?
Add clear upstream cache functionality to Maven upstreams list
Extract shared modal component from existing component
EE: true
References
- Design: #556837[UpstreamsList.png]
- This is the next iteration of to Implements maven upstream registries table (!207028 - merged)
- Similar implementation in the registry details page was added in Show clear upstream cache button for Maven virt... (!201056 - merged)
Screenshots or screen recordings
Before: There was no button for Clear cache
, you can see screenshots in !207028 (merged)
Page | After |
---|---|
Upstreams list | ![]() |
On success | ![]() |
On failure | ![]() |
How to set up and validate locally
- Ensure you have enabled the following feature flags
$ gdk rails console
Feature.enable(:maven_virtual_registry)
Feature.enable(:ui_for_virtual_registries)
- Go to a group
- Go to
Deploy -> Virtual Registry
- If you have a Maven Registry created, go there; otherwise, create one.
- Click on the
Add upstream
button - The required fields are
name
,url
, andcache period
. For the URL, you can usehttps://repo.maven.apache.org/maven2
. - Click on
Create upstream
- To create cache entries for the maven upstream, run this the rails console.
g = Group.find(<top-level-group-id>)
u = ::VirtualRegistries::Packages::Maven::Upstream.find(<id-of-recently-created-upstream>)
::VirtualRegistries::Packages::Maven::Cache::Entry.create!(group: g, upstream: u, relative_path: '/test/foo', size: 150000, file: Tempfile.new('bar'), file_sha1: '4e1243bd22c66e76c2ba9eddc1f91394e57f9f83', object_storage_key: 'testing1-key')
- Click on the
Clear cache
button & confirm the actions aligns with the screenshots. - Click on the upstream & confirm that cache entries on the page are cleared.
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