fix(utils): retry GET on any non-success HEAD in async probe#189
Open
plusky wants to merge 1 commit into
Open
Conversation
check_repo_url_async only retried with GET when HEAD returned 405, so a repo whose server rejects HEAD with 400/401/403 (nginx limit_except, WAFs, S3/proxy layers) but serves GET 200 was reported dead, while the sync check_repo_url (a GET via urllib) reported it live. Broaden the fallback to retry GET on any non-success HEAD status, restoring backend parity. Tests: the GET-retry regression is a single parametrized test over 400/401/403/404/405/500 HEAD statuses; the suse-layout test now fails both HEAD and GET on the first suffix and asserts the probed URLs, so it again pins the layout fallback; the both-4xx test accounts for the extra GET probes.
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.
What
check_repo_url_asynconly retried with GET when HEAD returned exactly405, while the sync
check_repo_urlprobes with GET (via urllib) fromthe start. A repo whose server rejects HEAD with 400/401/403 (nginx
limit_except, WAFs, S3/proxy layers) but serves GET 200 was reporteddead by the async backend and live by the sync one. The async probe now
retries with GET on any non-success HEAD status, restoring backend
parity.
Verification
Full gate green (ruff format/check, ty, pytest: 552 passed, coverage
82.49%). The GET-retry regression is a single parametrized test over
400/401/403/404/405/500 HEAD statuses; the suse-layout fallback test
now fails both HEAD and GET on the first suffix and asserts the actual
probed URLs, so it genuinely pins the layout fallback again. Reviewed
by a fan-out adversarial code review; all confirmed findings addressed.
AI-assisted.