From 289bb0452cb1131e2af841b79cfc6023c8a0ff3e Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Tue, 15 Nov 2022 10:31:34 +0000 Subject: [PATCH] bump all versions (#71) --- CHANGELOG.md | 12 ++++++++++-- reqwest-middleware/Cargo.toml | 3 +-- reqwest-middleware/src/middleware.rs | 7 ++++--- reqwest-retry/CHANGELOG.md | 5 +++++ reqwest-retry/Cargo.toml | 4 ++-- reqwest-tracing/CHANGELOG.md | 14 +++++++++++--- reqwest-tracing/Cargo.toml | 5 ++--- 7 files changed, 35 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e230d..b73c5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.0] - 2022-11-15 + +### Changed +- `RequestBuilder::try_clone` has a fixed function signature now + +### Removed +- `RequestBuilder::send_with_extensions` - use `RequestBuilder::with_extensions` + `RequestBuilder::send` instead. + ### Added - Implementation of `Debug` trait for `RequestBuilder`. - A new `RequestInitialiser` trait that can be added to `ClientWithMiddleware` -- A new `Extension` initialiser that adds extensions to the request -- Adds `with_extension` method functionality to `RequestBuilder` that can add extensions for the `send` method to use - deprecating `send_with_extensions`. +- A new `Extension` initialiser that adds extensions to each request +- Adds `with_extension` method functionality to `RequestBuilder` that can add extensions for the `send` method to use. ## [0.1.6] - 2022-04-21 diff --git a/reqwest-middleware/Cargo.toml b/reqwest-middleware/Cargo.toml index 6b21ee6..5b55510 100644 --- a/reqwest-middleware/Cargo.toml +++ b/reqwest-middleware/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reqwest-middleware" -version = "0.1.7-alpha.0" +version = "0.2.0" authors = ["Rodrigo Gryzinski "] edition = "2018" description = "Wrapper around reqwest to allow for client middleware chains." @@ -13,7 +13,6 @@ readme = "../README.md" [dependencies] anyhow = "1" async-trait = "0.1.51" -futures = "0.3" http = "0.2" reqwest = { version = "0.11", default-features = false, features = ["json", "multipart"] } serde = "1" diff --git a/reqwest-middleware/src/middleware.rs b/reqwest-middleware/src/middleware.rs index 4f6790e..5120224 100644 --- a/reqwest-middleware/src/middleware.rs +++ b/reqwest-middleware/src/middleware.rs @@ -1,4 +1,3 @@ -use futures::future::{BoxFuture, FutureExt, TryFutureExt}; use reqwest::{Client, Request, Response}; use std::sync::Arc; use task_local_extensions::Extensions; @@ -76,6 +75,8 @@ pub struct Next<'a> { middlewares: &'a [Arc], } +pub type BoxFuture<'a, T> = std::pin::Pin + Send + 'a>>; + impl<'a> Next<'a> { pub(crate) fn new(client: &'a Client, middlewares: &'a [Arc]) -> Self { Next { @@ -91,9 +92,9 @@ impl<'a> Next<'a> { ) -> BoxFuture<'a, Result> { if let Some((current, rest)) = self.middlewares.split_first() { self.middlewares = rest; - current.handle(req, extensions, self).boxed() + Box::pin(current.handle(req, extensions, self)) } else { - self.client.execute(req).map_err(Error::from).boxed() + Box::pin(async move { self.client.execute(req).await.map_err(Error::from) }) } } } diff --git a/reqwest-retry/CHANGELOG.md b/reqwest-retry/CHANGELOG.md index 7b2cba5..3beb93d 100644 --- a/reqwest-retry/CHANGELOG.md +++ b/reqwest-retry/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.0] - 2022-11-15 + +### Changed +- Updated `reqwest-middleware` to `0.2.0` + ## [0.1.4] - 2022-02-21 ### Changed - Updated `reqwest-middleware` to `0.1.5` diff --git a/reqwest-retry/Cargo.toml b/reqwest-retry/Cargo.toml index eb4dbde..ef77147 100644 --- a/reqwest-retry/Cargo.toml +++ b/reqwest-retry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reqwest-retry" -version = "0.1.6-alpha.0" +version = "0.2.0" authors = ["Rodrigo Gryzinski "] edition = "2018" description = "Retry middleware for reqwest." @@ -10,7 +10,7 @@ keywords = ["reqwest", "http", "middleware", "retry"] categories = ["web-programming::http-client"] [dependencies] -reqwest-middleware = { version = "0.1.7-alpha.0", path = "../reqwest-middleware" } +reqwest-middleware = { version = "0.2.0", path = "../reqwest-middleware" } anyhow = "1" async-trait = "0.1.51" diff --git a/reqwest-tracing/CHANGELOG.md b/reqwest-tracing/CHANGELOG.md index 4afb6f1..db892a5 100644 --- a/reqwest-tracing/CHANGELOG.md +++ b/reqwest-tracing/CHANGELOG.md @@ -5,11 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [0.4.0] - 2022-11-15 + +### Changed +- Updated `reqwest-middleware` to `0.2.0` +- Before, `root_span!`/`DefaultSpanBacked` would name your spans `{METHOD} {PATH}`. Since this can be quite + high cardinality, this was changed and now the macro requires an explicit otel name. + `DefaultSpanBacked`/`SpanBackendWithUrl` will default to `reqwest-http-client` but this can be configured + using the `OtelName` Request Initialiser. + ### Added - `SpanBackendWithUrl` for capturing `http.url` in traces -- Require an explicit otel name in the macros. Reduces cardinality and complies - with otel specification for HTTP bindings. -- Permit customisation of the otel name from the non-macro layer. +- `OtelName` Request Initialiser Extension for configuring ## [0.3.1] - 2022-09-21 - Added support for `opentelemetry` version `0.18`. diff --git a/reqwest-tracing/Cargo.toml b/reqwest-tracing/Cargo.toml index 2cb6eb2..ec2dbb2 100644 --- a/reqwest-tracing/Cargo.toml +++ b/reqwest-tracing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reqwest-tracing" -version = "0.3.1-alpha.0" +version = "0.4.0" authors = ["Rodrigo Gryzinski "] edition = "2018" description = "Opentracing middleware for reqwest." @@ -19,12 +19,11 @@ opentelemetry_0_18 = ["opentelemetry_0_18_pkg", "tracing-opentelemetry_0_18_pkg" [dependencies] -reqwest-middleware = { version = "0.1.7-alpha.0", path = "../reqwest-middleware" } +reqwest-middleware = { version = "0.2.0", path = "../reqwest-middleware" } async-trait = "0.1.51" reqwest = { version = "0.11", default-features = false } task-local-extensions = "0.1.1" -tokio = { version = "1.6", features = ["time"] } tracing = "0.1.26" opentelemetry_0_13_pkg = { package = "opentelemetry", version = "0.13", optional = true }