Skip to content

Conversation

@AakashSuresh2003
Copy link
Contributor

…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)

  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)
  • New package licenses are added to ThirdPartyNotices.txt (if applicable)

…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)
Copilot AI review requested due to automatic review settings December 8, 2025 16:17
Copy link
Contributor

Copilot AI left a 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 GetNonSuccessAsync in GithubClient.cs to use HttpRetry with 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

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Unit Test Results

  1 files    1 suites   10m 24s ⏱️
964 tests 964 ✅ 0 💤 0 ❌
965 runs  965 ✅ 0 💤 0 ❌

Results for commit 995f5cb.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
ado2gh 72% 70% 712
Octoshift 83% 72% 1742
bbs2gh 83% 78% 663
gei 81% 72% 574
Summary 81% (7743 / 9609) 73% (1841 / 2523) 3691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant