Port PR-closed cleanup chain to pr-closed.yml flow #1093
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#1093
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
As an operator, I want PR-closed cleanup (branch cleanup, dependency row drop,
pr.mergedtrigger publication) to live in a YAML flow, so that the imperativehandlePullRequestClosedcall inwebhook.ts:334can be deleted and PR-close side effects become reviewable as a flow.Context
apps/server/src/http/webhook.ts:333-335still callshandlePullRequestCloseddirectly because the YAML port doesn't cover all three side effects:cleanupBranch— agent worktree + remote branch deletion)pr_dependenciesrow drop (DB cleanup for dependency graph)pr.mergedinternal trigger publication (drivespr-merged.ymlrebase cascade)flows/defaults/pr-merged.ymlalready covers the cascade fan-out, but only fires AFTER step 3 publishes the trigger. Steps 1 + 2 have no YAML coverage.Acceptance criteria
Ops
cleanup_branchop — wrapscleanupBranch; inputsrepo, branch_refdrop_pr_dependenciesop — wraps DB cleanup helper; inputsrepo, pr_numberpublish_pr_mergedop — wrapstriggerBus.publish({kind:"pr",action:"merged",...}); inputsrepo, pr_number; only fires whenevent.pr.merged === trueFlow
flows/defaults/pr-closed.ymlonpull_request: [closed]:cleanup_branchdrop_pr_dependenciespublish_pr_merged(gated byif: event.pr.merged)Tests
pr-closed.yml(merged vs not-merged paths — verifypr.mergedonly publishes on merged PR)pr-merged.ymlstill fires after the switch (regression test for the cascade)Cleanup
handlePullRequestClosedcall fromwebhook.ts:333-335handlePullRequestClosedfromevent-handlers.tsOut of scope
legacy*executor hooks — separate ticketReferences
apps/server/src/http/webhook.ts:326-335(imperative call comment)apps/server/src/domain/workflow/event-handlers.ts:680(handlePullRequestClosedimpl)flows/defaults/pr-merged.yml(existing cascade flow that depends on the internal trigger)