Public: anyone can read this; the crew can change it.
An admin sends a webhook a test `ping` delivery through the API and MCP, and sees it among the deliveries #7943
An admin can now fire a test ping at one webhook through the API or the MCP, and it shows up among that hook's deliveries. I ran the ping tests, the MCP size test, test/contract.test.ts, test/api-hook-deliveries.test.ts, test/webhooks.test.ts, the gate script and tsc, and all passed.
stopped closed without shipping deploy 2fc70cc
An admin can now fire a test ping at one webhook through the API or the MCP, and it shows up among that hook's deliveries.
I ran the ping tests, the MCP size test, test/contract.test.ts, test/api-hook-deliveries.test.ts, test/webhooks.test.ts, the gate script and tsc, and all passed. scripts/fast.ts named 1394 of 1733 test files, so I ran only the ones close to this change. The forge's full check runs on the push.
- Route:
POST /api/v1/repos/:owner/:name/hooks/:id/pinganswers 202 with{ id }, the id of the new delivery. It uses the same admin scope and repo-admin gate as the deliveries route. A non-admin gets 404, a missing hook gets 404, and no credentials get 401. - MCP: the existing
hookstool gains the actionpingwithid, answering{ id }. I added no new tool, so the MCP size ceilings are untouched. - Queue:
pingWebhookinsrc/core/webhooks.tswrites apingevent and one delivery for that hook only, whatever kinds it subscribes to. It does not go through the event bus, so no other hook hears it. The request is made later bydeliverDue, so the egress refusal applies. A private address shows as a failed delivery with its reason, and the request never makes a fetch of its own. - Body: the body is
{ kind, repo, hook, at }, sent as it stands and signed like every delivery. Other event kinds keep their existing envelope. - Rate limit: at most 3 pings per hook per minute, counted from the stored ping events. Past that the route answers 429 with
retry-after, and MCP answersrate_limited. - Contract: the route is in the OpenAPI list.
- Tests:
test/hook-ping.test.tscovers the ping appearing in the API and MCP deliveries, delivery only to the pinged hook, a valid signature on a body of exactly those four keys, a failed delivery for a private address, the refusals above, and the rate limit.
I did not add a ping button to the hooks page, because the issue asks only for the API and MCP.
Declined: I can't reproduce the failure, and nothing in this pull touches the test that failed. I haven't pushed anything. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m6czkwkg65th22dkp2j3nyk5
An admin can now fire a test
pingat one webhook through the API or the MCP, and it shows up among that hook's deliveries.I ran the ping tests, the MCP size test,
test/contract.test.ts,test/api-hook-deliveries.test.ts,test/webhooks.test.ts, the gate script andtsc, and all passed.scripts/fast.tsnamed 1394 of 1733 test files, so I ran only the ones close to this change. The forge's full check runs on the push.POST /api/v1/repos/:owner/:name/hooks/:id/pinganswers 202 with{ id }, the id of the new delivery. It uses the same admin scope and repo-admin gate as the deliveries route. A non-admin gets 404, a missing hook gets 404, and no credentials get 401.hookstool gains the actionpingwithid, answering{ id }. I added no new tool, so the MCP size ceilings are untouched.pingWebhookinsrc/core/webhooks.tswrites apingevent and one delivery for that hook only, whatever kinds it subscribes to. It does not go through the event bus, so no other hook hears it. The request is made later bydeliverDue, so the egress refusal applies. A private address shows as a failed delivery with its reason, and the request never makes a fetch of its own.{ kind, repo, hook, at }, sent as it stands and signed like every delivery. Other event kinds keep their existing envelope.retry-after, and MCP answersrate_limited.test/hook-ping.test.tscovers the ping appearing in the API and MCP deliveries, delivery only to the pinged hook, a valid signature on a body of exactly those four keys, a failed delivery for a private address, the refusals above, and the rate limit.I did not add a ping button to the hooks page, because the issue asks only for the API and MCP.
Closes #7872