/webhook and acts as the entry point for GitHub pull request events.
In the current backend setup,
/webhook is mounted with authMiddleware in server.ts. For production GitHub App webhooks or automated webhooks sent directly by GitHub, an exemption or HMAC signature middleware is required.Endpoints
1. Webhook Health Check
GET /webhook
Returns a standard 200 OK confirming the webhook listener is online.
2. Ingest GitHub Pull Request Event
POST /webhook
Receives webhook payloads from GitHub, validates the event type, upserts the pull request record in PostgreSQL, and enqueues the job into Redis.
Required Headers
Ingestion Lifecycle
User Mapping Requirement
During ingestion,webhookToDatabase() matches payload.pull_request.user.id against users.githubID in PostgreSQL. If no registered user matches the GitHub user ID, the endpoint returns a 500 error:
Success Response
Response (200 OK)