fix: close stale PRs on Forgejo when pipeline DB marks them closed
Some checks are pending
CI / lint-and-test (push) Waiting to run
Some checks are pending
CI / lint-and-test (push) Waiting to run
Two code paths set status='closed' in the pipeline DB without calling the Forgejo API to close the PR. This caused 50 ghost PRs to accumulate on Forgejo (dashboard shows review backlog) while the pipeline considered them done. - evaluate.py: no-diff stale branch close now calls Forgejo PATCH - merge.py: permanent conflict close now calls Forgejo PATCH Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0d3fe95522
commit
e0c9951308
2 changed files with 2 additions and 0 deletions
|
|
@ -533,6 +533,7 @@ async def evaluate_pr(conn, pr_number: int, tier: str = None) -> dict:
|
|||
diff = await get_pr_diff(pr_number)
|
||||
if not diff:
|
||||
# Close PRs with no diff — stale branch, nothing to evaluate
|
||||
await forgejo_api("PATCH", repo_path(f"pulls/{pr_number}"), {"state": "closed"})
|
||||
conn.execute("UPDATE prs SET status='closed', last_error='closed: no diff against main (stale branch)' WHERE number = ?", (pr_number,))
|
||||
return {"pr": pr_number, "skipped": True, "reason": "no_diff_closed"}
|
||||
|
||||
|
|
|
|||
|
|
@ -1771,6 +1771,7 @@ async def _handle_permanent_conflicts(conn) -> int:
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
await forgejo_api("PATCH", repo_path(f"pulls/{pr_number}"), {"state": "closed"})
|
||||
conn.execute(
|
||||
"UPDATE prs SET status = 'closed', last_error = 'conflict_permanent: closed + filed in archive' WHERE number = ?",
|
||||
(pr_number,),
|
||||
|
|
|
|||
Loading…
Reference in a new issue