Remove the webhook action probe artifact #17

Merged
arne merged 1 commit from chore/remove-probe-artifact into main 2026-04-05 22:25:15 +02:00
Owner

While finishing up PR #15 (the merge-history-on-edit bug fix) a follow-up question came up: what action string does Forgejo actually fire for a merge webhook? The test in PR #15 assumes "closed", matching GitHub convention, but the only way to be confident was to observe it directly.

To observe it, a throwaway PR #16 with an empty .webhook-probe file was opened and merged. The DEBUG log added temporarily to handlePREvent confirmed Forgejo fires action="closed" merged=true on merge — so the guard in PR #15 is correct. But merging #16 landed the empty .webhook-probe file on main as a side effect.

This PR removes the file. One line of diff, no code changes, no test changes. The diagnostic logging was never committed.

Why PR #15's merge didn't create a history entry

Worth recording this since it explains a visible gap in orbit's history stage. PR #15 was merged at 20:18:16, and the deploy sequence that followed (go build && install && systemctl restart) restarted orbit's systemd service at 20:18:17 — almost exactly when Forgejo was trying to deliver the merge webhook. The delivery landed in the ~1-second restart window and was either refused by Caddy or silently dropped; Forgejo did not retry successfully.

The PR row for #15 exists in the pull_requests table because the periodic sync running on startup backfilled it from Forgejo's API. But the periodic sync only upserts PR rows — it does not create history entries. History entries are webhook-only, and the webhook was lost. The history entry for PR #15 will be inserted manually via SQL as part of this cleanup.

Lesson: avoid restarting orbit immediately after merging a PR that it webhooks into. Separate the operations by at least a few seconds so the webhook has time to land.

While finishing up PR #15 (the merge-history-on-edit bug fix) a follow-up question came up: what action string does Forgejo actually fire for a merge webhook? The test in PR #15 assumes `"closed"`, matching GitHub convention, but the only way to be confident was to observe it directly. To observe it, a throwaway PR #16 with an empty `.webhook-probe` file was opened and merged. The DEBUG log added temporarily to `handlePREvent` confirmed Forgejo fires `action="closed" merged=true` on merge — so the guard in PR #15 is correct. But merging #16 landed the empty `.webhook-probe` file on main as a side effect. This PR removes the file. One line of diff, no code changes, no test changes. The diagnostic logging was never committed. ## Why PR #15's merge didn't create a history entry Worth recording this since it explains a visible gap in orbit's history stage. PR #15 was merged at 20:18:16, and the deploy sequence that followed (`go build && install && systemctl restart`) restarted orbit's systemd service at 20:18:17 — almost exactly when Forgejo was trying to deliver the merge webhook. The delivery landed in the ~1-second restart window and was either refused by Caddy or silently dropped; Forgejo did not retry successfully. The PR row for #15 exists in the `pull_requests` table because the periodic sync running on startup backfilled it from Forgejo's API. But the periodic sync only upserts PR rows — it does not create history entries. History entries are webhook-only, and the webhook was lost. The history entry for PR #15 will be inserted manually via SQL as part of this cleanup. Lesson: avoid restarting orbit immediately after merging a PR that it webhooks into. Separate the operations by at least a few seconds so the webhook has time to land.
The empty .webhook-probe file was introduced by a throwaway PR (#16)
used to inspect what action string Forgejo fires on a merge webhook.
It confirmed that Forgejo uses action='closed' for merges — the same
guard the history-entry dispatch in PR #15 requires — but the file
itself is an artifact of the probe and should not live on main.
arne merged commit 0af3704657 into main 2026-04-05 22:25:15 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arne/orbit!17
No description provided.