Skip to content

Keep the GitHub, Gmail, Chat and Outlook hooks in the kit's hook registry - #1076

Merged
ndisidore merged 1 commit into
mainfrom
chore/gk-hook-registry-ports
Nov 9, 2026
Merged

ndisidore merged 1 commit into
mainfrom
chore/gk-hook-registry-ports

Conversation

@ndisidore

@ndisidore ndisidore commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

#1072 added @gadgets/gatekeeper-kit/hook-registry for the fan-out behind a push-driven hook driver, with no driver on it. This ports the four that are on main (GitHub, Gmail, Chat, Outlook): each drops its hand-written reg:{key} / caps:{key} records, stub disposal, queue cancel and startHook() → delivery.deliver() call, and uses HookRegistry for all of it. 66 lines added, 194 removed.

  • No behavior change intended, and no migration. The registry reads and writes the same reg: / caps: keys and wraps the same HookDeliveryQueue, so hooks enabled before the port keep delivering
  • Three differences that come with the registry. The stubs are stored before the registration, and both inside ctx.storage.transactionSync(), so a registration that can't be stored leaves the hook as it was (the follow-up promised on Add a kit hook registry for the drivers that queue provider pushes #1072's review). Two overlapping alarm runs join instead of delivering twice
  • Each XHookDelivery interface is now an alias of HookDelivery<…>, which removes the @ts-expect-error on every deliver call. The one on each controller's enable() is still needed and stays
  • Unchanged: each driver's alarm (#wakeBy, #reschedule), provider lifecycle, ingest filters and controller, and GitHub's disconnect, which still sweeps its storage and disposes each caps: record itself. Only set() is in the transaction, not the driver's neighbouring writes (Gmail's cursor, Outlook's watch record)
  • Tested: the drivers' existing suites, unchanged but for a pass-through transactionSync on the storage fake in Outlook's Node test: GitHub workerd hooks (73), Chat (26), Gmail (29), Outlook (71), and the GitHub hooks integration test against a worker rebuilt from the ported source
  • Not checked: the full package suites, the full integration suite and workspace-wide pnpm lint / pnpm test were not run locally. No driver test makes a set() fail, so the transaction is covered only by the kit's own workerd test. Outlook's driver has no workerd test, only the Node one over fakes
  • Gatekeepers and plan §4.24 only; no kit, workshop-backend or workshop-shared change. PagerDuty is not on main, so its port falls to that branch

Devin Review

…stry

Each driver kept its own reg:/caps: records, stub disposal and
startHook() -> deliver() call around the kit's delivery queue. They now use
HookRegistry for all of it, under the same storage keys, and alias their
delivery interfaces to HookDelivery, which drops the suppression on the
deliver call. Each calls set() inside ctx.storage.transactionSync(), so a
registration that can't be stored leaves the hook as it was.

Alarms, provider lifecycles, ingest filters, controllers and GitHub's
disconnect sweep are unchanged.
@github-actions github-actions Bot added the gatekeeper Changes to a gatekeeper integration label Nov 9, 2026
@ask-bonk

ask-bonk Bot commented Nov 9, 2026

Copy link
Copy Markdown

LGTM!

github run

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Preview: pr1076-chore-gk-hoo-f4c1328e

https://pr1076-chore-gk-hoo-f4c1328e-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

@ndisidore
ndisidore marked this pull request as ready for review November 9, 2026 20:47

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Approved — No issues found. This is a behavior-preserving refactor: it keeps the same storage keys and delivery steps, and now stores each registration and its stubs in one transaction.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No authorization, credential or injection boundary changes. Stub disposal is still handled, now by the registry.


📖 AGENTS.md: ✅ LGTM

No conflicts with the repository guidelines.


📋 Code Quality: ✅ LGTM

All four ports keep the same reg: and caps: storage keys and the same order of delivery calls. set() runs inside transactionSync with no awaits inside it, and no unused imports are left behind.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

The plan update matches the change.


Reviewed commit: 4fef8324

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@ndisidore
ndisidore merged commit 3c86b5a into main Nov 9, 2026
21 checks passed
@ndisidore
ndisidore deleted the chore/gk-hook-registry-ports branch November 9, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gatekeeper Changes to a gatekeeper integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants