[Automation] Gitea webhooks → gateway — auto-react to repo events #77
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Add a
/webhook/giteaREST endpoint to the gateway. When Gitea fires webhooks (push, PR, issue, comment), the gateway translates them into Matrix protocol messages and broadcasts to all connected clients.Timmy reacts automatically — barks commit messages, inspects PRs, places issue artifacts.
Changes
server/gateway.pyNew REST endpoint:
POST /api/webhook/gitea— receives raw Gitea webhook payloadX-Gitea-Eventheader for event typepush→bark(commit message) +agent_state:workingpull_request.opened→bark+agent_behavior:inspectpull_request.closed+merged→bark(celebration) +scene_add(merge artifact)issues.opened→bark+agent_behavior:place(issue artifact)issue_comment.created→bark(comment excerpt)X-Gitea-Secretvalidationserver/webhooks.py(NEW)Webhook translator module:
translate_push(payload) -> list[dict]— Matrix messages for pushtranslate_pr(payload) -> list[dict]— Matrix messages for PR eventstranslate_issue(payload) -> list[dict]— Matrix messages for issue eventstranslate_comment(payload) -> list[dict]— Matrix messages for commentsgitea_adapter.pyPROTOCOL.mdDocument
webhook_eventmessage type.Acceptance Criteria
Depends On
Nothing — standalone addition to gateway REST API.
Resolved in PR #81 (feat/automation-sprint). All tests passing.