Backend issue lists report in-patch warnings and out-of-patch errors as not publishable

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

维护者通常 1 天内回复

@RaphaelFakhri 已经在做这个了。

开始于 2026年11月4日。

  • #3795 来自 @RaphaelFakhri —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
django, python

调研方向

首先找到 IssueViewSet 和 IssueCheckDetails 中的 publishable 注解,然后将它们与 IssueLink.publishable 属性以及 issue 中描述的共享 publishable 规则进行比较。检查 diff issues 端点和 check details 过滤器,确认补丁内的警告和补丁外的错误。完成标准是两个端点都将这些情况报告为 publishable,并且默认的 check details 过滤器保持一致。

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

描述

IssueLink.publishable treats an issue as publishable when it is in the patch or is an error (in_patch is True or level == "error"). The bulk creation response, the publishable filter of the check details endpoint, and the publishable counters for diffs and check stats use the same rule.

Two endpoints compute the publishable field with & instead of |:

  • GET /v1/diff/<diff_provider_id>/issues/ (IssueViewSet)
  • GET /v1/check/<repository>/<analyzer>/<check>/ (IssueCheckDetails)
.annotate(publishable=Q(issue_links__in_patch=True) & Q(level=LEVEL_ERROR))

As a result, these endpoints return:

  • publishable: false for warnings inside the patch.
  • publishable: false for errors outside the patch, and null when in_patch is unknown.

On the check details endpoint, the default ?publishable=true filter keeps these issues while each one reports publishable: false.

The annotation came in with #2451, which moved publishable to IssueLink. The model property kept the or rule.

Steps to reproduce

  1. Link an error issue to a diff with in_patch=False, and a warning issue with in_patch=True.
  2. Request /v1/diff/<diff_provider_id>/issues/.

Expected: both issues have publishable: true.
Actual: both issues have publishable: false.

主要语言
Python
星标
68
派生
54
平均合并
2 天 4 小时
30 天内合并 PR
24

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

mozilla/code-review 的其他 Issue

查看 mozilla/code-review 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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