Skip to content

Fix merge-result handling for post-approval automation#13

Merged
vkehfdl1 merged 1 commit intomainfrom
fix/merge-result-resolver
Mar 28, 2026
Merged

Fix merge-result handling for post-approval automation#13
vkehfdl1 merged 1 commit intomainfrom
fix/merge-result-resolver

Conversation

@vkehfdl1
Copy link
Copy Markdown
Contributor

Summary

  • separate PR merge success detection from post-merge branch deletion
  • treat any failed merge API outcome, including merged=false, as resolver-worthy
  • add regression coverage for merge API failures and branch-delete-after-merge failures

Verification

  • uv run pytest -q tests/test_github.py
  • uv run pytest -q
  • uv run ruff check
  • uv run ty check

The merge wrapper now decides success from the merge result itself, then performs branch deletion as a separate best-effort step. This preserves the resolver OMX path when GitHub or PyGithub report merge failures via exceptions or merged=false, while avoiding false conflict handling when only branch cleanup fails.

Constraint: Final-verdict automation must keep queueing merge_conflict_resolution jobs without confusing post-merge branch deletion failures for merge conflicts
Rejected: Keep delete_branch=True inside the merge call | mixes merge failure with branch cleanup failure and hides the real outcome
Rejected: Restrict resolver retries to 405/409 only | misses real merge-endpoint failures surfaced under other GitHub status codes
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep merge success evaluation separate from branch cleanup, and treat any failed merge API outcome as resolver-worthy unless a stronger non-conflict taxonomy is added later
Tested: uv run pytest -q tests/test_github.py; uv run pytest -q; uv run ruff check; uv run ty check
Not-tested: Live GitHub merge API failure against a real conflicted PR in production
@vkehfdl1 vkehfdl1 merged commit 2bbf7bd into main Mar 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant