Repository navigation
fix(j5): Crew archive removes worktrees whose PR was squash-merged - #1133
Merged
Merged
Conversation
A squash merge was recognised only through the host's pull request lookup, which finds nothing in a fork checkout whose GitHub resolution picks the upstream remote. The archive now also counts a worktree as merged when merging its HEAD into the fetched default branch changes nothing, so a builder on the merged head and a tester detached at it both go. Fixes #1103 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 17 minutes for your next included review. View limit details
|
… branch or tag holds A clean, no-op merge into the default branch does not prove that removing the worktree loses nothing: a merge=ours driver, an edit and its revert, or an empty commit all pass. The content check now removes a worktree only while a branch or tag holds its HEAD; a detached commit nothing holds is kept as unverified. Git's stderr is logged at debug when merge-tree or rev-parse refuses to run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed commit A symbolic tag can point into the worktree's own refs (refs/worktree/*), which go with the worktree. Count only direct refs as holders, so removing the worktree can never leave its commit unreachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Review outcome:
Merging once CI is green. — J5 Code Director (Claude Opus 5.5) |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Archiving a Crew right after its PR was squash-merged kept the builder's worktree as
unmerged_commitsand the tester's asunverified. That filed an Owner Inbox cleanup item for work that was already merged. Fixes #1103.The issue guessed the PR status was stale. It wasn't.
mergeKeepReasonrecognised a squash merge only throughGitManager.branchPullRequest, and that lookup returns null for J5 branches in this checkout. Upstream's GitHub repository resolution follows gh's priority (upstream, thengithub, thenorigin). With nogh repo set-default, it queriespingdotgg/t3code, which has no PR forj5code/design-*. Every stored cleanup entry in the live database haspullRequestUrl: null, including #1099, #1101 and #1112. The tester failed for a second reason: its PR lookup is for its own branch, which has no PR, and that branch doesn't hold its detached HEAD.What changed
In
CrewWorktrees.mergeKeepReason, when HEAD is not an ancestor of the fetched default branch, the check now asksgit merge-tree --write-tree <default> HEAD. If merging HEAD in yields exactly the default branch's tree, the work is already there and the worktree counts as merged. The check uses git alone, so it doesn't depend on the host, and it covers a builder on the merged head and a tester detached at it. The existing pull request path stays as a fallback.The check still keeps a worktree whenever there's doubt:
The same check feeds the archive estimate, so the archive confirmation shows the same verdicts.
The Crews definition's AC19 now says "commit or content".
Live testing
No live server run: the change is a server-only git check with no UI of its own. Runtime confirmation against real refs in this repository:
GH_REPOunset (as on the live server), the resolver pickspingdotgg/t3codefor this checkout.111dcea984and feat(mobile): J5's rows above the composer become one attention carousel #1112's head16eb00a85bagainst today'sorigin/j5/main.120efb5ebfagainstj5/mainat its merge commit, which is what the archive saw a minute after the merge. Against today'sj5/mainit says not merged, because later commits touched the same lines, so the worktree is kept.Checklist
CrewWorktrees.test.tscovers a squash-merged builder, a tester detached at its commit, and a seat with a commit beyond it, with no PR found. It failed onj5/mainwithkept unmerged_commits/kept unverified.docs/j5/product/features/crews.mdAC19 rewrittenClaude Opus 5.5 in Claude Code (J5 Code).
🤖 Generated with Claude Code