fix: Prevent unnecessary retries when checking repository existence b…#1478
fix: Prevent unnecessary retries when checking repository existence b…#1478AakashSuresh2003 wants to merge 5 commits intogithub:mainfrom
Conversation
…y updating GetNonSuccessAsync to retry only on transient 5xx errors, skip deterministic statuses (200/404/301/4xx), add full test coverage, and ensure DoesRepoExist makes a single API call for expected responses. (github#1447)
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where repository existence checks would retry unnecessarily on deterministic HTTP responses (200/404/301/4xx), causing delays during migrations. The fix updates GetNonSuccessAsync to use a selective retry strategy that only retries on transient server errors (5xx status codes) rather than retrying on all exceptions.
Key Changes
- Modified
GetNonSuccessAsyncinGithubClient.csto useHttpRetrywith a predicate that filters for 5xx errors only - Added comprehensive test coverage for expected status codes (404), unexpected success (200), server errors with retry (5xx), and redirect status (301)
- Updated release notes to describe the fix in user-friendly terms
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Octoshift/Services/GithubClient.cs | Replaced generic retry logic with selective HTTP retry that only retries on 5xx status codes, ensuring deterministic responses (200/404/301/4xx) return immediately |
| src/OctoshiftCLI.Tests/Octoshift/Services/GithubClientTests.cs | Added four new test cases covering expected status, unexpected success, server error retry behavior, and redirect handling; replaced old retry test with comprehensive coverage |
| RELEASENOTES.md | Added user-friendly description of the fix explaining improved behavior for repository existence checks |
Unit Test Results 1 files 1 suites 10m 25s ⏱️ Results for commit abd14ab. ♻️ This comment has been updated with latest results. |
|
closing in favor of #1487 |
|
@AakashSuresh2003 I am going to hold off on shipping this, I have some concerns with this failing fast for 429s and possible other non-5** that we should retry. |
…y updating GetNonSuccessAsync to retry only on transient 5xx errors, skip deterministic statuses (200/404/301/4xx), add full test coverage, and ensure DoesRepoExist makes a single API call for expected responses. (#1447)
ThirdPartyNotices.txt(if applicable)