Skip to content

fix: BED-10372 bound collection retries and timeouts - #95

Merged
jaredcatkinson merged 2 commits into
mainfrom
fix/BED-10372-collection-retry-resilience
Oct 30, 2026
Merged

jaredcatkinson merged 2 commits into
mainfrom
fix/BED-10372-collection-retry-resilience

Conversation

@jaredcatkinson

@jaredcatkinson jaredcatkinson commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Transient GitHub server and network failures can leave collection silent for many minutes while requests retry. This change uses 10-second connection and 30-second read timeouts and caps transient failures at three attempts. Adaptive GraphQL pagination shares that budget across page sizes instead of restarting HTTP retries at each size.

Exhausted HTTP errors now reach the existing scope handlers so collection can continue rather than treating an error body as resource data. Existing rate-limit and GitHub App token-refresh retry behavior is preserved. Previously emitted records are retained; failed scopes can remain incomplete.

Workflow collection also skips dynamic/ paths and drops unavailable file results before job/step parsing, preventing cascading errors when file requests fail. Regression tests exercise successful and failed workflows through both child transformers.

Validation: all 424 tests pass on current upstream/main, including parallel organization/repository/environment continuation, partial pagination, GraphQL recovery and exhaustion, rate limits, token refresh, and enterprise credential exports. Ruff and diff checks pass.

Summary by CodeRabbit

  • Reliability
    • Collection requests use connection and read timeouts, with up to three attempts for temporary server errors, connection failures, and timeouts.
    • GraphQL pagination can retry with smaller page sizes after gateway errors, within the same three-attempt limit.
    • Rate-limit handling and GitHub App token refresh remain separate from the transient-failure retry limit.
  • Bug Fixes
    • When a collection request fails after retries, processing continues for unaffected scopes. Records already collected are retained, though a failed scope may be incomplete.
    • Workflows without supported file paths are skipped. Workflow-file fetch failures no longer prevent processing other workflows; missing or inaccessible files are logged.
  • Documentation
    • Added guidance on request timeouts, retries, and exceptions to the retry behavior.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 7d11b56c-7b4d-47c1-9c53-ef6991d0f4ce
Commits

Reviewing files that changed from the base of the PR and between 0c298ca and 6c08409.

Files selected for processing: 3
  • README.md
  • src/openhound_github/resources/organization.py
  • tests/test_workflow_resources.py
Files skipped from review as they are similar to previous changes: 1
  • README.md

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

The change adds bounded transient-failure retries and request timeouts to the GitHub HTTP session. GraphQL pagination shares its retry budget across page-size attempts. Workflow collection skips missing or dynamic paths and handles workflow-file retrieval failures.

Changes

GitHub collection reliability

Layer / File(s) Summary
HTTP retry session and collection outcomes
src/openhound_github/github_rest_client.py, src/openhound_github/source.py, tests/test_github_rest_client.py, tests/test_github_app_retry.py, tests/test_collection_continuation.py, README.md
Adds a session with 10–30 second request timeouts and bounded retries for transient failures. The API client uses this session. Tests cover retry limits, rate limits, credential refresh, and collection behavior after exhausted retries. The README describes these settings and outcomes.
Adaptive GraphQL page retry budget
src/openhound_github/helpers.py, tests/test_graphql_retry_budget.py
GraphQL pagination activates a shared transient-failure budget for each page. Gateway responses can trigger a smaller page size only when another candidate exists and the budget is not exhausted. Tests cover retries, fallback, and page retention.
Workflow path and file handling
src/openhound_github/resources/organization.py, tests/test_workflow_resources.py
Workflow collection skips workflows with absent paths or paths beginning with dynamic/. Workflow-file retrieval failures are logged and return no file content, so failed workflows do not produce job or step rows.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: d3vzer0

Merge Risk: Minimal · up to 6c084

The change bounds transient retries and skips failed workflow-file retrievals. No concrete merge-blocking issue was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: limiting collection retries and request timeouts. The issue identifier adds useful context without obscuring the change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 27 functions across 9 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each page with care,
Three quick tries, then smaller there.
The missing paths are left behind,
While later records still unwind.
The workflow files that fail to load
Leave no child rows along the road.

Comment @coderabbitai help to get the list of available commands.

@jaredcatkinson
jaredcatkinson merged commit 5c25924 into main Oct 30, 2026
4 checks passed
@jaredcatkinson
jaredcatkinson deleted the fix/BED-10372-collection-retry-resilience branch October 30, 2026 15:23

This branch was successfully deployed

1 active deployment
pypi — 6c08409e Deployed Oct 30, 2026 by jaredcatkinson via publish / build #67
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