UI: Package cleanup policy rule based on last download date
Context
This issue is part of a larger project to add a package registry cleanup policy that deletes packages based on their last download date. #371011 proposes backend changes. This issue will focus on the front end changes required to allow users to set cleanup policies from their project's settings.
Problem to solve
You can use the MVC of the Package Registry cleanup policies to define how many duplicate assets of a Package to keep. The problem is that we don't have a way to delete the package itself. So users are forced to do this through the API or the UI which is inefficient.
Proposal
Add a new policy for managing packages that allows the user to delete packages that have not been downloaded in n
months. This would allow users to set reasonable lifecycle policies and for them to be more efficient in managing storage costs.
UI
Designs also include state where #370584 is also completed.
Logic
If the user has entered a value for any of the possible cleanup policies, we show a message Packages and assets will not be deleted until cleanup runs in [number] hours.
If the user removes all values from any of the possible cleanup policies, the message is no longer shown:
Implementation guide
- Update GraphQL query & mutation to use fields defined in #371011 (to be confirmed)
- Add form field to https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/packages_and_registries/settings/project/components/packages_cleanup_policy_form.vue