feat(webhook): linear cascade rebase via dependency markers (B13) #438
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!438
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/429"
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?
PRs can opt out of the O(N²) post-merge fan-out by declaring
Stacked on #MorDepends on #Min the body — only the named parent's merge or re-push triggers a rebase. Marker-less PRs keep the legacymergeable: falsecascade. Cycles are rejected with a one-line comment; cross-repo refs are silently dropped.Closes #429
Test plan
just qaclean (typecheck + Biome + 2056 server tests)#1→ only#2rebases (#3stays)#2synchronize →#3rebasesA → B → A→ comment posted, edges intactCI green. All five AC blocks verified.
Parser —
parseP rDependenciescorrectly handles both phrasings, comma-list continuation, case-insensitivity, cross-repo drop, and\bword-boundary guards. Dedupes + sorts on return. Fires onopened/reopened/editedinwebhook.ts(rawpayload.action, correct rationale in the comment).DB —
pr_dependenciesschema,setPrDependencies(atomic delete+insert transaction),getPrDependencies,getPrsDependingOn,hasPrDependencies,clearPrDependencies,listPrDependenciesall look correct. Transaction ensures no half-stale edge sets.Dispatch — Three-way routing in
handlePostMergeRebaseis correct: named-parent → unconditional dispatch; named-different-parent → skip; no marker → legacymergeablefan-out.handleStackedRebaseCascadecorrectly fires onsynchronizedand propagates one level (recursive propagation happens naturally as each child's rebase push triggers anothersynchronized).Cycle detection — DFS from
prNumberwith replacement semantics (prior edges fromprNumberexcluded before walk). Self-loop, A→B→A, and longer cycles all tested. Comment body matches AC verbatim.Closed-PR cleanup —
handlePullRequestClosedclears outgoing edges; incoming refs (other PRs depending on the closed one) are intentionally left — correct and documented.Tests — All four AC-mandated unit tests are present and pass: linear chain with only #2 rebasing, stacked-rebase propagation on
synchronized, cycle rejection + comment, marker-less fan-out preserved.Nit (not blocking):
handlePostMergeRebasecallsforge.getPullRequestfor every open PR before checking the marker early-exit at line 880. MovinggetPrDependencies+ the skip guard to before thedetailfetch would eliminate the wasted API call for marker-bound PRs that point elsewhere — e.g. in a 10-PR linear chain merging #1, PRs #3-10 each incur agetPullRequestcall before being skipped. Pre-existing O(N) pattern rather than a B13 regression, so not blocking, but worth a follow-up.189d51825ec5e8ac30c7