fix: pr-lifecycle gives up on merge conflict (HTTP 405) instead of delegating rebase to agent #314
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#314
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
In lib/pr-lifecycle.sh lines 477-479, when pr_merge returns exit code 2 (HTTP 405 from Forgejo, meaning merge conflict), the walk sets merge_blocked and returns immediately:
The rebase logic at lines 481-488 (which resumes the agent session and asks it to rebase + force-push) only runs for exit code 1 (other merge failures). HTTP 405 is exactly the case where a rebase is needed — the PR has conflicts with main.
Observed: PR #307 was approved with green CI but had conflicts from PRs that merged after it was created. The agent gave up with merge_blocked instead of rebasing.
Fix
Remove the early return for rc=2. Let it fall through to the rebase logic:
Affected files
Acceptance criteria