feat(ten-334): add GitHub webhook dispatcher Paperclip plugin#13
Merged
Conversation
Adds @tensorleap/plugin-github-webhook-dispatcher — a Paperclip plugin that receives GitHub webhooks from tensorleap repos, filters non-actionable events in code, and routes actionable ones to matching TEN issues. - HMAC-SHA256 signature verification via X-Hub-Signature-256 - X-GitHub-Delivery deduplication using plugin state - Handles: pull_request, pull_request_review, issues, issue_comment, check_suite - Posts wake comment to matching TEN issue; creates triage issue when ref unmapped - 19 passing tests Also exposes q (text-search) param on issues.list in plugin SDK protocol, types, and test harness. Co-Authored-By: Paperclip <noreply@paperclip.ing>
ad76024 to
f671d89
Compare
lavie
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change exists
Implements TEN-334 — the GitHub↔TEN mapping architecture (TEN-302) requires a production-grade webhook receiver that routes GitHub events (PR, review, issue, CI failure) directly to wake comments on matching TEN issues, replacing the previous routines-based approach.
How this PR fixes it
A new Paperclip plugin (
tensorleap.plugin-github-webhook-dispatcher) is installed locally on the container. For each inbound webhook it:X-Hub-Signature-256X-GitHub-Deliveryusing plugin statelabeled,dismissed, etc.)owner/repo#number)ctx.issues.list({ q: "tensorleap/fsd#456" })## GitHub Event: {event}.{action}header, human summary, and raw payload in<details>triage: unmapped tensorleap/fsd#456issueAdditionally, the SDK's
issues.listnow exposesq?: string(full-text search) since the underlying serverIssueFilters.qalready supported it but was not wired to the plugin protocol.Technical summary
packages/plugins/examples/plugin-github-webhook-dispatcher/— full plugin with manifest, worker, 19 unit testspackages/plugins/sdk/src/protocol.ts— addq?: stringtoissues.listparamspackages/plugins/sdk/src/types.ts— addq?: stringtoPluginIssuesClient.listpackages/plugins/sdk/src/testing.ts— implement text-search filtering in test harnessVerification