Fix merge-result handling for post-approval automation#13
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
merged=false, as resolver-worthyVerification
uv run pytest -q tests/test_github.pyuv run pytest -quv run ruff checkuv run ty check