Handle deletion of related files for Maven artifacts
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem
In the cache entries page, Maven artifacts are displayed as individual files (e.g., JAR and POM). This creates ambiguity when users take destructive actions.
What happens if someone deletes just the POM? Will the virtual registry know to pull it from the upstream?
Technically, the virtual registry will re-download missing files from upstream when needed, but this raises some UX concerns:
- Users may not realise they are deleting only part of a Maven package (which is actually a set of files).
- Users may not clearly understand the consequences of deleting a single file vs. the whole set.
- There's currently no way to remove the entire package set in one action.
This issue is connected to how files are displayed in the UI. Together, they represent two UX problems:
- Display problem: how artifacts are displayed - individual files vs combined view (Create Combined View for JAR and POM Files in M... (#544032)).
- Destructive action problem: how deletion of related files should work (this issue).
From the conversation &15090 (comment 2731209381) and #544032 (comment 2740935747), the team aligned that:
- Fixing deletion behaviour is important to address before GA, to avoid incidents of users downloading incorrect or incomplete files.
- The combined view (grouping) can wait.
Solution
Provide a way for users to:
- Be made aware when they are deleting a file that is part of a set (e.g., a POM or JAR that belongs to a Maven package).
- Understand the consequence of their deletion (e.g., other files from the same set may remain in cache).
- Option to delete the entire Maven package set (all related files) in one action, if that is their intent.
Implementation guide
- Add new parameter to delete cache entry API &15090 (comment 2731700850) to delete all the related files.
- In the modal to delete cache entry, run a cache entry search using the prefix. For example, we should delete all entries with the prefix
/org/apache/maven/plugins/maven-compiler-plugin/3.11.0
- Implement behaviour according to #569862[DeleteCachedFile.png] (comment 2776526813)
- Call API with parameters when
Delete all related artifacts
button is clicked.
Edited by Rahul Chanila