Skip to content

feat(surface): github.check_run and github.issue_comment triggers - #446

Merged
khaliqgant merged 4 commits into
mainfrom
feat/github-trigger-vocabulary
Sep 17, 2026
Merged

khaliqgant merged 4 commits into
mainfrom
feat/github-trigger-vocabulary

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Regenerates the GitHub trigger surface with two events a PR-reviewer flow needs:

flow('pr-reviewer')
  .on(github.check_run('completed'), …)     // merge-on-green
  .on(github.issue_comment('created'), …)  // "@relay fix conflicts" directives

providerEventTypes.github now lists check_run and issue_comment, so flows check admits those subscriptions (verified: a flow using all three of check_run, issue_comment, pull_request passes preflight with this build and is refused github.check_run is not a function on main).

Depends on

AgentWorkforce/relayfile-adapters#279 — adds the keys to the core mapping shipped in @relayfile/adapter-core. The generated files here were produced from that branch's packages/core/mappings alone (exactly what the tarball carries), so after that lands and is released:

  1. bump @relayfile/adapter-core in packages/sdk/package.json to the release containing fix(cli): make help and single-step summaries readable #279
  2. node scripts/generate-triggers.mjs --check → Checked 2 provider trigger modules
  3. mark ready

Until then tests/generate-triggers.test.ts › reproduces all checked-in modules from the pinned adapter mappings fails by construction — hence draft.

