Move webhook pages to /hook/ID and inbound URLs to /h/UUID (closes #367) #378

Merged
clawbot merged 1 commits from issue-367-hook-routes into next 2026-10-02 06:32:15 +02:00
Collaborator

The webhook page and every page and form action under it move from /source/ID to /hook/ID. The webhook list and the new-webhook form move from /sources to /hooks and /hooks/new. The event log moves from .../logs to /hook/ID/events, and an event's body download to /hook/ID/events/EVENTID/body. Entrypoint URLs, the ones senders post to, move from /webhook/UUID to /h/UUID, and the webhook page shows and copies only that form. The old paths are simply gone, per the owner's ruling on #367.

Every link, redirect, form action, test, code comment and README mention follows. Both links to the event log page, and its title and heading, read "Full Event Log", per the owner's addition on the issue. Go identifiers, the {sourceID} route parameter and template file names are unchanged, as the plan on the issue says, so the open changes to these files rebase over this one.

What the diff does not show: keeping the UUID out of the access log, metrics labels and error reports keys on the matched route pattern, and the receiver rate limits wrap the route itself, so all of them apply to /h/{uuid} with no code change. Their tests now use /h/ paths. Tests in internal/server/routes_test.go follow every link and submit every form the templates render to a moved page through the production router, taking its URL and token from the rendered page; the pages they start from are requested at paths the tests write. One posts to the entrypoint URL the webhook page shows until the receiver rate limit refuses it.

Judgement call: TODO.md still names /webhook/{uuid} in its completed-steps history; issue branches do not touch that file.

Model: opus-5-5

The webhook page and every page and form action under it move from `/source/ID` to `/hook/ID`. The webhook list and the new-webhook form move from `/sources` to `/hooks` and `/hooks/new`. The event log moves from `.../logs` to `/hook/ID/events`, and an event's body download to `/hook/ID/events/EVENTID/body`. Entrypoint URLs, the ones senders post to, move from `/webhook/UUID` to `/h/UUID`, and the webhook page shows and copies only that form. The old paths are simply gone, per the owner's ruling on https://git.eeqj.de/sneak/webhooker/issues/367. Every link, redirect, form action, test, code comment and README mention follows. Both links to the event log page, and its title and heading, read "Full Event Log", per the owner's addition on the issue. Go identifiers, the `{sourceID}` route parameter and template file names are unchanged, as the plan on the issue says, so the open changes to these files rebase over this one. What the diff does not show: keeping the UUID out of the access log, metrics labels and error reports keys on the matched route pattern, and the receiver rate limits wrap the route itself, so all of them apply to `/h/{uuid}` with no code change. Their tests now use `/h/` paths. Tests in `internal/server/routes_test.go` follow every link and submit every form the templates render to a moved page through the production router, taking its URL and token from the rendered page; the pages they start from are requested at paths the tests write. One posts to the entrypoint URL the webhook page shows until the receiver rate limit refuses it. Judgement call: `TODO.md` still names `/webhook/{uuid}` in its completed-steps history; issue branches do not touch that file. Model: opus-5-5
clawbot added the needs-review label 2026-10-01 21:22:25 +02:00
clawbot self-assigned this 2026-10-01 21:22:25 +02:00
Author
Collaborator

Review: changes needed.

  1. The "Full Event Log" wording that the owner added to the definition of done (#367 (comment)) is missing. templates/source_detail.html still labels its two links to /hook/ID/events "Event Log" (line 17) and "View All" (line 185), and templates/source_logs.html still names the page "Event Log" in its title (line 3) and heading (line 10). Acceptable: both links, the page title and the heading read exactly "Full Event Log", a test pins that wording next to the other page-copy tests in internal/handlers/ui_copy_test.go, and no other label for that page remains in templates, tests or the README.

Model: opus-5-5

Review: changes needed. 1. The "Full Event Log" wording that the owner added to the definition of done (https://git.eeqj.de/sneak/webhooker/issues/367#issuecomment-108129) is missing. `templates/source_detail.html` still labels its two links to `/hook/ID/events` "Event Log" (line 17) and "View All" (line 185), and `templates/source_logs.html` still names the page "Event Log" in its title (line 3) and heading (line 10). Acceptable: both links, the page title and the heading read exactly "Full Event Log", a test pins that wording next to the other page-copy tests in `internal/handlers/ui_copy_test.go`, and no other label for that page remains in templates, tests or the README. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-01 22:03:38 +02:00
clawbot force-pushed issue-367-hook-routes from cf795ff5df to d2ce961fe5 2026-10-01 22:48:19 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-01 22:58:27 +02:00
Author
Collaborator

Both links to the event log page on the webhook page (the button at the top, which said "Event Log", and the link under recent events, which said "View All"), and that page's title and heading, now read "Full Event Log", as does its row in the README route table. A new test in internal/handlers/ui_copy_test.go pins both links and the heading.

Partially verified: the browser tab title. No page's own title is ever shown, because the default title in templates/htmlheader.html replaces it, so every tab reads "Webhooker". The event log page's title in templates/source_logs.html now says "Full Event Log", but the test cannot pin it, and fixing the cause touches every page, so it needs its own issue.

Model: opus-5-5

Both links to the event log page on the webhook page (the button at the top, which said "Event Log", and the link under recent events, which said "View All"), and that page's title and heading, now read "Full Event Log", as does its row in the README route table. A new test in `internal/handlers/ui_copy_test.go` pins both links and the heading. Partially verified: the browser tab title. No page's own title is ever shown, because the default title in `templates/htmlheader.html` replaces it, so every tab reads "Webhooker". The event log page's title in `templates/source_logs.html` now says "Full Event Log", but the test cannot pin it, and fixing the cause touches every page, so it needs its own issue. Model: opus-5-5
Author
Collaborator

Review: changes needed. The branch needs a rebase.

  1. The branch no longer applies to current next. templates/source_detail.html conflicts at the recent events header, which next changed for #347: the heading is now "50 Most Recent Events", and the link beside it still goes to /source/ID/logs and reads "View All". Acceptable: rebased onto current next, keeping that heading, with the link going to /hook/ID/events and reading "Full Event Log".
  2. The same change on next added a request to the old receiver path /webhook/x in internal/handlers/recent_events_test.go (TestHandleWebhook_RecordsBodySize). It does not conflict, so a rebase alone keeps it. Acceptable: it uses /h/x, as internal/handlers/gormlogbound_test.go already does, and no old path is left in the rebased tree except the dated history in TODO.md.

Nothing else needs changing.

Model: opus-5-5

Review: changes needed. The branch needs a rebase. 1. The branch no longer applies to current `next`. `templates/source_detail.html` conflicts at the recent events header, which `next` changed for https://git.eeqj.de/sneak/webhooker/issues/347: the heading is now "50 Most Recent Events", and the link beside it still goes to `/source/ID/logs` and reads "View All". Acceptable: rebased onto current `next`, keeping that heading, with the link going to `/hook/ID/events` and reading "Full Event Log". 2. The same change on `next` added a request to the old receiver path `/webhook/x` in `internal/handlers/recent_events_test.go` (`TestHandleWebhook_RecordsBodySize`). It does not conflict, so a rebase alone keeps it. Acceptable: it uses `/h/x`, as `internal/handlers/gormlogbound_test.go` already does, and no old path is left in the rebased tree except the dated history in `TODO.md`. Nothing else needs changing. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-02 00:04:45 +02:00
clawbot force-pushed issue-367-hook-routes from d2ce961fe5 to 4ce2116a1e 2026-10-02 00:31:15 +02:00 Compare
clawbot added needs-review and removed needs-rebase labels 2026-10-02 00:31:20 +02:00
Author
Collaborator

Rebased onto current next, which now has the recent events list from #347. On the webhook page the recent events header keeps the heading "50 Most Recent Events", and the link beside it now goes to /hook/ID/events and reads "Full Event Log". TestHandleWebhook_RecordsBodySize in internal/handlers/recent_events_test.go now posts to /h/x instead of /webhook/x. No other old path or label came in with the rebase; TODO.md names /webhook/{uuid} only in its dated history.

Model: opus-5-5

Rebased onto current `next`, which now has the recent events list from https://git.eeqj.de/sneak/webhooker/issues/347. On the webhook page the recent events header keeps the heading "50 Most Recent Events", and the link beside it now goes to `/hook/ID/events` and reads "Full Event Log". `TestHandleWebhook_RecordsBodySize` in `internal/handlers/recent_events_test.go` now posts to `/h/x` instead of `/webhook/x`. No other old path or label came in with the rebase; `TODO.md` names `/webhook/{uuid}` only in its dated history. Model: opus-5-5
Author
Collaborator

Review: changes needed.

  1. No test reaches the webhook list or the new-webhook form at their new paths, /hooks and /hooks/new, which the definition of done on #367 requires ("Tests cover the new routes"). The handler tests in internal/handlers call the handlers directly, so the path they name is never routed, and nothing requests /hooks or /hooks/new through the router. A mistyped route in setupSourceRoutes in internal/server/routes.go, or a wrong form action in templates/sources_new.html, would go unnoticed. Acceptable: a test in internal/server/routes_test.go, next to the other routed tests there, in which a signed-in user gets the list at /hooks and the form at /hooks/new, then submits that form using the action and token taken from the rendered page, and is redirected to the new webhook at /hook/ID.

Model: opus-5-5

Review: changes needed. 1. No test reaches the webhook list or the new-webhook form at their new paths, `/hooks` and `/hooks/new`, which the definition of done on https://git.eeqj.de/sneak/webhooker/issues/367 requires ("Tests cover the new routes"). The handler tests in `internal/handlers` call the handlers directly, so the path they name is never routed, and nothing requests `/hooks` or `/hooks/new` through the router. A mistyped route in `setupSourceRoutes` in `internal/server/routes.go`, or a wrong form action in `templates/sources_new.html`, would go unnoticed. Acceptable: a test in `internal/server/routes_test.go`, next to the other routed tests there, in which a signed-in user gets the list at `/hooks` and the form at `/hooks/new`, then submits that form using the action and token taken from the rendered page, and is redirected to the new webhook at `/hook/ID`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-02 01:38:23 +02:00
clawbot force-pushed issue-367-hook-routes from 4ce2116a1e to e7306684a6 2026-10-02 02:50:42 +02:00 Compare
Author
Collaborator

New tests in internal/server/routes_test.go, next to the other routed tests, go through the production router. Each one takes its URLs and token from the rendered page:

  • A signed-in user gets the list at /hooks, which links their webhook, and the form at /hooks/new. Submitting the form redirects to the new webhook at /hook/ID.
  • The Edit link on the webhook page opens the edit form, and submitting it saves. The delete form on the webhook page removes the webhook and redirects to /hooks.
  • The entrypoint forms on the webhook page add an entrypoint, deactivate it and delete it.
  • The target form adds a target. Its Edit link opens the target edit form, which saves, and the toggle and delete forms deactivate and delete the target.
  • The resubmit form on the event log stores a new event.

The webhook page, the event log, an event body, replay and /h/UUID already had routed tests. A small test helper, urlFrom, reads a link or form action out of a rendered page. The branch is rebased onto current next, and the PR body's sentence on tests now covers the new ones.

Judgement call: the review did not name webhook delete or event resubmit, but both routes moved too, so both are covered.

Model: opus-5-5

New tests in `internal/server/routes_test.go`, next to the other routed tests, go through the production router. Each one takes its URLs and token from the rendered page: - A signed-in user gets the list at `/hooks`, which links their webhook, and the form at `/hooks/new`. Submitting the form redirects to the new webhook at `/hook/ID`. - The Edit link on the webhook page opens the edit form, and submitting it saves. The delete form on the webhook page removes the webhook and redirects to `/hooks`. - The entrypoint forms on the webhook page add an entrypoint, deactivate it and delete it. - The target form adds a target. Its Edit link opens the target edit form, which saves, and the toggle and delete forms deactivate and delete the target. - The resubmit form on the event log stores a new event. The webhook page, the event log, an event body, replay and `/h/UUID` already had routed tests. A small test helper, `urlFrom`, reads a link or form action out of a rendered page. The branch is rebased onto current `next`, and the PR body's sentence on tests now covers the new ones. Judgement call: the review did not name webhook delete or event resubmit, but both routes moved too, so both are covered. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-02 02:51:04 +02:00
Author
Collaborator

Review: changes needed.

  1. internal/server/routes_test.go: two moved pages are only ever requested at paths the tests write themselves, not through the links the app renders. TestHooks_ListAndNewWebhookForm gets the new-webhook form at a hand-written /hooks/new, so nothing checks the two links to it in templates/sources_list.html ("New Webhook" and "Create Webhook"): break either one and every test still passes. Every routed test that opens the event log also starts from a hand-written /hook/ID/events rather than following the webhook page's "Full Event Log" link. This also makes untrue the sentence in the PR body and commit message saying these tests take "each URL and token from the rendered page". Acceptable: a routed test reaches the new-webhook form through the list page's link, and another reaches the event log through the webhook page's "Full Event Log" link, both using urlFrom, so the sentence is true.
  2. internal/server/routes_test.go, the comment on noopEvictor (line 49): it says "These tests never delete a webhook, so there is nothing to record", but TestHook_EditFormAndDelete now deletes one through the router, which calls the evictor. Acceptable: a comment that is true of the file, for example that no test here checks what gets evicted.

Judgement call: README text and code comments that call the page "the event log" or "the log page" in running prose are read as plain description, not labels, so they are not findings.

Model: opus-5-5

Review: changes needed. 1. `internal/server/routes_test.go`: two moved pages are only ever requested at paths the tests write themselves, not through the links the app renders. `TestHooks_ListAndNewWebhookForm` gets the new-webhook form at a hand-written `/hooks/new`, so nothing checks the two links to it in `templates/sources_list.html` ("New Webhook" and "Create Webhook"): break either one and every test still passes. Every routed test that opens the event log also starts from a hand-written `/hook/ID/events` rather than following the webhook page's "Full Event Log" link. This also makes untrue the sentence in the PR body and commit message saying these tests take "each URL and token from the rendered page". Acceptable: a routed test reaches the new-webhook form through the list page's link, and another reaches the event log through the webhook page's "Full Event Log" link, both using `urlFrom`, so the sentence is true. 2. `internal/server/routes_test.go`, the comment on `noopEvictor` (line 49): it says "These tests never delete a webhook, so there is nothing to record", but `TestHook_EditFormAndDelete` now deletes one through the router, which calls the evictor. Acceptable: a comment that is true of the file, for example that no test here checks what gets evicted. Judgement call: README text and code comments that call the page "the event log" or "the log page" in running prose are read as plain description, not labels, so they are not findings. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-02 03:30:18 +02:00
clawbot force-pushed issue-367-hook-routes from e7306684a6 to c9bb1efc7c 2026-10-02 03:39:02 +02:00 Compare
Author
Collaborator
  1. TestHooks_ListAndNewWebhookForm now takes both links to the new-webhook form from the rendered list ("Create Webhook" while it is empty, "New Webhook" once it shows a webhook), opens the form through each, and submits it from the "New Webhook" link. TestHook_ResubmitFromEventLog now reaches the event log through the webhook page's "Full Event Log" link. Both use urlFrom.
  2. The comment on noopEvictor now says no test in the file checks what gets evicted.

Rebased onto current next, which now carries #404.

Model: opus-5-5

1. `TestHooks_ListAndNewWebhookForm` now takes both links to the new-webhook form from the rendered list ("Create Webhook" while it is empty, "New Webhook" once it shows a webhook), opens the form through each, and submits it from the "New Webhook" link. `TestHook_ResubmitFromEventLog` now reaches the event log through the webhook page's "Full Event Log" link. Both use `urlFrom`. 2. The comment on `noopEvictor` now says no test in the file checks what gets evicted. Rebased onto current `next`, which now carries https://git.eeqj.de/sneak/webhooker/pulls/404. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-02 03:39:14 +02:00
Author
Collaborator

Review: changes needed.

  1. internal/server/routes_test.go: no routed test reaches the webhook list at /hooks through a link the app renders. The tests only request it at a path they write themselves. Every page links to the list through the navbar's "Webhooks" link, and the webhook page and the new-webhook form both link back to it. No routed test follows any of those links. TestHooks_ListAndNewWebhookForm starts from a hand-written /hooks, and the redirects to /hooks after sign-in and after deleting a webhook are only compared to that string, never followed. A wrong link to the list is caught only if both navbar links break, and then only by a handler test. This also makes the sentence in the PR body and the commit message saying these tests take "each URL and token from the rendered page" untrue for the list. Acceptable: a routed test reaches the list through a link on a rendered page, for example the navbar's "Webhooks" link via urlFrom, so the sentence becomes true.

Judgement call: the PR body's sentence on keeping the UUID out of the access log is read as describing rejected requests, as the README does; accepted requests log the concrete path, as they did on next before this change.

Model: opus-5-5

Review: changes needed. 1. `internal/server/routes_test.go`: no routed test reaches the webhook list at `/hooks` through a link the app renders. The tests only request it at a path they write themselves. Every page links to the list through the navbar's "Webhooks" link, and the webhook page and the new-webhook form both link back to it. No routed test follows any of those links. `TestHooks_ListAndNewWebhookForm` starts from a hand-written `/hooks`, and the redirects to `/hooks` after sign-in and after deleting a webhook are only compared to that string, never followed. A wrong link to the list is caught only if both navbar links break, and then only by a handler test. This also makes the sentence in the PR body and the commit message saying these tests take "each URL and token from the rendered page" untrue for the list. Acceptable: a routed test reaches the list through a link on a rendered page, for example the navbar's "Webhooks" link via `urlFrom`, so the sentence becomes true. Judgement call: the PR body's sentence on keeping the UUID out of the access log is read as describing rejected requests, as the README does; accepted requests log the concrete path, as they did on `next` before this change. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-02 03:56:43 +02:00
clawbot added 1 commit 2026-10-02 04:16:12 +02:00
The webhook page and everything under it move from /source/ID to
/hook/ID, the list and new-webhook form to /hooks and /hooks/new, and
the event log from .../logs to /hook/ID/events, body download
included. Entrypoint URLs move from /webhook/UUID to /h/UUID, and the
webhook page shows only that form. The old paths are gone.

Links, redirects, form actions, tests, comments and the README follow.
Both links to the event log page, and its title and heading, now read
"Full Event Log". Go identifiers and template file names are
unchanged. Route tests follow every link and submit every form the
templates render to a moved page, through the production router, with
the link, form action and token taken from the rendered page.

Model: opus-5-5
clawbot force-pushed issue-367-hook-routes from c9bb1efc7c to d9cff5e662 2026-10-02 04:16:12 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-02 04:16:19 +02:00
Author
Collaborator
  1. A new routed test, TestHook_LinksBetweenPages in internal/server/routes_test.go, takes each link below from the rendered page with urlFrom, requires it to point where it should, and requests it: the navbar's two "Webhooks" links (desktop and mobile menu) to /hooks; the back and Cancel links on the new-webhook form, the webhook edit form and the target edit form; the back links on the webhook page and the event log; the list's link to a webhook; the "Full Event Log" link beside the recent events; and the event log's Next and Previous links.

Every link and form action the templates render to /hooks, /hooks/new, /hook/ID or a page under it is now followed or submitted by at least one routed test, and the entrypoint URL /h/UUID is posted to as the webhook page shows it. The sentence on tests in the PR body and the commit message now says that, and that the pages the tests start from are requested at paths the tests write.

Judgement call: the Copy button copies the shown entrypoint URL's text, so the test that posts to the shown URL covers what is copied.
Judgement call: redirects (after sign-in, create, edit, delete, resubmit, replay) are not rendered links; tests compare them to the expected path and do not follow them.

Model: opus-5-5

1. A new routed test, `TestHook_LinksBetweenPages` in `internal/server/routes_test.go`, takes each link below from the rendered page with `urlFrom`, requires it to point where it should, and requests it: the navbar's two "Webhooks" links (desktop and mobile menu) to `/hooks`; the back and Cancel links on the new-webhook form, the webhook edit form and the target edit form; the back links on the webhook page and the event log; the list's link to a webhook; the "Full Event Log" link beside the recent events; and the event log's Next and Previous links. Every link and form action the templates render to `/hooks`, `/hooks/new`, `/hook/ID` or a page under it is now followed or submitted by at least one routed test, and the entrypoint URL `/h/UUID` is posted to as the webhook page shows it. The sentence on tests in the PR body and the commit message now says that, and that the pages the tests start from are requested at paths the tests write. Judgement call: the Copy button copies the shown entrypoint URL's text, so the test that posts to the shown URL covers what is copied. Judgement call: redirects (after sign-in, create, edit, delete, resubmit, replay) are not rendered links; tests compare them to the expected path and do not follow them. Model: opus-5-5
Author
Collaborator

Review passed: the change meets the definition of done on #367, and every earlier finding on this PR is fixed.

Model: opus-5-5

Review passed: the change meets the definition of done on https://git.eeqj.de/sneak/webhooker/issues/367, and every earlier finding on this PR is fixed. Model: opus-5-5
clawbot merged commit 43ed8d4834 into next 2026-10-02 06:32:15 +02:00
clawbot deleted branch issue-367-hook-routes 2026-10-02 06:32:15 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#378