Skip to content

fix(forge): retry 5xx server errors at the HTTP client level - #24

Closed
guyoron1 wants to merge 17 commits into
mainfrom
fix/retry-5xx-in-do
Closed

fix(forge): retry 5xx server errors at the HTTP client level#24
guyoron1 wants to merge 17 commits into
mainfrom
fix/retry-5xx-in-do

Conversation

@guyoron1

Copy link
Copy Markdown
Owner

Upstream PR

Mirror of fullsend-ai/fullsend#2342 by @ralphbean

Summary

  • Moves 5xx (500-504) retry handling from retryOnTransient down into isRetryable in do(), so all GitHub API calls automatically retry on transient server errors
  • Renames retryOnTransientretryOnRepoRace and narrows isTransientStatus to only 404/409, reflecting its actual purpose (repo init races and branch ref conflicts)
  • Fixes a 502 Bad Gateway failure seen in production

QF Demo Value

Why this is a great QF target:

  • Retry logic with multiple edge cases (status codes, backoff timing, max retries)
  • Already has github_test.go — QF can identify untested paths
  • Error boundary changes affect all GitHub API calls — high blast radius needs thorough coverage

Mirrored for QualityFlow integration demo — trigger with /fs-qf

Move 5xx retry handling from the higher-level retryOnTransient wrapper
(now renamed retryOnRepoRace) down into isRetryable, which is used by
do(). This ensures all GitHub API calls automatically retry on transient
server errors (500-504), not just the handful of call sites that were
wrapped in retryOnTransient.

This fixes a 502 Bad Gateway failure in post-review's
GetPullRequestHeadSHA, which had no retry coverage because it called
get() directly.

Rename retryOnTransient to retryOnRepoRace and narrow isTransientStatus
to only cover 404 (async repo init) and 409 (branch ref conflict), which
are the race conditions that wrapper actually exists for.

Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com>
Signed-off-by: Ralph Bean <rbean@redhat.com>
@guyoron1

Copy link
Copy Markdown
Owner Author

/fs-qf

QualityFlow and others added 8 commits June 17, 2026 12:58
Verdict: APPROVED_WITH_FINDINGS (89/100)
- 0 critical, 3 major, 4 minor findings
- Key findings: metadata type mislabel, missing requirement IDs, epic tracking field mismatch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces intermediate pipeline artifacts with organized test files.

Total: 8 test files → qf-tests/GH-24/
Jira: GH-24
[skip ci]
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

QualityFlow Pipeline Summary

Stage Agent Status
1 STP Builder
2 STP Reviewer
3 STP Refiner
4 STD Builder
5 STD Reviewer
6 STD Refiner
7 Test Generator

Test Output

Language Count Location
Go 8 files qf-tests/GH-24/go/

Issue: GH-24


Generated by QualityFlow

@guyoron1

Copy link
Copy Markdown
Owner Author

/fs-qf

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:39 PM UTC · Completed 3:53 PM UTC
Commit: bb5c185 · View workflow run →

Verdict: APPROVED_WITH_FINDINGS (84/100)
- 0 critical, 5 major, 4 minor findings
- Key findings: metadata type mislabel, missing requirement IDs, Go version mismatch, requirement summary format, QE kickoff timing
@fullsend-ai-review

fullsend-ai-review Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review

Reason: stale-head

The review agent reviewed commit 0dffaf5dfe305b8b9487909c313b0919b399af89 but the PR HEAD is now b529b2fefe5aa27cb1508ef317d3ab98a0e187e6. This review was discarded to avoid approving unreviewed code.

Previous run

Review

Reason: stale-head

The review agent reviewed commit a41e45570434e9a77298af0ee667ee7bc2f83bf4 but the PR HEAD is now 92977564ede611b597e4ffaa0af4e1ffcb81d7d7. This review was discarded to avoid approving unreviewed code.

@fullsend-ai-review

Copy link
Copy Markdown

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:56 PM UTC · Completed 4:08 PM UTC
Commit: bb5c185 · View workflow run →

QualityFlow and others added 2 commits June 18, 2026 15:58
Generated Software Test Description (STD) with 34 test scenarios
covering retry 5xx server errors at the HTTP client level.

- STD YAML: comprehensive test description with all scenarios
- Go stubs: 8 test files with 34 PendingIt blocks (Phase 1 design stubs)
- Coverage: 15 P0 + 19 P1 scenarios across 8 requirement groups

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fullsend-ai-review

Copy link
Copy Markdown

/fs-review

QualityFlow and others added 3 commits June 18, 2026 16:17
Generated 34 Go test implementations from STD YAML covering:
- isRetryable 5xx status code validation (scenarios 1-7)
- do() retry behavior and context cancellation (scenarios 8-12)
- Double-retry prevention (scenarios 13-15)
- retryOnRepoRace scoping (scenarios 16-20)
- isTransientStatus boundary tests (scenarios 21-23)
- Error message format validation (scenarios 24-26)
- File operation integration tests (scenarios 27-30)
- Rate limit regression tests (scenarios 31-34)

All tests verified to compile and pass against source.
Replaces intermediate pipeline artifacts with organized test files.

Total: 8 test files → qf-tests/GH-24/
Jira: GH-24
[skip ci]
@guyoron1

Copy link
Copy Markdown
Owner Author

Closing — replacing with fresh upstream PR mirror for QF demo

@guyoron1 guyoron1 closed this Jun 19, 2026
@github-actions
github-actions Bot deleted the fix/retry-5xx-in-do branch July 19, 2026 05:45
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.

2 participants