[Bug]: Gitea/Forgejo mergeable:false maps to unknown, so PR watch never reports merge conflicts
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #40457 来自 @gek0v —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 66/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend
调研方向
从 packages/source-control-forgejo/src/server/forgejoPullRequestJson.ts 的 L145 附近开始,在那里 mergeability 会被折叠为 "unknown",只要 pr.mergeable 不为 true,并阅读来自 #15145 的周边 draft/WIP 处理。然后查看 PR-watch 冲突路径,了解哪些 mergeability 值会唤醒 agent,并查看 packages/source-control-forgejo 下现有的 forgejo 映射测试,以了解 fixture 形态。完成意味着在非 draft、settled 的 PR 上 mergeable: false 会产生 "conflicting"(WIP/still-checking 仍为 "unknown"),并且有测试覆盖这两种情况。注意,一个已关闭、未合并的 pull request(#40457)已经针对此问题,所以开始前先检查它。
由索引模型根据 Issue 内容生成。
描述
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
packages/source-control-forgejo (Forgejo/Gitea PR mapping), PR watch conflict wakes
Steps to reproduce
- Open a Gitea PR and watch it with
watch_pull_request. - Merge a commit into the base branch that conflicts with the PR. Gitea's
GET /repos/{o}/{r}/pulls/{n}then returns"mergeable": false.
Expected behavior
The PR shows as conflicting and the watch wakes the agent on the conflict, as it does for GitHub.
Actual behavior
The PR is mapped to mergeability: "unknown", so no conflict is ever reported. In our case the thread's PR snapshot showed "unknown" at two syncs while the PR conflicted, and returned to "mergeable" after the conflict was resolved.
// packages/source-control-forgejo/src/server/forgejoPullRequestJson.ts (main @ efea1aa, L145)
mergeability: pr.mergeable === true ? "mergeable" : "unknown",
This looks like the fix for #15145 (WIP PRs shown as conflicting). That fix collapsed every false to "unknown", so Forgejo/Gitea PRs can never be "conflicting".
Suggested fix
Map mergeable: false to "conflicting" when the PR is not WIP/draft (title prefix or draft) and its status is settled, and keep "unknown" only for the WIP and still-checking cases. Alternatively, confirm a conflict another way, for example by comparing merge_base with base.sha or calling GET /pulls/{n}/merge.
Impact
Minor to moderate: on Forgejo/Gitea, agents watching a PR are never told it needs a rebase, and the UI never shows a conflict.
Version or commit
Observed on v0.1.10-nightly.20261115.4749; unchanged on main @ efea1aabe7a5657f5c78f71c12dd49f375886a78.
Environment
Self-hosted Gitea (API reports 28.4.0), tea 0.16.0.
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 2 小时 18 分钟
- 30 天内合并 PR
- 448
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
pingdotgg/t3code#40678 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[Bug]: Link dialog copy uses "here"/"there" instead of host names, so the access direction is ambiguous可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
相似的 Issue
-
[Docs] CONTRIBUTING points the Backend Remake milestone at a branch that does not exist可能已有人在做 @franpts2 今天认领。 未关闭docs
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
ever-co/ever-teams#5741 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
melgarafael/DeskcommCRM#5142 ·
维护者通常 1 天内回复
-
bug size:medium
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复