pulp / pulp/pulpcore

Block the `Remote` removal if it is referred by a `Distribution`

Open Beginner friendly
#5,802 10 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.
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.