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

Offen Anfängerfreundlich
#40,428 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #40457 von @gek0v — ohne Merge geschlossen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
66/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
backend

Rechercherichtung

Beginne in packages/source-control-forgejo/src/server/forgejoPullRequestJson.ts etwa bei L145, wo mergeability zu "unknown" zusammengefasst wird, wann immer pr.mergeable nicht true ist, und lies die umgebende draft/WIP-Behandlung, die aus #15145 stammt. Sieh dir dann den PR-watch-Konfliktpfad an, um zu sehen, welche mergeability-Werte den Agenten wecken, und die vorhandenen forgejo-Mapping-Tests unter packages/source-control-forgejo, um die Fixture-Form zu sehen. Erledigt bedeutet, dass mergeable: false bei einem non-draft, settled PR "conflicting" ergibt (wobei WIP/still-checking weiterhin "unknown" ist) und ein Test beide Fälle abdeckt. Beachte, dass ein geschlossener, nicht gemergter pull request (#40457) dies bereits adressiert, also prüfe ihn, bevor du beginnst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
24.8k
Forks
6.4k
Ø Merge
2 Std. 18 Min.
Gemergte PRs (30 T.)
448

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus pingdotgg/t3code

Alle Issues in pingdotgg/t3code

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.