Test plan

  • packages/surface: typecheck, build, tests/triggers-github-events.test.ts (new) + flow.test.ts
  • packages/sdk: typecheck; provider-trigger-executor, provider-trigger-contract, check-triggers suites green against a built kernel
  • flows check on a flow subscribing to check_run/issue_comment/pull_request → CHECK PASSED
  • generate-triggers.mjs --check — adapter-core pinned to 0.5.25 (ships fix(cli): make help and single-step summaries readable #279); regenerated from the installed tarball, byte-identical to the branch-generated files

🤖 Generated with Claude Code


Summary by cubic

Adds github.check_run and github.issue_comment triggers for PR-reviewer flows, and aligns flows deploy with Cloud's GitHub events setting.

  • Regenerates the GitHub trigger surface; providerEventTypes.github now lists check_run and issue_comment, both accepting an optional action filter like github.pull_request.
  • flows deploy --on github:events=... accepts issues or pull_request, lowercasing the value before it is sent so PULL_REQUEST no longer passes the CLI and then fails at Cloud; docs/CLOUD.md describes the pull-request run's input.pullRequest.
  • Pins @relayfile/adapter-core to 0.5.25, which ships the upstream mappings, so generate-triggers.mjs --check passes.

Written for commit baa4f5e. Summary will update on new commits.

Review in cubic

Also in this PR

flows deploy … --on github:events=pull_request[,labels=…] — the CLI now accepts the events setting introduced by AgentWorkforce/cloud#3772 (validated to issues | pull_request), and docs/CLOUD.md describes the pull-request run's input.pullRequest. This part has no dependency on the adapter-core release.


Note

Low Risk
SDK-side trigger parsing and generated surface additions; no changes to auth, credentials, or runtime execution paths beyond new allowed trigger types and deploy payload fields.

Overview
Adds github.check_run and github.issue_comment to the generated GitHub trigger API (optional action filter, same pattern as pull_request), updates providerEventTypes.github so flows check accepts those subscriptions, and documents them in the triggers README. Regeneration is tied to @relayfile/adapter-core 0.5.25.

Separately, flows deploy --on github:… now accepts an events setting (issues or pull_request, normalized to lowercase in parseTriggerSource), with tests and docs/CLOUD.md describing pull-request listener behavior and input.pullRequest on runs.

Reviewed by Cursor Bugbot for commit baa4f5e. Bugbot is set up for automated code reviews on this repo. Configure here.

Regenerated `packages/surface/src/triggers/github.ts` from the core GitHub
mapping in AgentWorkforce/relayfile-adapters#279, which declares `check_run`
and `issue_comment` as action-bearing webhook keys. The surface gains
`github.check_run(action?)` and `github.issue_comment(action?)` — the two
events a PR reviewer needs for merge-on-green and comment-driven directives —
and `providerEventTypes.github` lists them, so `flows check` admits a
subscription to either instead of refusing it as unpublished.

Generated with the adapters checkout's `packages/core/mappings` alone, which is
byte-for-byte what the published `@relayfile/adapter-core` tarball will carry,
so `generate-triggers.mjs --check` reproduces these files once the SDK's pinned
adapter-core is bumped to the release that contains #279. Until that bump the
check refuses, by design.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8501163e-48ce-4238-b8b6-74f63622b927

📥 Commits

Reviewing files that changed from the base of the PR and between fe8d760 and baa4f5e.

⛔ Files ignored due to path filters (1)
  • packages/sdk/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • docs/CLOUD.md
  • packages/sdk/package.json
  • packages/sdk/src/cloud-deploy.ts
  • packages/sdk/tests/cloud-deploy.test.ts
  • packages/surface/src/triggers/README.md
  • packages/surface/src/triggers/github.ts
  • packages/surface/src/triggers/index.ts
  • packages/surface/tests/triggers-github-events.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds GitHub pull_request listener configuration and two GitHub trigger methods. It validates and normalizes event names, updates supported event metadata, documents the behavior, and adds coverage for valid and invalid inputs.

Changes

GitHub event support

Layer / File(s) Summary
Listener event configuration
packages/sdk/src/cloud-deploy.ts, packages/sdk/tests/cloud-deploy.test.ts, packages/sdk/package.json, docs/CLOUD.md
GitHub listener settings now accept events=issues or events=pull_request with lowercase normalization. Tests cover valid, invalid, and deployment values. Documentation describes pull-request wake conditions and payload data.
Surface GitHub triggers
packages/surface/src/triggers/index.ts, packages/surface/src/triggers/github.ts, packages/surface/src/triggers/README.md, packages/surface/tests/triggers-github-events.test.ts
The GitHub trigger surface now supports check_run(action) and issue_comment(action). Event metadata, action filters, optional actions, and empty-action errors are covered.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: kjgbot

Merge Risk: ⚪ Minimal · up to baa4f

The new GitHub event support is consistently parsed, serialized, exposed, and pinned; no merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding GitHub check_run and issue_comment triggers to the Surface API.
Description check ✅ Passed The description directly explains the new GitHub triggers, deployment event support, dependency update, documentation, and test coverage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 5 files. (3 skipped: 3 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

A rabbit hops where pull requests spring,
Check runs hum and comments sing.
Events are trimmed to names precise,
Tests guard pull requests and ice.
New triggers bloom beneath the moon.

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review swarm: maintainability

No fresh transcript was produced for run a5e1944d-c7bd-458f-9d94-3d95f4fd4963 (MISSING).

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review swarm: history

No fresh transcript was produced for run a5e1944d-c7bd-458f-9d94-3d95f4fd4963 (MISSING).

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review swarm: structure

No fresh transcript was produced for run a5e1944d-c7bd-458f-9d94-3d95f4fd4963 (MISSING).

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review swarm: FAILED

  • maintainability: MISSING
  • history: MISSING
  • structure: MISSING

Cloud run: a5e1944d-c7bd-458f-9d94-3d95f4fd4963

Relayflow Lead and others added 2 commits September 17, 2026 15:11
The GitHub source setting `events` (AgentWorkforce/cloud#3772) selects
which records wake a listener: `issues` (default) or `pull_request`. The
CLI validates it client-side like the other settings and the doc describes
the pull-request run's input.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The release carrying relayfile-adapters#279 (`check_run` and
`issue_comment` webhook keys). `generate-triggers.mjs` against the
installed tarball reproduces the committed trigger modules byte for byte,
and `--check` passes again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@khaliqgant
khaliqgant marked this pull request as ready for review September 17, 2026 23:02
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread packages/sdk/src/cloud-deploy.ts Outdated
Comment on lines +107 to +108
if (key === 'events' && !['issues', 'pull_request'].includes(setting.toLowerCase())) {
throw new CloudFlowError('invalid_input', `github events must be "issues" or "pull_request", got "${setting}".`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Mixed-case event values reach Cloud

events=PULL_REQUEST passes parseTriggerSource, but the parser sends that original value. Cloud expects pull_request, so deployment cannot create the requested listener.

Learn more

The parser treats the event enum case-insensitively during validation but preserves the caller's spelling in settings. The deployment request later serializes settings without another normalization step.

Example: --on github:events=PULL_REQUEST passes validation because PULL_REQUEST.toLowerCase() is pull_request. The request still contains { events: "PULL_REQUEST" } instead of the Cloud enum { events: "pull_request" }.

Recommended fix: Either validate the original value against the exact enum or assign the normalized value to settings[key]. Add a test covering mixed-case input and the serialized deployment body.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in baa4f5e: the value is lowercased before it is stored in settings, so the deploy body carries pull_request whatever the shell typed; tests cover PULL_REQUEST and Pull_Request.

Validation was case-insensitive but the caller's spelling was serialized, so
`events=PULL_REQUEST` passed the CLI and failed at Cloud (Devin).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@khaliqgant
khaliqgant merged commit c73f670 into main Sep 17, 2026
9 of 11 checks passed
khaliqgant pushed a commit that referenced this pull request Sep 17, 2026
…rovider trigger namespace

Merges origin/main (#446) and moves the pin to 0.5.26, the first release
that bundles every adapter's own mapping under mappings/adapters/
(relayfile-adapters#280). Triggers are regenerated from the installed
tarball alone — no --adapters-dir — and `generate-triggers.mjs --check`
passes: 47 providers, 502 events, PROVIDERS.md in sync. Conflicts resolved
by taking main's cloud-deploy.* (untouched here) and this branch's
superset github-events test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Sep 18, 2026
…bhooks (#456)

* feat(surface): github.check_run and github.issue_comment triggers

Regenerated `packages/surface/src/triggers/github.ts` from the core GitHub
mapping in AgentWorkforce/relayfile-adapters#279, which declares `check_run`
and `issue_comment` as action-bearing webhook keys. The surface gains
`github.check_run(action?)` and `github.issue_comment(action?)` — the two
events a PR reviewer needs for merge-on-green and comment-driven directives —
and `providerEventTypes.github` lists them, so `flows check` admits a
subscription to either instead of refusing it as unpublished.

Generated with the adapters checkout's `packages/core/mappings` alone, which is
byte-for-byte what the published `@relayfile/adapter-core` tarball will carry,
so `generate-triggers.mjs --check` reproduces these files once the SDK's pinned
adapter-core is bumped to the release that contains #279. Until that bump the
check refuses, by design.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feat(sdk): flows deploy --on github:events=pull_request

The GitHub source setting `events` (AgentWorkforce/cloud#3772) selects
which records wake a listener: `issues` (default) or `pull_request`. The
CLI validates it client-side like the other settings and the doc describes
the pull-request run's input.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore(sdk): pin @relayfile/adapter-core 0.5.25

The release carrying relayfile-adapters#279 (`check_run` and
`issue_comment` webhook keys). `generate-triggers.mjs` against the
installed tarball reproduces the committed trigger modules byte for byte,
and `--check` passes again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feat(surface): trigger namespaces for every relayfile adapter with webhooks

`scripts/generate-triggers.mjs` read only the mapping YAML that
@relayfile/adapter-core bundles, and that was the two core fallbacks, so
`flow().on(...)` could subscribe to Slack and GitHub and nothing else,
although relayfile ingests events from 47 providers.

The generator now applies three sources per provider: the core fallback
mappings, each adapter's own mapping (`mappings/adapters/` in the package
since relayfile-adapters#280, or `packages/<adapter>/` in a checkout) which
supersedes the fallback as a whole, and the trigger catalog
(`@relayfile/adapter-core/triggers`, fed by every adapter's
`supportedEvents()`) for providers with no `webhooks:` block. Mapping-backed
providers keep payload-aware signatures (`github.pull_request(action?)`);
catalog-backed ones get `(filter?)`. Result: 47 namespaces, 502 events;
`github` and `slack` are supersets of what #446 generated, so
`--on github:events=` and the six fallback GitHub events are unchanged.

Also: a reserved-namespace guard (`webhook`, `flow`, `schedule`, …), a
generated `PROVIDERS.md` table covered by `--check`, and hyphenated ids
mapped to identifiers (`azure_blob`, `google_drive`) with upstream spelling
kept in the lowered filter.

Merge condition: adapter-core published with relayfile-adapters#280 and the
SDK pin bumped; until then `generate-triggers.mjs --check` (and its test)
report github.ts/gitlab.ts/index.ts/PROVIDERS.md drift against 0.5.25 — 45
of the 47 providers already generate identically from the catalog it ships.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(surface): satisfy the strict test tsconfig in the all-providers trigger test

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(surface): union catalog events into mapping-backed providers

Devin on #456: a provider with any `webhooks:` block lost every event the
catalog listed but the mapping did not — gitlab kept 8 of the 53 it
delivers, so ingress would refuse the other 45 and `flows check` had no
namespace for them. The mapping describes payload shape for some events,
never the delivered set; `supportedEvents()` does.

Catalog events are now unioned into every provider with the plain
`(filter?)` signature; a mapping-declared event keeps its signature. Where
two upstream names mangle to one identifier (slack publishes both
`reaction.added` and `reaction_added`) the mapping-declared event owns the
method and the other remains in `providerEventTypes`, subscribable via
`webhook(provider, { provider, type })` and listed in PROVIDERS.md.
47 providers, 570 events (was 502): gitlab 53, github 26, slack 21.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(surface): action-qualified events take a plain filter, never a second action

Cursor on #456: `pull_request_edited(action?)` pinned the type to
`pull_request.edited` and still accepted an action, a dual vocabulary that
is easy to misuse. Only an aggregate event whose mapping extracts `action`
takes one now (`pull_request`, `check_run`, `issue_comment`). Both
spellings stay, because two ingresses deliver them: the aggregate form is
what raw GitHub and the local receiver carry, the action-qualified form is
what relayfile's Cloud ingress normalizes to; the README says which to use.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Relayflow Lead <lead@relayflows.local>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant