feat(github): declare and route pull_request ready_for_review, labeled, unlabeled - #283
Merged
Merged
Conversation
Session-Id: 2fc28d5e-2a7c-4168-9cdf-9460746c0212
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
@relayfile/adapter-githubdeclared fivepull_requestactions (opened,synchronize,edited,reopened,closed). It did not declareready_for_review,labeledorunlabeled, so those three were absent fromDEFAULT_GITHUB_EVENTS, fromsupportedEvents(), from the router'sEVENT_MAP, and therefore from the generatedKNOWN_TRIGGER_CATALOG.That gap blocks two downstream consumers:
AgentWorkforce/flowsfeat/babysitter-v2@8825104b) declares an eleven-subscription resident wake contract. Three of the eleven are exactly these actions — a draft leaving draft state, and skip/merge-policy labels moving.What changed
Three event names, added in the four places the adapter contract requires them:
packages/github/src/types.ts—DEFAULT_GITHUB_EVENTSpackages/github/src/config.ts—DEFAULT_SUPPORTED_EVENTS, each with the authoring note the surrounding entries carrypackages/github/src/webhook/event-map.ts—EVENT_MAP, all three routed toupdatePullRequest(none is a create or a close; each refreshes the existing pull-request record)packages/core/src/triggers/catalog.generated.{json,ts}— regenerated, not hand-editedPlus the router tests that cover the new routes, and a
CHANGELOG.md[Unreleased]entry.Notes for review
AGENTS.md: versions are bumped by the publish workflow, not in feature PRs.codex/babysitter-github-events@f43e294brebased onto currentmain. The only rebase conflict wasCHANGELOG.md, wheremainhad added a GitLab writeback entry under the same### Addedheading; both entries are kept. Authorship of the original commit is unchanged.ready_for_review/labeled/unlabeledrequire no webhook subscription change anywhere: GitHub subscribes at the top-levelpull_requestevent name and actions are not separately subscribable. These deliveries already reach consumers; this PR only makes them declared, and therefore routable and authorable.Verification
Run against this branch after a full
npx turbo build:npx turbo test --filter=@relayfile/adapter-github— 402 pass, 0 failnode packages/core/dist/src/cli.js triggers check— in sync (the committed catalog matches a regenerate; note a partial build reports a false "stale", a full build is required)npx turbo build— 52/52 successfulDownstream
AgentWorkforce/cloudbranchfeat/babysitter-webhook-routingpins@relayfile/adapter-github0.5.11and is blocked on this publishing. Verified both directions against a local build of this branch: 4 failed / 187 passed on the published0.5.10line, 191 passed with these three events present.Publishing
0.5.11after this merges is the remaining action.🤖 Generated with Claude Code
Note
Low Risk
Additive catalog and routing aligned with existing PR update handlers; no auth, subscription, or breaking contract changes.
Overview
@relayfile/adapter-github now treats
pull_request.ready_for_review,pull_request.labeled, andpull_request.unlabeledas first-class triggers: they are listed in default/supported event sets, exposed viasupportedEvents(), and wired in the webhookEVENT_MAPtoupdatePullRequest(same refresh path as synchronize/edited/reopened).The core
KNOWN_TRIGGER_CATALOGis regenerated so Cloud and persona authors can deploy triggers on draft-to-ready and PR label transitions without “undeclared event” failures. Router and scaffold tests cover the new routes;CHANGELOG.mddocuments the addition.No new GitHub subscription is required—deliveries already arrive on the top-level
pull_requestevent; this change only declares and routes them.Reviewed by Cursor Bugbot for commit faa19c4. Bugbot is set up for automated code reviews on this repo. Configure here.