Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#5,802 10 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
django, python
领域
backend, database

调研方向

检查 pulpcore/app/models/publication.py 第 659 行附近定义 Distribution 与 Remote 关系的位置,并审查 Django 的 models.PROTECT 行为。确认相关 Remote 和 Distribution 模型的行为,然后验证被 Distribution 引用的 Remote 无法删除,而未被引用的 remotes 仍然可以删除。

由索引模型根据 Issue 内容生成。

描述

Feature

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

主要语言
Python
星标
606
派生
174
平均合并
16 小时 44 分钟
30 天内合并 PR
107

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pulp/pulpcore 的其他 Issue

查看 pulp/pulpcore 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。