add webhook failure reason (#3046)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
LawyZheng 2025-07-29 00:12:44 +08:00 committed by GitHub
parent a90d08476f
commit 12cbe1b3d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 100 additions and 6 deletions

View file

@ -1226,6 +1226,7 @@ class WorkflowService:
failure_reason=workflow_run.failure_reason,
proxy_location=workflow_run.proxy_location,
webhook_callback_url=workflow_run.webhook_callback_url,
webhook_failure_reason=workflow_run.webhook_failure_reason,
totp_verification_url=workflow_run.totp_verification_url,
totp_identifier=workflow_run.totp_identifier,
extra_http_headers=workflow_run.extra_http_headers,
@ -1390,6 +1391,10 @@ class WorkflowService:
resp_code=resp.status_code,
resp_text=resp.text,
)
await app.DATABASE.update_workflow_run(
workflow_run_id=workflow_run.workflow_run_id,
webhook_failure_reason="",
)
else:
LOG.info(
"Webhook failed",
@ -1400,6 +1405,10 @@ class WorkflowService:
resp_code=resp.status_code,
resp_text=resp.text,
)
await app.DATABASE.update_workflow_run(
workflow_run_id=workflow_run.workflow_run_id,
webhook_failure_reason=f"Webhook failed with status code {resp.status_code}, error message: {resp.text}",
)
except Exception as e:
raise FailedToSendWebhook(
workflow_id=workflow_id,