fix(ploeg): fail a reviewer that cannot fetch the branch under review #158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ryangr0/ploeg-reviewer-fetch-failure"
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?
A reading Run treated every error fetching the Shift's branch as "no
branch under review yet" and reviewed the base branch instead. A network
outage, a 401 or a 5xx from the forge looked the same as a genuinely
absent branch, and the later pull request poll still linked the writer's
pull request, so an approval of the wrong checkout counted.
The worker now probes the branch with
git ls-remote --exit-code, whichseparates "the forge answered: no such branch" (exit 2) from every
transport or authentication failure, and bounds the probe and fetch with
a timeout. ploegd tells the worker whether the reader is pre-author: the
claim carries preAuthor when no writing Run precedes the reader's Round
in its Shift. Only a pre-author reader with a genuinely absent branch
reviews the base. A forge failure ends the Run failed/infra_node before
the harness starts; an absent branch after a writer ends it stuck. The
commit a reader checked out is recorded on its first checkpoint and on
the outcome's checkpoint (new optional
commitfield).ploegd now tells the worker (new claim field preAuthor) whether a reader comes before any writing Round; only then may it review the base. Uses git ls-remote --exit-code to tell an absent branch (exit 2) from an unreachable forge. Adds an optional commit field to the checkpoint contract for the reviewed SHA (audit only, no migration). Deploy ploegd and workers together: a new worker against an old ploegd treats every reader as post-writer. A failed reader is not retried yet; that is VIK-1304. Conflicts lightly with the VIK-1737 PR in worker.go; whichever merges second needs a rebase.
Verified with
mise run verifyon the pinned toolchain (all gates passed).Ticket: https://vikunja.webgrip.dev/tasks/1736
🤖 Generated with Claude Code