Block the `Remote` removal if it is referred by a `Distribution`
Nobody has claimed this yet.
- 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.
If we remove a remote that is linked to a distribution, trying to pull non-synced content may fail.
Describe the solution you'd like
We could define the on_delete of Distribution remote attribute as models.Protect
https://github.com/pulp/pulpcore/blob/1672b3f405170d0a45de9c4b8cc2b059a066a162/pulpcore/app/models/publication.py#L659
as a safeguard to ensure that there is no associated Distribution before removing the Remote.
Additional context
This is related to https://github.com/pulp/pulp_container/issues/1729
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect pulpcore/app/models/publication.py around line 659, where the Distribution remote relationship is defined, and review Django's models.PROTECT behavior. Confirm the related Remote and Distribution model behavior, then verify that a Remote referenced by a Distribution cannot be removed while unreferenced remotes remain removable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100