Repository navigation
Handle malformed GitHub PR merge failure bodies - #1118
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This branch was successfully deployed
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.
A rejected GitHub PR merge can return HTML, plain text, empty content or unusable JSON. The existing helper parses every failed response as JSON, so these responses can crash failure handling instead of producing a clear error.
This guards only failed-response parsing/message selection. A nonblank GitHub string message is preserved exactly; other successfully read bodies return
GitHub merge failed (HTTP <status>). Network and body-read exceptions still propagate. The endpoint, token forwarding, PUT/squash request, single-request behavior and success path are unchanged. No retry, reconciliation, permission or merge-policy change is included.The real action handler's mocked HTML-failure case confirms it reports failure without changing PR state or calling the success handler. This is the previously accepted three-file repair, composed unchanged on actual post-1117 main
0529215aa7692d6162950ae837b34a64c8e69840; relevant coding-agent source and dependency manifests have no drift from its original base.Validation at
0aae7bb87e1790fc70e4b8d82c014f317877e1cc:Refs recoupable/mono#358, recoupable/mono#318. Coordinator alone merges after exact-head checks and acceptance.
Summary by cubic
Fixes GitHub merge failure handling so a rejected PR merge returning HTML, plain text, an empty body, or malformed JSON reports a clear error instead of crashing failure reporting, since failed responses were previously parsed as JSON unconditionally. This addresses the reproduced Mono #358/#318 finding about unguarded JSON parsing.
Bug Fixes
mergeGithubPRpreserves exact nonblank GitHubmessagestrings; other readable bodies fall back toGitHub merge failed (HTTP <status>).Written for commit 0aae7bb. Summary will update on new commits.