This commit is contained in:
Raykov-MS 2026-03-05 20:39:18 +03:00
parent 4d31d39599
commit cbec9eddb5

10
main.py
View File

@ -1116,16 +1116,26 @@ async def gitea_webhook(
log_error("gitea webhook invalid json", exc) log_error("gitea webhook invalid json", exc)
raise HTTPException(status_code=400, detail="Некорректный JSON") from exc raise HTTPException(status_code=400, detail="Некорректный JSON") from exc
log_info(f"[gitea] event={x_gitea_event} action={payload.get('action')}") log_info(f"[gitea] event={x_gitea_event} action={payload.get('action')}")
log_info(
"[route] "
f"event={x_gitea_event} action={payload.get('action')} "
f"has_comment={bool(payload.get('comment'))} "
f"has_review={bool(payload.get('review'))} "
f"is_pull={bool(payload.get('is_pull'))}"
)
try: try:
if x_gitea_event == "issue_comment": if x_gitea_event == "issue_comment":
log_info("[route] -> handle_issue_comment")
await handle_issue_comment(payload) await handle_issue_comment(payload)
return {"ok": "true"} return {"ok": "true"}
if x_gitea_event == "pull_request_comment": if x_gitea_event == "pull_request_comment":
if payload.get("comment"): if payload.get("comment"):
log_info("[route] -> handle_pull_request_comment (comment)")
await handle_pull_request_comment(payload) await handle_pull_request_comment(payload)
elif payload.get("review"): elif payload.get("review"):
log_info("[route] -> handle_pr_reviewed (from pull_request_comment)")
await handle_pr_reviewed(payload) await handle_pr_reviewed(payload)
return {"ok": "true"} return {"ok": "true"}