fix(webhooks): the managed Gitea webhook answers 202 and works in the background #538

Merged
sharang merged 1 commits from fix/webhook-async-202 into main 2026-10-09 11:22:01 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 ccf63c4fdb fix(webhooks): the managed Gitea webhook answers 202 and works in the background
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 10m45s
A verified delivery that asks for work is now answered 202 Accepted right
after the signature check. The entitlement check, ensure_target and the scan
run in a background task, so a slow registry or Keycloak no longer runs into
Gitea's delivery timeout. Ignored events still answer 200; bad signatures,
unknown sources and invalid JSON still answer 401/404/400.

The registry's Keycloak token request gets an explicit 5 s timeout (the
registry requests already had one); before, a hung Keycloak held the token
lock for the shared client's 30 s.

The handler logs its answer's status and duration; the background work logs
its outcome (or why it was refused) and its own duration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-10-09 13:10:32 +02:00