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

An admin pauses and resumes a webhook from the terminal's webhook list with `p`, and a paused hook gets no deliveries #8088

Parked opened this
Closed without merging

An admin can now pause and resume a webhook from the terminal's webhook list with p, and a paused hook is sent nothing. tsc, scripts/gate.ts, and the webhooks, tui-hooks, mcp-size, event-audience and parity tests pass. I did not run scripts/design-lint.ts, because nothing under src/web/ changed.

Notes

stopped parked by the crew deploy 2f8bfc5

opened this

An admin can now pause and resume a webhook from the terminal's webhook list with p, and a paused hook is sent nothing. tsc, scripts/gate.ts, and the webhooks, tui-hooks, mcp-size, event-audience and parity tests pass. I did not run scripts/design-lint.ts, because nothing under src/web/ changed.

  • Core: setWebhookActive(db, repoId, hookId, active) in src/core/webhooks.ts returns false for a hook of another repository. Webhook already carried active, and enqueueForEvent already skipped inactive hooks, so nothing else changed there.
  • Action: pauseWebhook in src/actions/repos.ts checks the actor administers the repo and appends webhook.paused or webhook.resumed to the bus. It sits next to deleteWebhook. I also added the two events' wording to src/design/activity.ts.
  • Terminal: on the list screen only (the Deliveries screen is untouched), p toggles the selected hook for anyone the screen already allows. A paused row reads paused in place of its last delivery, and the key binding is listed in the help.
  • Tests:
    • test/webhooks.test.ts: a paused hook enqueues nothing, a hook of another repository is refused, and after resume a new event is queued while the one from the paused time is not.
    • test/tui-hooks.test.ts: p pressed twice, with both events checked.

I did not touch the API or MCP; test/mcp-size.test.ts still passes.

I did not rebase on #8075, which also edits src/core/webhooks.ts and hooks.ts. My changes are confined to a new function and the list screen, so the two should merge cleanly.

Closes #8082

3 earlier comments
commented

An admin can now pause and resume a webhook from the terminal's webhook list with p, and a paused hook is sent nothing. tsc, scripts/gate.ts, and the webhooks, tui-hooks, mcp-size, event-audience and parity tests pass. I did not run scripts/design-lint.ts, because nothing under src/web/ changed.

  • Core: setWebhookActive(db, repoId, hookId, active) in src/core/webhooks.ts returns false for a hook of another repository. Webhook already carried active, and enqueueForEvent already skipped inactive hooks, so nothing else changed there.
  • Action: pauseWebhook in src/actions/repos.ts checks the actor administers the repo and appends webhook.paused or webhook.resumed to the bus. It sits next to deleteWebhook. I also added the two events' wording to src/design/activity.ts.
  • Terminal: on the list screen only (the Deliveries screen is untouched), p toggles the selected hook for anyone the screen already allows. A paused row reads paused in place of its last delivery, and the key binding is listed in the help.
  • Tests:
    • test/webhooks.test.ts: a paused hook enqueues nothing, a hook of another repository is refused, and after resume a new event is queued while the one from the paused time is not.
    • test/tui-hooks.test.ts: p pressed twice, with both events checked.

I did not touch the API or MCP; test/mcp-size.test.ts still passes.

I did not rebase on #8075, which also edits src/core/webhooks.ts and hooks.ts. My changes are confined to a new function and the list screen, so the two should merge cleanly.

commented

I made no code fix for the failed check, because I couldn't reproduce the failure. the crew section: admin only, and an agent made on the web lives in test/web-apps.test.ts, a file this pull doesn't touch, and it passed on all four local runs, including the last one after merging main. It looks like a flaky test, though I haven't proven that.

I merged origin/main into the branch and pushed (c1428bf8) so the check runs again. I merged rather than rebased because a rebase would need a force push, which is refused here. Locally, tsc is clean and 42 tests pass across test/webhooks.test.ts, test/tui-hooks.test.ts and test/web-apps.test.ts.

If that test fails again on the new run, the log should show which assertion fails. It needs a person, or another pull, to look at it, since nothing in this pull reaches it.

commented

The failing check was not caused by this change, and I changed no code to fix it. Shard 43 was killed after 40 s while running test/tui-runwords.test.ts, a test of how runs read in the terminal. This pull touches only the webhooks list, so it never goes near that screen. The log reports "0 failed" across all 11,652 tests, which fits a load kill rather than a failing test.

Run alone here, test/tui-runwords.test.ts passes in 1.2 s. With test/tui-hooks.test.ts and test/webhooks.test.ts that is 34 tests, all passing, and bun x tsc --noEmit is clean. I did not run bun scripts/gate.ts or the rest of the suite.

I pushed an empty commit to trigger the forge's check again. If shard 43 is killed again, the cause is that test's runtime under load on the check machine, not this pull.

What this pull does

  • An admin pauses or resumes a webhook from the terminal's webhooks list with p.
  • A paused hook gets no deliveries.
  • The change is in src/actions/repos.ts, src/core/webhooks.ts, src/design/activity.ts and src/tui/screens/hooks.ts, with tests in test/tui-hooks.test.ts and test/webhooks.test.ts.
commented

Parked by the crew: the check stayed red through 2 automatic tries: MCP backups > a listing that fails is a short sentence with no key in it

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs