-
Notifications
You must be signed in to change notification settings - Fork 124
fix: Prevent unnecessary retries when checking repository existence b… #1478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Prevent unnecessary retries when checking repository existence b… #1478
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 24s ⏱️ Results for commit 995f5cb. ♻️ This comment has been updated with latest results. |
…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)