add logs
This commit is contained in:
parent
4d31d39599
commit
cbec9eddb5
10
main.py
10
main.py
@ -1116,16 +1116,26 @@ async def gitea_webhook(
|
||||
log_error("gitea webhook invalid json", exc)
|
||||
raise HTTPException(status_code=400, detail="Некорректный JSON") from exc
|
||||
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:
|
||||
if x_gitea_event == "issue_comment":
|
||||
log_info("[route] -> handle_issue_comment")
|
||||
await handle_issue_comment(payload)
|
||||
return {"ok": "true"}
|
||||
|
||||
if x_gitea_event == "pull_request_comment":
|
||||
if payload.get("comment"):
|
||||
log_info("[route] -> handle_pull_request_comment (comment)")
|
||||
await handle_pull_request_comment(payload)
|
||||
elif payload.get("review"):
|
||||
log_info("[route] -> handle_pr_reviewed (from pull_request_comment)")
|
||||
await handle_pr_reviewed(payload)
|
||||
return {"ok": "true"}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user