Massive Improvements & MVP Patches
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user