Skip to content

Retry Package#244

Open
danilovict2 wants to merge 2 commits intokashifkhan0771:mainfrom
danilovict2:retry
Open

Retry Package#244
danilovict2 wants to merge 2 commits intokashifkhan0771:mainfrom
danilovict2:retry

Conversation

@danilovict2
Copy link
Copy Markdown
Contributor

@danilovict2 danilovict2 commented Apr 21, 2026

Description:

Explain the purpose of the PR.

Checklist:

  • Tests Passing: Verify by running make test.
  • Golint Passing: Confirm by running make lint.

If added a new utility function or updated existing function logic:

  • Updated the utility package EXAMPLES.md
  • Updated the utility package README.md

If added a new utility package:

  • Updated the main README.md utility packages table

Summary by CodeRabbit

  • New Features

    • New retry package providing configurable retry behavior (max attempts, total timeout, pluggable backoff strategies, and predicate-based retry control), plus a convenience helper for operations that only return errors.
    • Added fixed, linear, and exponential backoff strategies.
  • Documentation

    • Comprehensive README and an examples file demonstrating common retry patterns, backoff comparisons, and timeout behavior.
  • Tests

    • Unit tests and benchmarks covering success/failure paths, timeout and cancellation, retry predicate behavior, and backoff functions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dae41520-b11d-43c4-9d1e-26cb02b2993e

📥 Commits

Reviewing files that changed from the base of the PR and between 8726798 and 24bacbb.

📒 Files selected for processing (4)
  • retry/EXAMPLES.md
  • retry/README.md
  • retry/retry.go
  • retry/retry_test.go
✅ Files skipped from review due to trivial changes (2)
  • retry/EXAMPLES.md
  • retry/README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • retry/retry_test.go
  • retry/retry.go

Walkthrough

Adds a new retry utility package with a generic, context-aware retry loop, three backoff helpers, convenience DoVoid, documentation (README.md, EXAMPLES.md), tests, and a README entry linking the package.

Changes

Cohort / File(s) Summary
Root Documentation
README.md
Added retry entry to the Utility Packages table linking to package docs and examples.
Retry Package Implementation
retry/retry.go
New package implementing Options, generic RetryFunc[T], Do[T], DoVoid, and backoff helpers FixedBackoff, LinearBackoff, ExponentialBackoff. Enforces TotalTimeout, MaxAttempts, and ShouldRetry.
Retry Package Documentation & Examples
retry/README.md, retry/EXAMPLES.md
Added package README describing configuration, behavior, and backoff strategies; added examples demonstrating usage patterns, backoff comparisons, and timeout behavior.
Retry Package Tests & Benchmarks
retry/retry_test.go
Added unit tests covering success/failure, MaxAttempts, ShouldRetry, timeout and cancellation behavior, value vs. error semantics, backoff correctness, plus benchmarks for Do/DoVoid and backoff functions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

documentation

Suggested reviewers

  • kashifkhan0771
  • shahzadhaider1
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 'Retry Package' is directly related to the main changeset, which introduces a new retry package with supporting documentation and tests.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: be40761a-4283-4b51-a41a-d838e54be49a

📥 Commits

Reviewing files that changed from the base of the PR and between 7bb58a3 and 8726798.

📒 Files selected for processing (5)
  • README.md
  • retry/EXAMPLES.md
  • retry/README.md
  • retry/retry.go
  • retry/retry_test.go

Comment thread retry/EXAMPLES.md Outdated
Comment thread retry/EXAMPLES.md Outdated
Comment thread retry/retry_test.go
Comment thread retry/retry.go Outdated
Comment thread retry/retry.go
Comment thread retry/retry.go Outdated
@kashifkhan0771 kashifkhan0771 linked an issue Apr 22, 2026 that may be closed by this pull request
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.

[FEATURE] Retry Package

1 participant