You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Re-Read a Deleted Ref Before Reporting DELETE_NOT_CONFIRMED in pr_cleanup #3436
cleanup_remote_delete in scripts/pr_cleanup.py reads the ref back once, immediately after the deleteRef mutation returns. GitHub's GraphQL ref read can lag the delete by a moment, so a delete that landed can still read at its old tip. The run then prints status=DELETE_NOT_CONFIRMED <branch> on <repo> still reads at <sha> after the delete and exits 2 before the local half runs, leaving the worktree and the local branch in place.
Observed shape (constructed)
pr_review.py cleanup <n> --repo OWNER/NAME --checkout <base-clone> on a merged pull request prints response: {"deleteRef": {"clientMutationId": null}}, then status=DELETE_NOT_CONFIRMED ... still reads at <tip>, and exits 2.
A REST read seconds later, gh api repos/OWNER/NAME/git/ref/heads/<branch>, returns 404.
Rerunning the same cleanup treats the branch as already gone, removes the worktree and the local branch, and exits 0.
What fixing it needs
A bounded re-read, a few attempts over a few seconds, before a still-present ref is reported. The exit stays 2 once the bound is spent, so a delete that truly did not land is still reported rather than assumed. A test drives the reader returning the old tip once and then nothing, and expects DELETED and exit 0.
Activity
Re-Read a Deleted Ref Before Reporting DELETE_NOT_CONFIRMED (#3480)