fix: dev-poll should abandon stale branches that are behind main #148
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#148
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?
Problem
When dev-poll finds an existing branch/PR for an issue, it enters recovery mode and pushes on top of the existing code. If main has moved ahead (dependency landed, other fixes merged), the branch is stale and misses the new code. CI failures repeat because the fix is on main but not on the branch.
This caused #143 to fail repeatedly: PR 144 was created before #145 (env_file fix) merged. Recovery mode kept pushing on the stale branch.
Fix
In
dev/dev-poll.sh, before entering recovery mode, check if the existing branch is behind main. If main has commits the branch does not have, close the stale PR, delete the branch, and let the agent start fresh from current main.Check: count commits on main that are not on the branch. If count > 0, the branch is stale.
This goes in the recovery mode section, after the existing branch/PR is found but before the agent is spawned.
Affected files
dev/dev-poll.sh(recovery mode section)Acceptance criteria