Repository navigation
Conversation
--json with a pull number treated any JSON message field as "pull request not found". A rate-limit or authentication response then hid a pull request that exists. HTTP 404 is the not-found case. Any other non-200 status is a fetch failure. Tests cover 404, a 403 rate-limit body, a normal 200, and a 200 body that also contains a message field.
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
--jsonwith a pull number no longer treats every GitHubmessagefield as a missing pull request.Problem
The pull-request fetch ignored the HTTP status. Any JSON object with a
messagekey exited as "Pull request #N not found." GitHub uses that field for rate limits and authentication failures, so a pull request that exists was reported as missing.Change
pull_request_manifest_url()insherlock_project/sherlock.pyuses the status code. HTTP 404 is not found. Any other non-200 is a fetch failure, and the printed error includes GitHub's message. A 200 response still returns the rawdata.jsonURL fromhead.sha, including when the body also has amessagefield.Validation
tests/test_pull_request_manifest.pyfailed on the old check: a 403 rate-limit body and a 200 body that containedmessagewere both treated as missing. After the change those four tests pass.