feat(features,database,service): a workspace automation hears GitHub events in any of its repositories, and a pull request opened, marked ready, or pushed to is one

Merged
DA
4d ago
+360-116

Summary

Part 1 of Dean's "build GitHub events and webhooks, then the code review bot on top". GitHub events fire on workspace automations, and the review bot's trigger (pull-request-updated) lands. The existing events from #2515 (PR opened or labelled, issue opened or labelled, checks failed, push) are unchanged.

  • The listener hears workspace automations.
    • githubAutomationsOn matches an automation by any of its repositories (case-folded, as GitHub folds names), or by its plan's on a row an older build wrote.
    • It no longer requires a plan. The owner must still be a member of the automation's workspace.
  • The refusals are lifted. Create (#2746) and PATCH (#2756) no longer refuse a GitHub trigger on an automation with no plan, since it is now heard.
  • A run starts where the event happened. A GitHub firing starts its agent in the repository the event named, as the automation spells it among its repositories. A firing about a repository the automation no longer lists is skipped as repository-changed, as before. Schedule, webhook, and manual runs still start in the first.
  • pull-request-updated: a pull request opened, reopened, marked ready for review, or pushed to (synchronize).
    • A draft fires nothing until it is marked ready.
    • A bot's delivery fires nothing, as for every other event.
    • One opened delivery is both pull-request-opened and pull-request-updated, so each automation listening for either records its run under the delivery's id.

The desktop still offers only schedules (#2747's params). The editor's trigger section comes in a later PR of this stack.

Evidence

  • Platform-independent checks: pnpm check:affected passes.
  • New tests, each failing without its change:
    • github-webhook-app.test.ts: opened, synchronize, and ready queue a run for a workspace automation listening for updates in any of its repositories. A draft, a bot's push, a close, and an owner who left the workspace queue none. An opened delivery fires both an opened and an updated automation.
    • automation-runs.test.ts: a GitHub firing starts the agent of a workspace automation in the repository it named, though that is not the automation's first.
  • Changed tests:
    • automations-app.test.ts: create on a workspace with a GitHub trigger answers 201, not 400.
    • #2756's test now asserts that a PATCH to a GitHub event takes, on a workspace automation as on a plan's.
  • Test count: +2.

Invariants

  • ./scripts/check.sh green. (CI)
  • JSON Schema goldens unchanged. The automation wire isn't among them.
  • Every behavior change has, in this PR, the test that fails without it; no change-detector test added.
  • Gateway envelope goldens unchanged. (CI)
  • No new as type assertion outside the allowlisted files.
  • No Effect.runPromise/runSync/runFork outside the runtime edges.
  • No new raw async primitives.
  • No Effect, Stream, or Layer dropped as a statement.
  • Test count delta listed (+2).
  • No hand-rolled file replaced.
  • No CLAUDE.md/AGENTS.md sentence names a changed part.
  • PRIVACY.md unchanged.
  • Package deps unchanged.
  • Barrel/door rule unaffected.

Notes

  • Security: the event stays fenced as data in the agent's task (unchanged). Refusing fork PRs is a code review bot decision and comes with that stack (on hold for Dean).
  • The spike reference is #2753, which this stack supersedes piece by piece.
  • Mac: no desktop change. CI could not verify the Mac UI, and ./scripts/verify.sh was not run.

šŸ¤– Generated with Claude Code


Open workspace in Conductor


Devin Review


Summary by cubic

Lets workspace automations hear GitHub events in any of their repositories, and adds a pull-request-updated event: a pull request opened, reopened, marked ready for review, or pushed to.

  • A delivery matches an automation by any of its repositories instead of its plan's, and no longer requires a plan; the create and PATCH refusals for a GitHub trigger on an automation with no plan are lifted.
  • A GitHub firing starts its agent in the repository the event named, as the automation spells it; a firing about a repository the automation no longer lists is still skipped.
  • An automation that hands every run to the same agent takes a GitHub event only from that agent's repository among its own; any other repository is skipped as repository-changed.
  • An opened pull request fires both pull-request-opened and pull-request-updated; a draft, a close, and a bot's delivery fire nothing.