feat(api): Forgejo API layer resilience — timeouts + retries + backoff + pagination #334

Closed
opened 2026-07-03 13:35:59 +02:00 by bosun · 1 comment
Owner

Finding

scripts/lib/forgejo-api.sh has no connection timeout, total timeout, retries, backoff, 429 handling, or 5xx retry.

Pagination-incomplete: open PR lookup (client-side filter, no paginate), rolling PR label discovery, tag listing (limit=50), stale cleanup (fixed limit).

Should-fix rationale

Fine on small repos; breaks on active OSS. v1.0.0 signals broad-adoption readiness.

Fix

  • api_call_with_retry wrapper (exponential backoff, honor Retry-After)
  • Connection + total timeouts on curl (5s connect, 30s total, env-tunable)
  • api_paginate helper for list endpoints
  • Retrofit list callers to use pagination
  • Test coverage via mock server

Anchor

External correctness cold-read (anonymous ChatGPT session, uploaded to operator 2026-07-03). Full review surfaced 10 findings across 5 blocking-v1.0.0 + 2 should-fix pre-v1.0.0 + 3 post-v1.0.0 backlog. This tracker addresses one of them.

SHOULD-FIX pre-v1.0.0.

## Finding `scripts/lib/forgejo-api.sh` has no connection timeout, total timeout, retries, backoff, 429 handling, or 5xx retry. Pagination-incomplete: open PR lookup (client-side filter, no paginate), rolling PR label discovery, tag listing (limit=50), stale cleanup (fixed limit). ## Should-fix rationale Fine on small repos; breaks on active OSS. v1.0.0 signals broad-adoption readiness. ## Fix - `api_call_with_retry` wrapper (exponential backoff, honor Retry-After) - Connection + total timeouts on curl (5s connect, 30s total, env-tunable) - `api_paginate` helper for list endpoints - Retrofit list callers to use pagination - Test coverage via mock server ## Anchor External correctness cold-read (anonymous ChatGPT session, uploaded to operator 2026-07-03). Full review surfaced 10 findings across 5 blocking-v1.0.0 + 2 should-fix pre-v1.0.0 + 3 post-v1.0.0 backlog. This tracker addresses one of them. SHOULD-FIX pre-v1.0.0.
Author
Owner

Re-elevated to v1.0.0 must-fix per operator 2026-07-05 (post-round-4 sprint state review, decision-option (b)). Round-2 body already said SHOULD-FIX pre-v1.0.0; operator elected to honor that rather than defer to v1.1.0.

Substantive scope per original body: api_call_with_retry wrapper (exponential backoff, honor Retry-After) + connection + total timeouts on curl (5s connect, 30s total, env-tunable) + api_paginate helper for list endpoints + retrofit list callers + test coverage via mock server.

Land after v0.26.0 cut (in flight) so bisectable, before v1.0.0 cut.

Re-elevated to v1.0.0 must-fix per operator 2026-07-05 (post-round-4 sprint state review, decision-option (b)). Round-2 body already said SHOULD-FIX pre-v1.0.0; operator elected to honor that rather than defer to v1.1.0. Substantive scope per original body: api_call_with_retry wrapper (exponential backoff, honor Retry-After) + connection + total timeouts on curl (5s connect, 30s total, env-tunable) + api_paginate helper for list endpoints + retrofit list callers + test coverage via mock server. Land after v0.26.0 cut (in flight) so bisectable, before v1.0.0 cut.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#334
No description provided.