Public: anyone can read this; the crew can change it.

Settings › Webhooks pauses and resumes a hook with one button, as the terminal's `p` does #10115

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Each hook row on Settings › Webhooks (`/:owner/:name/settings/hooks`) now has a **Pause** button, or **Resume** when the hook is paused. It goes through `pauseWebhook`, the same action the terminal's `p` uses, so each click also records a `webhook.paused` / `webhook.resumed` event.

shipped production is serving it deploy f21b126

opened this

Each hook row on Settings › Webhooks (/:owner/:name/settings/hooks) now has a Pause button, or Resume when the hook is paused. It goes through pauseWebhook, the same action the terminal's p uses, so each click also records a webhook.paused / webhook.resumed event.

  • Routes (src/http/server.ts): POST …/settings/hooks/:id/pause and POST …/settings/hooks/:id/resume. There are two routes rather than one toggle, so posting the same button twice leaves the hook in the state it asked for instead of flipping it back. Both are handled in src/web/pages/hooks.ts behind adminForm, like Send ping and Delete: a post from another site gets 403, and anyone who is not a repository admin gets 404 from both the page and the post. A hook that no longer exists comes back as a danger flash.
  • Row: when paused, the row shows paused and Resume, and drops "No deliveries yet." Its recent deliveries are still listed underneath. I kept them on purpose, because they are what tells an admin why the hook was failing.
  • Doc: docs/features/webhook-pause.md now describes the web button and its routes. Its "Not yet" line names only the missing MCP tool.
  • Test: test/web-hook-pause.test.ts pauses and then resumes through the page, reading each state back from the HTML and the database and counting the events. It also checks that a reader's post and an anonymous post both get 404, that a post from another site gets 403, and that a missing hook gets a message.

bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. Because the change touches server.ts, scripts/fast.ts named 1,539 test files, so I chose 12 myself: the new one, the other hook suites (ping, rows, etag, redeliver, webhooks, terminal hooks), cross-origin-mutations and unreached. All 430 tests in them pass. The keep_plan tool the issue asks for was not available in this run, so the issue has no plan on it.

To try it: as an admin, open a repository's Settings › Webhooks, press Pause on a hook, and the row reads paused and offers Resume. Signed in as a non-admin, the same URL is a 404.

🤖 Generated with Claude Code

Closes #10103

commented

Each hook row on Settings › Webhooks (/:owner/:name/settings/hooks) now has a Pause button, or Resume when the hook is paused. It goes through pauseWebhook, the same action the terminal's p uses, so each click also records a webhook.paused / webhook.resumed event.

  • Routes (src/http/server.ts): POST …/settings/hooks/:id/pause and POST …/settings/hooks/:id/resume. There are two routes rather than one toggle, so posting the same button twice leaves the hook in the state it asked for instead of flipping it back. Both are handled in src/web/pages/hooks.ts behind adminForm, like Send ping and Delete: a post from another site gets 403, and anyone who is not a repository admin gets 404 from both the page and the post. A hook that no longer exists comes back as a danger flash.
  • Row: when paused, the row shows paused and Resume, and drops "No deliveries yet." Its recent deliveries are still listed underneath. I kept them on purpose, because they are what tells an admin why the hook was failing.
  • Doc: docs/features/webhook-pause.md now describes the web button and its routes. Its "Not yet" line names only the missing MCP tool.
  • Test: test/web-hook-pause.test.ts pauses and then resumes through the page, reading each state back from the HTML and the database and counting the events. It also checks that a reader's post and an anonymous post both get 404, that a post from another site gets 403, and that a missing hook gets a message.

bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. Because the change touches server.ts, scripts/fast.ts named 1,539 test files, so I chose 12 myself: the new one, the other hook suites (ping, rows, etag, redeliver, webhooks, terminal hooks), cross-origin-mutations and unreached. All 430 tests in them pass. The keep_plan tool the issue asks for was not available in this run, so the issue has no plan on it.

To try it: as an admin, open a repository's Settings › Webhooks, press Pause on a hook, and the row reads paused and offers Resume. Signed in as a non-admin, the same URL is a 404.

🤖 Generated with Claude Code

commented

Each hook row on Settings › Webhooks (/:owner/:name/settings/hooks) now has a Pause button, or Resume when the hook is paused. It goes through pauseWebhook, the same action the terminal's p uses, so each click also records a webhook.paused / webhook.resumed event.

  • Routes (src/http/server.ts): POST …/settings/hooks/:id/pause and POST …/settings/hooks/:id/resume. There are two routes rather than one toggle, so posting the same button twice leaves the hook in the state it asked for instead of flipping it back. Both are handled in src/web/pages/hooks.ts behind adminForm, like Send ping and Delete: a post from another site gets 403, and anyone who is not a repository admin gets 404 from both the page and the post. A hook that no longer exists comes back as a danger flash.
  • Row: when paused, the row shows paused and Resume, and drops "No deliveries yet." Its recent deliveries are still listed underneath, on purpose, because they show why the hook was failing.
  • Doc: docs/features/webhook-pause.md now describes the web button and its routes. Its "Not yet" line names only the missing MCP tool.
  • Test: test/web-hook-pause.test.ts pauses and then resumes through the page, reading each state back from the HTML and the database and counting the events. It also checks that a reader's post and an anonymous post both get 404, that a post from another site gets 403, and that a missing hook gets a message.

The first check failed because no commit message had the gate's Try: line. A second, empty commit now carries one.

bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. Because the change touches server.ts, scripts/fast.ts named 1,539 test files, so I chose 12 myself: the new one, the other hook suites (ping, rows, etag, redeliver, webhooks, terminal hooks), cross-origin-mutations and unreached. All 430 tests in them passed before the empty commit, and the new suite's 4 pass again. The keep_plan tool the issue asks for was not available in this run, so the issue has no plan on it.

Try: as an admin, open /<owner>/<repo>/settings/hooks on the preview, add a webhook and press Pause. The row reads paused and offers Resume, and Resume makes it active again. Signed in as a non-admin, the same URL is a 404.

🤖 Generated with Claude Code

Approved

Clean. Pause/Resume are two same-origin POST routes behind adminForm (non-admin 404, cross-site 403), both calling pauseWebhook, the terminal action, so the event trail and live reach match the terminal. Tests fail without the change and cover pause, resume, reader/anonymous 404, cross-site 403 and a missing hook. Docs are in docs/features, not README. The row uses the existing btn and form pattern with no new component, accent or border. Nit, not blocking: the Code line in webhook-pause.md runs long; wrap it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs