Skip to content

feat: Vercel Deployment Integration #2

@research-developer

Description

@research-developer

Overview

Add Vercel deployment monitoring to PR-Agent, supporting both webhooks and polling.

Webhook Support

Vercel provides webhooks for deployment lifecycle events:

Events

  • deployment.created - New deployment started
  • deployment.succeeded / deployment.ready - Deployment completed successfully
  • deployment.error - Deployment failed
  • deployment.canceled - Deployment was canceled

Identification

  • Header: x-vercel-signature (HMAC SHA1)
  • User-Agent: Contains "Vercel"
  • Payload: Contains type, deploymentId, projectId

Payload Structure

{
  "type": "deployment.succeeded",
  "id": "webhook_event_id",
  "payload": {
    "deployment": {
      "id": "dpl_xxx",
      "url": "my-app-xxx.vercel.app",
      "state": "READY",
      "meta": {
        "githubCommitSha": "abc123",
        "githubCommitRef": "main"
      }
    },
    "project": { "id": "prj_xxx", "name": "my-app" }
  }
}

Polling Alternative

REST API endpoints for deployment status:

  • GET /v6/deployments - List deployments with filters
  • GET /v13/deployments/{id} - Get deployment details

Tasks

  • Implement VercelPoller in polling/vercel.py
  • Add Vercel config to CLI (vercel_token, vercel_team_id)
  • Create deployment failure handler (analyze build logs)
  • Auto-comment deployment preview URLs on PRs
  • Correlate deployments with GitHub PRs via commit SHA

Use Cases

  1. Deployment Alerts: Notify when deployments fail
  2. PR Comments: Auto-comment deployment preview URLs
  3. Build Analysis: AI analysis of failed build logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions