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

Aperta Adatta ai principianti
#40,428 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #40457 di @gek0v — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Inizia da packages/source-control-forgejo/src/server/forgejoPullRequestJson.ts intorno a L145, dove mergeability viene ridotto a "unknown" ogni volta che pr.mergeable non è true, e leggi la gestione draft/WIP circostante che proviene da #15145. Poi guarda il percorso di conflitto di PR-watch per vedere quali valori di mergeability svegliano l'agente, e i test di mapping forgejo esistenti sotto packages/source-control-forgejo per vedere la forma del fixture. Fatto significa che mergeable: false su una PR non-draft e settled produce "conflicting" (con WIP/still-checking ancora "unknown") e un test copre entrambi i casi. Nota che una pull request chiusa e non unita (#40457) punta già a questo, quindi controllala prima di iniziare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
24.8k
Fork
6.4k
Merge medio
2h 18m
PR unite (30g)
448

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pingdotgg/t3code

Tutte le issue di pingdotgg/t3code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.