pulp / pulp/pulpcore

Provide a good way to deal with "protected" repository version deletions

Open
#5,218 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

Is your feature request related to a problem? Please describe.
Following the changes here: https://github.com/pulp/pulpcore/commit/c4e842c4083a2d9adbbfcd0d663b940604907532 , we can no longer delete repo versions if it's distributed (directly or via publication)

We are looking at a workflow during Katello initiated orphan cleanup, where we have a list of repo versions we want to delete. We send a request to delete those and we get an error message : The repository version cannot be deleted because it (or its publications) are currently being used to distribute content. Please update the necessary distributions first.

Describe the solution you'd like

Some enhancements around this which would help out greatly are the ability to list all distros/publications that are tied to a repo version. Today the way to do so via API would be to fetch publications for the version and then distros for the publication. It would be nice to have an API call to fetch these with a list of versions.

Furthermore, for types that skip publications and distribute versions directly, ex: container/ansible collections, I was looking for a good way to fetch distros ties to a version..The list API doesn't seem to support searching on repo_versions: https://docs.pulpproject.org/pulp_container/restapi.html#tag/Distributions:-Container/operation/distributions_container_container_list or https://docs.pulpproject.org/pulp_ansible/en/master/nightly/restapi.html#tag/Distributions:-Ansible/operation/distributions_ansible_ansible_list

Also, When an exception is thrown when deleting protected version, it will also be useful to list the resources (publication/distributions) that caused the exception in the error message.

Describe alternatives you've considered
An alternative would be to allow cascading delete of a repo version that would in turn delete ny distributions tied to it.

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the repository-version deletion API and the Container and Ansible distribution list operations linked in the issue. Trace how publications and distributions are associated with versions, including direct distribution without publications. Done means the supported API behavior clearly exposes blocking resources for protected-version deletion and supports finding the relevant distributions or publications for multiple versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.