Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: vercel webhooks integration #706

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

hmacr
Copy link
Contributor

@hmacr hmacr commented Oct 30, 2023

Partial Implementation of #421

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

I executed the test job to verify the webhook events.


Changelog

  • Add Vercel webhook triggers
  • Add a test job for the Vercel integration
  • Add example payloads

Notes

Of the Vercel webhook events, this PR has support for all the project and deployment (except deployment.ready) events.

The remaining events are configured at an Integration level (what Vercel provides as OAuth) and hence cannot be configured with the create-webhook API for each request separately. These events need to be configured when the Integration is created on the Vercel platform, so there can be only one Webhook URL set at the top level for these events. This also means OAuth cannot be configured per each user on the trigger.dev server.

To verify the Vercel Integration workflow, I created a test Integration (trigger-dev-hmacr-test). I then configured an endpoint as the Integration webhook-url which received the webhook events from the teams/projects where the Integration was installed.

If we need to support OAuth (and the Integration level webhook events), the path forward is

  • Set up an endpoint to receive all the Vercel Integration level webhook events.
  • Parse the payload and create event records (same as a webhook handler).
  • Optionally, implement tasks that can only be performed by an OAuth client, e.g. create-check API.

I've also opened a discussion to find information about refreshing the OAuth access token: Refresh Token for Integration
💯

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2023

🦋 Changeset detected

Latest commit: d9967e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@trigger.dev/vercel Patch
@references/job-catalog Patch
@trigger.dev/tailwind-config Patch
@trigger.dev/tsconfig Patch
@trigger.dev/tsup Patch
@trigger.dev/astro Patch
@trigger.dev/cli Patch
@trigger.dev/core Patch
@trigger.dev/eslint-plugin Patch
@trigger.dev/express Patch
@trigger.dev/integration-kit Patch
@trigger.dev/nestjs Patch
@trigger.dev/nextjs Patch
@trigger.dev/react Patch
@trigger.dev/remix Patch
@trigger.dev/sveltekit Patch
@trigger.dev/testing Patch
@trigger.dev/sdk Patch
@trigger.dev/airtable Patch
@trigger.dev/github Patch
@trigger.dev/linear Patch
@trigger.dev/openai Patch
@trigger.dev/plain Patch
@trigger.dev/replicate Patch
@trigger.dev/resend Patch
@trigger.dev/sendgrid Patch
@trigger.dev/slack Patch
@trigger.dev/stripe Patch
@trigger.dev/supabase Patch
@trigger.dev/typeform Patch
@references/unit-testing Patch
perf Patch
astro-example Patch
@references/nextjs Patch
@references/package-tester Patch
nestjs-example Patch
@references/remix Patch
svelte-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hmacr hmacr changed the title Vercel Integration feat: vercel webhooks integration Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant