feat: introduce seatbelt_http crate#428
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #428 +/- ##
========================================
Coverage 100.0% 100.0%
========================================
Files 286 292 +6
Lines 22978 23100 +122
========================================
+ Hits 22978 23100 +122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
1c174e4 to
639ebdc
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a new seatbelt_http crate that adapts the generic seatbelt resilience middleware to http_extensions request/response types, providing HTTP-aware builder/extension methods (prefixed with http_) for retry, timeout, hedging, and circuit breaker scenarios.
Changes:
- Added new
crates/seatbelt_httpcrate with feature-gated modules (retry,timeout,hedging,breaker) plus shared HTTP utilities (HttpRecovery,HttpClone,HttpResilienceContext). - Wired the crate into the workspace (dependency entry + lockfile) and surfaced it in the root README/changelog index.
- Updated repository spellcheck allowlist for common HTTP terminology (
5xx).
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds seatbelt_http to the top-level crate list. |
| CHANGELOG.md | Links the new crate’s changelog from the root changelog index. |
| Cargo.toml | Adds seatbelt_http as a workspace dependency. |
| Cargo.lock | Records the new workspace crate in the lockfile. |
| .spelling | Adds 5xx to the spelling allowlist. |
| crates/seatbelt_http/Cargo.toml | Defines the new crate (features, deps, docs.rs config, external-type allowlist). |
| crates/seatbelt_http/CHANGELOG.md | Introduces the crate changelog with the initial release entry. |
| crates/seatbelt_http/README.md | Adds the crate README (appears cargo-doc2readme generated) describing features/types. |
| crates/seatbelt_http/logo.png | Adds crate logo asset (Git LFS). |
| crates/seatbelt_http/favicon.ico | Adds crate favicon asset (Git LFS). |
| crates/seatbelt_http/src/lib.rs | Crate root: feature-gated modules + shared public type exports. |
| crates/seatbelt_http/src/http_recovery.rs | Implements HttpRecovery and shared recovery detection for HTTP results. |
| crates/seatbelt_http/src/http_clone.rs | Implements HttpClone request cloning strategy and per-attempt routing support. |
| crates/seatbelt_http/src/retry.rs | Provides HTTP-specialized retry aliases + extension trait methods and tests. |
| crates/seatbelt_http/src/timeout.rs | Provides HTTP-specialized timeout aliases + extension trait for mapping timeout into HttpError. |
| crates/seatbelt_http/src/hedging.rs | Provides HTTP-specialized hedging aliases + extension trait methods and tests. |
| crates/seatbelt_http/src/breaker.rs | Provides HTTP-specialized breaker aliases + extension trait methods and origin-based breaker IDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
feat(seatbelt_http): introduce
seatbelt_httpcrateAdds a new
seatbelt_httpcrate that specializes the genericseatbeltresilience middleware for HTTP request/response types fromhttp_extensions, and provides HTTP-aware builder methods (all prefixed withhttp_).What's included
Feature-gated modules, each with specialized type aliases and an extension trait:
retryretrytimeouttimeouthedginghedgingbreakerbreakerShared types:
HttpRecovery— classifies 5xx,429, and timeouts as transient by default.HttpClone— selects which HTTP methods are eligible for cloning during retries/hedging (safe-only, idempotent, or all).HttpResilienceContext— HTTP specialization ofseatbelt::ResilienceContext.Example
Changes
crates/seatbelt_http(initial release0.2.0).Cargo.tomland rootREADME.md.`