[Bug]: Gitea/Forgejo mergeable:false maps to unknown, so PR watch never reports merge conflicts

オープン 初心者向け
#40,428 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #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 値がエージェントを起動するかを確認し、packages/source-control-forgejo 配下の既存の forgejo マッピングテストを見てフィクスチャの形を確認してください。完了とは、non-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
  1. Open a Gitea PR and watch it with watch_pull_request.
  2. 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分
マージ済み PR(30日)
448

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingdotgg/t3code のほかの issue

pingdotgg/t3code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。