Massive Improvements & MVP Patches
All checks were successful
ci / test (push) Successful in 27s
ci / publish (push) Successful in 1m24s

This commit is contained in:
Space-Banane
2026-05-22 21:27:48 +02:00
parent ae18420744
commit 7b63ecd536
20 changed files with 713 additions and 72 deletions

View File

@@ -4,6 +4,7 @@ import asyncio
import logging
from typing import Any
import httpx
from sqlalchemy import select
from sqlalchemy.orm import Session
@@ -110,7 +111,18 @@ def process_one_job(settings: Settings) -> bool:
with session_factory() as session:
comment_id = get_persistent_review_comment_id(session, job.repo, job.pr_number)
if comment_id:
gitea.edit_issue_comment(job.repo, comment_id, comment_body)
try:
gitea.edit_issue_comment(job.repo, comment_id, comment_body)
except httpx.HTTPStatusError as exc:
if exc.response.status_code != 404:
raise
logger.warning(
"Persistent review comment not found; posting a new one repo=%s pr=%s old_comment_id=%s",
job.repo,
job.pr_number,
comment_id,
)
comment_id = gitea.post_issue_comment(job.repo, job.pr_number, comment_body)
else:
comment_id = gitea.post_issue_comment(job.repo, job.pr_number, comment_body)
upsert_persistent_review_comment_id(