FORGE-92: close changesets when a Forgejo branch is deleted #743
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!743
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "FORGE-92-forgejo-branch-delete"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Kanbanger: FORGE-92 (parent FORGE-78). Delivery target: production.
Problem
Forgejo reports a deleted branch with a
deletewebhook and sends nopush. ForgeGraph's per-repo hooks never subscribed todelete, so the push pipeline's close-on-delete path never ran for Forgejo. A deleted branch's changeset stayed open and kept ci_failed alerts firing. Found during FORGE-78 verification: probe changesetbdf391e1is still open.Change
x-gitea-event: deletewithref_type=branchbecomes the same zero-SHAPushEventthe source-neutral pipeline already closes changesets for (forgejoDeleteEvent+handleDelete). Tag deletions are acknowledged and ignored.ensureForgejoWebhooksubscribes new hooks todelete. An existing ForgeGraph hook that lacks it is PATCHed to add it; its other events, URL and signing secret are kept, and the result isupdated: true.POST /api/fg/repos/:id/webhooknow reportsupdated, so it can backfill existing repos idempotently.Tests (local lanes green before push; CI is backed up)
delete.test.ts: normalization, closing the active changeset with a Kanbangerchangeset.closedevent, tags ignored, malformed payload gets 400.route.test.ts:deleteevents are dispatched to the delete handler.forgejo-webhook-events.test.ts: create includesdelete; patch adds onlydeleteand leaves the URL and secret alone; no-op when already present; failures reported.After deploy
POST /api/fg/repos/:id/webhookacross registered repos, and report the count.bdf391e1by replaying its branch delete through the pipeline.🤖 Generated with Claude Code
Preview environment is live: https://pr-743-forgegraph.forgegraf.com
Deployed
fffa4116with the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.fffa4116d8e66e3c78d1