Deleting a ContentGuard should be disallowed if it is "in use"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 598
- Forks
- 168
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 86
Description
Consider the discussion in RPM issue https://github.com/pulp/pulp_rpm/issues/4554
Distributions have the same problem, with ContentGuards. If I delete a CG, suddenly every Distribution protected by it becomes a public Distribution. I believe that the same argument being made for 4554 applies here - we should put the onus on the user to take action to "detach" CGs before deletion, rather than doing it "to" them.
See https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/publication.py#L652 for the line we'd need to change
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
Start at pulpcore/app/models/publication.py around line 652 and compare the deletion behavior with the discussion in RPM issue 4554. The change is complete when deleting a ContentGuard that is still used by a Distribution is disallowed, leaving detachment as an explicit user action.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100