From a5c2d0531b30bc6f80beba13dc2916b50e9787ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:40:14 +0000 Subject: [PATCH 01/21] build(deps): update brotli requirement from 6 to 7 (#3482) * build(deps): update brotli requirement from 6 to 7 Updates the requirements on [brotli](https://github.com/dropbox/rust-brotli) to permit the latest version. - [Release notes](https://github.com/dropbox/rust-brotli/releases) - [Commits](https://github.com/dropbox/rust-brotli/commits) --- updated-dependencies: - dependency-name: brotli dependency-type: direct:production ... Signed-off-by: dependabot[bot] * docs: update changelogs --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Ede --- actix-http/CHANGES.md | 1 + actix-http/Cargo.toml | 2 +- actix-web/CHANGES.md | 3 ++- actix-web/Cargo.toml | 2 +- awc/CHANGES.md | 1 + awc/Cargo.toml | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 95b51254b..2bbcebc07 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased +- Update `brotli` dependency to `7`. - Minimum supported Rust version (MSRV) is now 1.75. ## 3.9.0 diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index f910276f1..3f81ea9f0 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -139,7 +139,7 @@ sha1 = { version = "0.10", optional = true } actix-tls = { version = "3.4", default-features = false, optional = true } # compress-* -brotli = { version = "6", optional = true } +brotli = { version = "7", optional = true } flate2 = { version = "1.0.13", optional = true } zstd = { version = "0.13", optional = true } diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index aca4ccfae..cee14dc4b 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -2,8 +2,9 @@ ## Unreleased +- On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use. +- Update `brotli` dependency to `7`. - Minimum supported Rust version (MSRV) is now 1.75. -- On Windows platforms, produce an error when invoking `HttpServer::bind` on a socket that's already in use. See [issue 2958](https://github.com/actix/actix-web/issues/2958). ## 4.9.0 diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index f97eab7c9..ab70bf07c 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -172,7 +172,7 @@ actix-files = "0.6" actix-test = { version = "0.1", features = ["openssl", "rustls-0_23"] } awc = { version = "3", features = ["openssl"] } -brotli = "6" +brotli = "7" const-str = "0.5" core_affinity = "0.8" criterion = { version = "0.5", features = ["html_reports"] } diff --git a/awc/CHANGES.md b/awc/CHANGES.md index 11cb150ab..8a2a1ec43 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased +- Update `brotli` dependency to `7`. - Prevent panics on connection pool drop when Tokio runtime is shutdown early. - Minimum supported Rust version (MSRV) is now 1.75. diff --git a/awc/Cargo.toml b/awc/Cargo.toml index 849ca571f..c09f32ac8 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -141,7 +141,7 @@ actix-tls = { version = "3.4", features = ["openssl", "rustls-0_23"] } actix-utils = "3" actix-web = { version = "4", features = ["openssl"] } -brotli = "6" +brotli = "7" const-str = "0.5" env_logger = "0.11" flate2 = "1.0.13" From 3849cdaa6c525501bf5666a34b429f46dbb9529d Mon Sep 17 00:00:00 2001 From: Luca Iachini <77624486+luca-iachini@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:16:10 +0200 Subject: [PATCH 02/21] Improve worker_max_blocking_threads documentation (#3477) * improve worker_max_blocking_threads doc * docs: tweak doc --------- Co-authored-by: Rob Ede --- actix-web/src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actix-web/src/server.rs b/actix-web/src/server.rs index 4fbeb0186..1ea4de4ca 100644 --- a/actix-web/src/server.rs +++ b/actix-web/src/server.rs @@ -193,7 +193,7 @@ where /// /// One thread pool is set up **per worker**; not shared across workers. /// - /// By default set to 512 divided by the number of workers. + /// By default, set to 512 divided by [available parallelism](std::thread::available_parallelism()). pub fn worker_max_blocking_threads(mut self, num: usize) -> Self { self.builder = self.builder.worker_max_blocking_threads(num); self From 27c07f122bafcd26a9ef688f0689340f8718294c Mon Sep 17 00:00:00 2001 From: Durairaj Subramaniam Date: Mon, 7 Oct 2024 23:03:38 +0100 Subject: [PATCH 03/21] fix: service macro comments (#3474) * fix: service macro comments #3472 * test: service macro comments #3472 * fix: add case for empty tuple seperately * doc: add case for empty tuple seperately * test: move test_services into lib --------- Co-authored-by: Rob Ede --- actix-web/src/service.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/actix-web/src/service.rs b/actix-web/src/service.rs index a1672eba2..6c7f6f5c8 100644 --- a/actix-web/src/service.rs +++ b/actix-web/src/service.rs @@ -662,6 +662,7 @@ where /// ``` #[macro_export] macro_rules! services { + () => {()}; ($($x:expr),+ $(,)?) => { ($($x,)+) } @@ -870,4 +871,40 @@ mod tests { let req = test::TestRequest::default().to_request(); let _res = test::call_service(&app, req).await; } + + #[test] + fn define_services_macro_with_multiple_arguments() { + let result = services!(1, 2, 3); + assert_eq!(result, (1, 2, 3)); + } + + #[test] + fn define_services_macro_with_single_argument() { + let result = services!(1); + assert_eq!(result, (1,)); + } + + #[test] + fn define_services_macro_with_no_arguments() { + let result = services!(); + let () = result; + } + + #[test] + fn define_services_macro_with_trailing_comma() { + let result = services!(1, 2, 3,); + assert_eq!(result, (1, 2, 3)); + } + + #[test] + fn define_services_macro_with_comments_in_arguments() { + let result = services!( + 1, // First comment + 2, // Second comment + 3 // Third comment + ); + + // Assert that comments are ignored and it correctly returns a tuple. + assert_eq!(result, (1, 2, 3)); + } } From 4c05c87b11a9a4264d668f78e0c086bfb396a313 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:07:05 +0200 Subject: [PATCH 04/21] build(deps): bump taiki-e/install-action from 2.44.24 to 2.44.34 (#3485) --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 76cad6c17..3b3bbee95 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f30590708..c17afd635 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index cb713608c..85aee1c4f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ab9e3a8e4..a889da2bb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: nightly-2024-05-01 - name: Install just - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: nightly-2024-09-30 - name: Install cargo-public-api - uses: taiki-e/install-action@v2.44.24 + uses: taiki-e/install-action@v2.44.34 with: tool: cargo-public-api From ec05381f6f8644ff97880b000b592b58e5a23c2e Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 15 Oct 2024 07:00:04 +0100 Subject: [PATCH 05/21] feat: add CLEAR_SITE_DATA header --- actix-http/CHANGES.md | 6 ++++++ actix-http/src/header/common.rs | 8 ++++++++ actix-http/src/header/mod.rs | 6 +++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 2bbcebc07..982add26a 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,12 @@ ## Unreleased +### Added + +- Add `header::CLEAR_SITE_DATA` constant. + +### Changed + - Update `brotli` dependency to `7`. - Minimum supported Rust version (MSRV) is now 1.75. diff --git a/actix-http/src/header/common.rs b/actix-http/src/header/common.rs index 6942dc26a..ebdd6708f 100644 --- a/actix-http/src/header/common.rs +++ b/actix-http/src/header/common.rs @@ -18,6 +18,14 @@ pub const CACHE_STATUS: HeaderName = HeaderName::from_static("cache-status"); // TODO(breaking): replace with http's version pub const CDN_CACHE_CONTROL: HeaderName = HeaderName::from_static("cdn-cache-control"); +/// Response header field that sends a signal to the user agent that it ought to remove all data of +/// a certain set of types. +/// +/// See the [W3C Clear-Site-Data spec] for full semantics. +/// +/// [W3C Clear-Site-Data spec]: https://www.w3.org/TR/clear-site-data/#header +pub const CLEAR_SITE_DATA: HeaderName = HeaderName::from_static("clear-site-data"); + /// Response header that prevents a document from loading any cross-origin resources that don't /// explicitly grant the document permission (using [CORP] or [CORS]). /// diff --git a/actix-http/src/header/mod.rs b/actix-http/src/header/mod.rs index 79f91afef..b22c43f76 100644 --- a/actix-http/src/header/mod.rs +++ b/actix-http/src/header/mod.rs @@ -42,9 +42,9 @@ pub use self::{ as_name::AsHeaderName, // re-export list is explicit so that any updates to `http` do not conflict with this set common::{ - CACHE_STATUS, CDN_CACHE_CONTROL, CROSS_ORIGIN_EMBEDDER_POLICY, CROSS_ORIGIN_OPENER_POLICY, - CROSS_ORIGIN_RESOURCE_POLICY, PERMISSIONS_POLICY, X_FORWARDED_FOR, X_FORWARDED_HOST, - X_FORWARDED_PROTO, + CACHE_STATUS, CDN_CACHE_CONTROL, CLEAR_SITE_DATA, CROSS_ORIGIN_EMBEDDER_POLICY, + CROSS_ORIGIN_OPENER_POLICY, CROSS_ORIGIN_RESOURCE_POLICY, PERMISSIONS_POLICY, + X_FORWARDED_FOR, X_FORWARDED_HOST, X_FORWARDED_PROTO, }, into_pair::TryIntoHeaderPair, into_value::TryIntoHeaderValue, From 03c65d93e54ee9cf473bcd7112b98ae584dbe41f Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 15 Oct 2024 08:35:39 +0100 Subject: [PATCH 06/21] docs: add from_fn examples --- actix-web/Cargo.toml | 1 + actix-web/examples/from_fn.rs | 128 ++++++++++++++++++++++++++++++++++ justfile | 3 + 3 files changed, 132 insertions(+) create mode 100644 actix-web/examples/from_fn.rs diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index ab70bf07c..9b10f14b1 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -163,6 +163,7 @@ serde = "1.0" serde_json = "1.0" serde_urlencoded = "0.7" smallvec = "1.6.1" +tracing = "0.1.30" socket2 = "0.5" time = { version = "0.3", default-features = false, features = ["formatting"] } url = "2.1" diff --git a/actix-web/examples/from_fn.rs b/actix-web/examples/from_fn.rs new file mode 100644 index 000000000..a6006d23c --- /dev/null +++ b/actix-web/examples/from_fn.rs @@ -0,0 +1,128 @@ +//! Shows a few of ways to use the `from_fn` middleware. + +use std::{collections::HashMap, io, rc::Rc, time::Duration}; + +use actix_web::{ + body::MessageBody, + dev::{Service, ServiceRequest, ServiceResponse, Transform}, + http::header::{self, HeaderValue, Range}, + middleware::{from_fn, Logger, Next}, + web::{self, Header, Query}, + App, Error, HttpResponse, HttpServer, +}; +use tracing::info; + +async fn noop(req: ServiceRequest, next: Next) -> Result, Error> { + next.call(req).await +} + +async fn print_range_header( + range_header: Option>, + req: ServiceRequest, + next: Next, +) -> Result, Error> { + if let Some(Header(range)) = range_header { + println!("Range: {range}"); + } else { + println!("No Range header"); + } + + next.call(req).await +} + +async fn mutate_body_type( + req: ServiceRequest, + next: Next, +) -> Result, Error> { + let res = next.call(req).await?; + Ok(res.map_into_left_body::<()>()) +} + +async fn mutate_body_type_with_extractors( + string_body: String, + query: Query>, + req: ServiceRequest, + next: Next, +) -> Result, Error> { + println!("body is: {string_body}"); + println!("query string: {query:?}"); + + let res = next.call(req).await?; + + Ok(res.map_body(move |_, _| string_body)) +} + +async fn timeout_10secs( + req: ServiceRequest, + next: Next, +) -> Result, Error> { + match tokio::time::timeout(Duration::from_secs(10), next.call(req)).await { + Ok(res) => res, + Err(_err) => Err(actix_web::error::ErrorRequestTimeout("")), + } +} + +struct MyMw(bool); + +impl MyMw { + async fn mw_cb( + &self, + req: ServiceRequest, + next: Next, + ) -> Result, Error> { + let mut res = match self.0 { + true => req.into_response("short-circuited").map_into_right_body(), + false => next.call(req).await?.map_into_left_body(), + }; + + res.headers_mut() + .insert(header::WARNING, HeaderValue::from_static("42")); + + Ok(res) + } + + pub fn into_middleware( + self, + ) -> impl Transform< + S, + ServiceRequest, + Response = ServiceResponse, + Error = Error, + InitError = (), + > + where + S: Service, Error = Error> + 'static, + B: MessageBody + 'static, + { + let this = Rc::new(self); + from_fn(move |req, next| { + let this = Rc::clone(&this); + async move { Self::mw_cb(&this, req, next).await } + }) + } +} + +#[actix_web::main] +async fn main() -> io::Result<()> { + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + let bind = ("127.0.0.1", 8080); + info!("staring server at http://{}:{}", &bind.0, &bind.1); + + HttpServer::new(|| { + App::new() + .wrap(from_fn(noop)) + .wrap(from_fn(print_range_header)) + .wrap(from_fn(mutate_body_type)) + .wrap(from_fn(mutate_body_type_with_extractors)) + .wrap(from_fn(timeout_10secs)) + // switch bool to true to observe early response + .wrap(MyMw(false).into_middleware()) + .wrap(Logger::default()) + .default_service(web::to(HttpResponse::Ok)) + }) + .workers(1) + .bind(bind)? + .run() + .await +} diff --git a/justfile b/justfile index 4ab2796c0..a970b62e7 100644 --- a/justfile +++ b/justfile @@ -36,6 +36,9 @@ check-min: check-default: cargo hack --workspace check +# Run Clippy over workspace. +check toolchain="": && (clippy toolchain) + # Run Clippy over workspace. clippy toolchain="": cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }} From 568bffeb58db083d63d887bd0f1cceaa0464d1c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:19:31 +0100 Subject: [PATCH 07/21] build(deps): bump taiki-e/install-action from 2.44.34 to 2.44.43 (#3488) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.44.34 to 2.44.43. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.44.34...v2.44.43) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 3b3bbee95..e8c260921 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c17afd635..522d20014 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 85aee1c4f..5615ecefe 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a889da2bb..1b2c5a24d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: nightly-2024-05-01 - name: Install just - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: nightly-2024-09-30 - name: Install cargo-public-api - uses: taiki-e/install-action@v2.44.34 + uses: taiki-e/install-action@v2.44.43 with: tool: cargo-public-api From ef977055fcba8aa6b9fa42686764c87c2d701caf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:48:34 +0000 Subject: [PATCH 08/21] build(deps): bump taiki-e/install-action from 2.44.43 to 2.44.60 (#3494) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index e8c260921..f0ed2173b 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 522d20014..b04213dc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5615ecefe..1d4e580c9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1b2c5a24d..94380aee5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: nightly-2024-05-01 - name: Install just - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: nightly-2024-09-30 - name: Install cargo-public-api - uses: taiki-e/install-action@v2.44.43 + uses: taiki-e/install-action@v2.44.60 with: tool: cargo-public-api From 6771be20b39a14be3d55fdb08f16a67521a644cc Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 14 Nov 2024 09:29:00 +0100 Subject: [PATCH 09/21] ci: nightly rust versions in variables (#3501) --- .github/workflows/lint.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 94380aee5..825bee1c9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -66,15 +66,15 @@ jobs: run: cargo +nightly doc --no-deps --workspace --all-features check-external-types: - if: false # disable until https://github.com/awslabs/cargo-check-external-types/pull/177 is marged + if: false # rustdoc mismatch currently runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Rust (nightly-2024-05-01) + - name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }}) uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 with: - toolchain: nightly-2024-05-01 + toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just uses: taiki-e/install-action@v2.44.60 @@ -87,7 +87,7 @@ jobs: tool: cargo-check-external-types - name: check external types - run: just check-external-types-all +nightly-2024-05-01 + run: just check-external-types-all +${{ vars.RUST_VERSION_EXTERNAL_TYPES }} public-api-diff: runs-on: ubuntu-latest @@ -100,10 +100,10 @@ jobs: - name: Checkout PR branch uses: actions/checkout@v4 - - name: Install Rust (nightly-2024-09-30) + - name: Install Rust (${{ vars.RUST_VERSION_API_DIFF }}) uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 with: - toolchain: nightly-2024-09-30 + toolchain: ${{ vars.RUST_VERSION_API_DIFF }} - name: Install cargo-public-api uses: taiki-e/install-action@v2.44.60 From 9d849c19a59e339def1d5d81fe62ab5a0cd7f147 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:55:07 +0000 Subject: [PATCH 10/21] build(deps): bump taiki-e/install-action from 2.44.60 to 2.44.69 (#3502) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.44.60 to 2.44.69. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.44.60...v2.44.69) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index f0ed2173b..1e1ab4610 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b04213dc3..6bfa276c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1d4e580c9..1dc126c59 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 825bee1c9..2059aefe8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_API_DIFF }} - name: Install cargo-public-api - uses: taiki-e/install-action@v2.44.60 + uses: taiki-e/install-action@v2.44.69 with: tool: cargo-public-api From eff2a20c9046e7e44ac037a281b32753901db02b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:26:12 +0000 Subject: [PATCH 11/21] build(deps): bump taiki-e/install-action from 2.44.69 to 2.44.71 (#3505) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.44.69 to 2.44.71. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.44.69...v2.44.71) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 1e1ab4610..fe1aa73dc 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bfa276c4..c4e90769c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1dc126c59..da1f0a470 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2059aefe8..5ba3ae8d3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_API_DIFF }} - name: Install cargo-public-api - uses: taiki-e/install-action@v2.44.69 + uses: taiki-e/install-action@v2.44.71 with: tool: cargo-public-api From 2132c95b01c903208ace4388836dfe6489bd58cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:26:30 +0000 Subject: [PATCH 12/21] build(deps): bump codecov/codecov-action from 4.6.0 to 5.0.2 (#3504) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.6.0 to 5.0.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.6.0...v5.0.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index da1f0a470..a11fb0b20 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -32,7 +32,7 @@ jobs: run: just test-coverage-codecov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.6.0 + uses: codecov/codecov-action@v5.0.2 with: files: codecov.json fail_ci_if_error: true From 836c75064b1f5e91e8ecd9cba8df879d5d24dff8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:42:41 +0000 Subject: [PATCH 13/21] build(deps): bump codecov/codecov-action from 5.0.2 to 5.0.7 (#3508) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.2 to 5.0.7. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.0.2...v5.0.7) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a11fb0b20..80eabac4b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -32,7 +32,7 @@ jobs: run: just test-coverage-codecov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5.0.2 + uses: codecov/codecov-action@v5.0.7 with: files: codecov.json fail_ci_if_error: true From 002c1b5a196ba38ccf59a2d76927d8f4d8a05263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:43:45 +0000 Subject: [PATCH 14/21] build(deps): bump taiki-e/install-action from 2.44.71 to 2.45.6 (#3509) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.44.71 to 2.45.6. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.44.71...v2.45.6) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index fe1aa73dc..059c22824 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4e90769c..8ee35f636 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 80eabac4b..97437cc8e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5ba3ae8d3..ef3f30b1c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_API_DIFF }} - name: Install cargo-public-api - uses: taiki-e/install-action@v2.44.71 + uses: taiki-e/install-action@v2.45.6 with: tool: cargo-public-api From 8115c818c15792a6edab01f939f049b6c0e38792 Mon Sep 17 00:00:00 2001 From: Joel Wurtz Date: Tue, 10 Dec 2024 17:11:12 +0100 Subject: [PATCH 15/21] Fix continuous integration (#3526) fix(ci): downgrade divan to 0.1.15 on msrv --- justfile | 1 + 1 file changed, 1 insertion(+) diff --git a/justfile b/justfile index a970b62e7..0a69a1e89 100644 --- a/justfile +++ b/justfile @@ -12,6 +12,7 @@ fmt: downgrade-for-msrv: cargo update -p=parse-size --precise=1.0.0 cargo update -p=clap --precise=4.4.18 + cargo update -p=divan --precise=0.1.15 msrv := ``` cargo metadata --format-version=1 \ From a908afa56b2e38f0684ee1233daf62e4c8d78c2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 09:22:53 +0000 Subject: [PATCH 16/21] build(deps): bump taiki-e/install-action from 2.45.6 to 2.46.20 (#3537) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.45.6 to 2.46.20. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/v2.45.6...v2.46.20) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-post-merge.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 059c22824..32a126ae7 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -49,7 +49,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -83,7 +83,7 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - name: Install just, cargo-hack - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: just,cargo-hack diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ee35f636..89cc9bb73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: toolchain: ${{ matrix.version.version }} - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean @@ -113,7 +113,7 @@ jobs: toolchain: nightly - name: Install just - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: just diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 97437cc8e..bf32781e2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: components: llvm-tools - name: Install just, cargo-llvm-cov, cargo-nextest - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: just,cargo-llvm-cov,cargo-nextest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ef3f30b1c..1281ff107 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -77,7 +77,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - name: Install just - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: just @@ -106,7 +106,7 @@ jobs: toolchain: ${{ vars.RUST_VERSION_API_DIFF }} - name: Install cargo-public-api - uses: taiki-e/install-action@v2.45.6 + uses: taiki-e/install-action@v2.46.20 with: tool: cargo-public-api From d8566da66f25ece1c176ad9dc52002c0451a1176 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:54:53 +0000 Subject: [PATCH 17/21] build(deps): bump codecov/codecov-action from 5.0.7 to 5.1.2 (#3536) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.7 to 5.1.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.0.7...v5.1.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bf32781e2..b8efdb938 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -32,7 +32,7 @@ jobs: run: just test-coverage-codecov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5.0.7 + uses: codecov/codecov-action@v5.1.2 with: files: codecov.json fail_ci_if_error: true From 472dbca64e00432a136a60b3e7949ec615e3120e Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 29 Dec 2024 14:29:29 +0000 Subject: [PATCH 18/21] ci: remove public-api-diff job --- .github/workflows/lint.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1281ff107..e77723d58 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -88,30 +88,3 @@ jobs: - name: check external types run: just check-external-types-all +${{ vars.RUST_VERSION_EXTERNAL_TYPES }} - - public-api-diff: - runs-on: ubuntu-latest - steps: - - name: Checkout main branch - uses: actions/checkout@v4 - with: - ref: ${{ github.base_ref }} - - - name: Checkout PR branch - uses: actions/checkout@v4 - - - name: Install Rust (${{ vars.RUST_VERSION_API_DIFF }}) - uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 - with: - toolchain: ${{ vars.RUST_VERSION_API_DIFF }} - - - name: Install cargo-public-api - uses: taiki-e/install-action@v2.46.20 - with: - tool: cargo-public-api - - - name: Generate API diff - run: | - for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do - cargo public-api --manifest-path "$f" --simplified diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }} - done From 34327bd2217bdccdff030198e9d5aa0d6e3a8e82 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 29 Dec 2024 15:03:43 +0000 Subject: [PATCH 19/21] chore: address clippy warnings --- actix-http/src/header/map.rs | 2 +- actix-http/src/helpers.rs | 2 +- actix-http/src/http_message.rs | 2 +- actix-router/src/resource_path.rs | 2 +- actix-web-codegen/tests/routes.rs | 2 +- actix-web/src/helpers.rs | 2 +- actix-web/src/middleware/logger.rs | 2 +- actix-web/src/types/json.rs | 2 +- awc/src/client/connector.rs | 15 ++++++++++----- awc/src/ws.rs | 2 +- 10 files changed, 19 insertions(+), 14 deletions(-) diff --git a/actix-http/src/header/map.rs b/actix-http/src/header/map.rs index 6da01d2c0..7be282b11 100644 --- a/actix-http/src/header/map.rs +++ b/actix-http/src/header/map.rs @@ -830,7 +830,7 @@ impl<'a> Drain<'a> { } } -impl<'a> Iterator for Drain<'a> { +impl Iterator for Drain<'_> { type Item = (Option, HeaderValue); fn next(&mut self) -> Option { diff --git a/actix-http/src/helpers.rs b/actix-http/src/helpers.rs index 7f28018e7..61175bdc9 100644 --- a/actix-http/src/helpers.rs +++ b/actix-http/src/helpers.rs @@ -61,7 +61,7 @@ pub fn write_content_length(n: u64, buf: &mut B, camel_case: bool) { /// perform a remaining length check before writing. pub(crate) struct MutWriter<'a, B>(pub(crate) &'a mut B); -impl<'a, B> io::Write for MutWriter<'a, B> +impl io::Write for MutWriter<'_, B> where B: BufMut, { diff --git a/actix-http/src/http_message.rs b/actix-http/src/http_message.rs index 3ba9ef752..2800f40ba 100644 --- a/actix-http/src/http_message.rs +++ b/actix-http/src/http_message.rs @@ -103,7 +103,7 @@ pub trait HttpMessage: Sized { } } -impl<'a, T> HttpMessage for &'a mut T +impl HttpMessage for &mut T where T: HttpMessage, { diff --git a/actix-router/src/resource_path.rs b/actix-router/src/resource_path.rs index 45948aa2a..610dc344d 100644 --- a/actix-router/src/resource_path.rs +++ b/actix-router/src/resource_path.rs @@ -19,7 +19,7 @@ impl ResourcePath for String { } } -impl<'a> ResourcePath for &'a str { +impl ResourcePath for &str { fn path(&self) -> &str { self } diff --git a/actix-web-codegen/tests/routes.rs b/actix-web-codegen/tests/routes.rs index a6e606871..1443f9a75 100644 --- a/actix-web-codegen/tests/routes.rs +++ b/actix-web-codegen/tests/routes.rs @@ -136,7 +136,7 @@ async fn routes_overlapping_inaccessible_test(req: HttpRequest) -> impl Responde } #[get("/custom_resource_name", name = "custom")] -async fn custom_resource_name_test<'a>(req: HttpRequest) -> impl Responder { +async fn custom_resource_name_test(req: HttpRequest) -> impl Responder { assert!(req.url_for_static("custom").is_ok()); assert!(req.url_for_static("custom_resource_name_test").is_err()); HttpResponse::Ok() diff --git a/actix-web/src/helpers.rs b/actix-web/src/helpers.rs index 1d2679fce..c7b33a083 100644 --- a/actix-web/src/helpers.rs +++ b/actix-web/src/helpers.rs @@ -10,7 +10,7 @@ use bytes::BufMut; /// perform a remaining length check before writing. pub(crate) struct MutWriter<'a, B>(pub(crate) &'a mut B); -impl<'a, B> io::Write for MutWriter<'a, B> +impl io::Write for MutWriter<'_, B> where B: BufMut, { diff --git a/actix-web/src/middleware/logger.rs b/actix-web/src/middleware/logger.rs index 21986baae..125925603 100644 --- a/actix-web/src/middleware/logger.rs +++ b/actix-web/src/middleware/logger.rs @@ -704,7 +704,7 @@ impl FormatText { /// Converter to get a String from something that writes to a Formatter. pub(crate) struct FormatDisplay<'a>(&'a dyn Fn(&mut fmt::Formatter<'_>) -> Result<(), fmt::Error>); -impl<'a> fmt::Display for FormatDisplay<'a> { +impl fmt::Display for FormatDisplay<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { (self.0)(fmt) } diff --git a/actix-web/src/types/json.rs b/actix-web/src/types/json.rs index 51a322e43..22ed624c3 100644 --- a/actix-web/src/types/json.rs +++ b/actix-web/src/types/json.rs @@ -332,7 +332,7 @@ impl JsonBody { (true, Ok(Some(mime))) => { mime.subtype() == mime::JSON || mime.suffix() == Some(mime::JSON) - || ctype_fn.map_or(false, |predicate| predicate(mime)) + || ctype_fn.is_some_and(|predicate| predicate(mime)) } // if content-type is expected but not parsable as mime type, bail diff --git a/awc/src/client/connector.rs b/awc/src/client/connector.rs index f3d443070..15dc34557 100644 --- a/awc/src/client/connector.rs +++ b/awc/src/client/connector.rs @@ -511,7 +511,8 @@ where let h2 = sock .ssl() .selected_alpn_protocol() - .map_or(false, |protos| protos.windows(2).any(|w| w == H2)); + .is_some_and(|protos| protos.windows(2).any(|w| w == H2)); + if h2 { (Box::new(sock), Protocol::Http2) } else { @@ -550,7 +551,8 @@ where .get_ref() .1 .alpn_protocol() - .map_or(false, |protos| protos.windows(2).any(|w| w == H2)); + .is_some_and(|protos| protos.windows(2).any(|w| w == H2)); + if h2 { (Box::new(sock), Protocol::Http2) } else { @@ -584,7 +586,8 @@ where .get_ref() .1 .alpn_protocol() - .map_or(false, |protos| protos.windows(2).any(|w| w == H2)); + .is_some_and(|protos| protos.windows(2).any(|w| w == H2)); + if h2 { (Box::new(sock), Protocol::Http2) } else { @@ -621,7 +624,8 @@ where .get_ref() .1 .alpn_protocol() - .map_or(false, |protos| protos.windows(2).any(|w| w == H2)); + .is_some_and(|protos| protos.windows(2).any(|w| w == H2)); + if h2 { (Box::new(sock), Protocol::Http2) } else { @@ -655,7 +659,8 @@ where .get_ref() .1 .alpn_protocol() - .map_or(false, |protos| protos.windows(2).any(|w| w == H2)); + .is_some_and(|protos| protos.windows(2).any(|w| w == H2)); + if h2 { (Box::new(sock), Protocol::Http2) } else { diff --git a/awc/src/ws.rs b/awc/src/ws.rs index 760331e9d..b05063d22 100644 --- a/awc/src/ws.rs +++ b/awc/src/ws.rs @@ -444,7 +444,7 @@ struct Host<'a> { port: Option>, } -impl<'a> fmt::Display for Host<'a> { +impl fmt::Display for Host<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.hostname)?; From ee6a6ec03e80041783d64cbd00b486fb36272f79 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 29 Dec 2024 15:17:18 +0000 Subject: [PATCH 20/21] docs: add tls to awc example --- awc/Cargo.toml | 6 +++--- awc/examples/client.rs | 30 ++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/awc/Cargo.toml b/awc/Cargo.toml index c09f32ac8..d6626f906 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -153,9 +153,9 @@ tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] } zstd = "0.13" tls-rustls-0_23 = { package = "rustls", version = "0.23" } # add rustls 0.23 with default features to make aws_lc_rs work in tests -[lints] -workspace = true - [[example]] name = "client" required-features = ["rustls-0_23-webpki-roots"] + +[lints] +workspace = true diff --git a/awc/examples/client.rs b/awc/examples/client.rs index 41626315c..b6eb919c7 100644 --- a/awc/examples/client.rs +++ b/awc/examples/client.rs @@ -1,25 +1,39 @@ -use std::error::Error as StdError; +//! Demonstrates construction and usage of a TLS-capable HTTP client. + +extern crate tls_rustls_0_23 as rustls; + +use std::{error::Error as StdError, sync::Arc}; + +use actix_tls::connect::rustls_0_23::webpki_roots_cert_store; +use rustls::ClientConfig; -/// If we want to make requests to addresses starting with `https`, we need to enable the rustls feature of awc -/// `awc = { version = "3.5.0", features = ["rustls"] }` #[actix_rt::main] async fn main() -> Result<(), Box> { env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); - // construct request builder - let client = awc::Client::new(); + let mut config = ClientConfig::builder() + .with_root_certificates(webpki_roots_cert_store()) + .with_no_client_auth(); + + let protos = vec![b"h2".to_vec(), b"http/1.1".to_vec()]; + config.alpn_protocols = protos; + + // construct request builder with TLS support + let client = awc::Client::builder() + .connector(awc::Connector::new().rustls_0_23(Arc::new(config))) + .finish(); // configure request let request = client .get("https://www.rust-lang.org/") - .append_header(("User-Agent", "Actix-web")); + .append_header(("User-Agent", "awc/3.0")); - println!("Request: {:?}", request); + println!("Request: {request:?}"); let mut response = request.send().await?; // server response head - println!("Response: {:?}", response); + println!("Response: {response:?}"); // read response body let body = response.body().await?; From 5b60d81f57aaede263f2029c2790d596e3668795 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 29 Dec 2024 15:18:40 +0000 Subject: [PATCH 21/21] docs: fix changelog --- actix-web/README.md | 2 +- justfile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actix-web/README.md b/actix-web/README.md index e5e412c85..70f167dfd 100644 --- a/actix-web/README.md +++ b/actix-web/README.md @@ -14,7 +14,7 @@ [![Dependency Status](https://deps.rs/crate/actix-web/4.9.0/status.svg)](https://deps.rs/crate/actix-web/4.9.0)
[![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml) -[![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) +[![codecov](https://codecov.io/gh/actix/actix-web/graph/badge.svg?token=dSwOnp9QCv)](https://codecov.io/gh/actix/actix-web) ![downloads](https://img.shields.io/crates/d/actix-web.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) diff --git a/justfile b/justfile index 0a69a1e89..3a5e417fd 100644 --- a/justfile +++ b/justfile @@ -51,8 +51,8 @@ test-msrv: downgrade-for-msrv (test msrv_rustup) test toolchain="": cargo {{ toolchain }} test --lib --tests -p=actix-web-codegen --all-features cargo {{ toolchain }} test --lib --tests -p=actix-multipart-derive --all-features - cargo {{ toolchain }} nextest run -p=actix-router --no-default-features - cargo {{ toolchain }} nextest run --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)" + cargo {{ toolchain }} nextest run --no-tests=warn -p=actix-router --no-default-features + cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)" # Test workspace docs. test-docs toolchain="": && doc @@ -64,7 +64,7 @@ test-all toolchain="": (test toolchain) (test-docs toolchain) # Test workspace and collect coverage info. [private] test-coverage toolchain="": - cargo {{ toolchain }} llvm-cov nextest --no-report {{ all_crate_features }} + cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }} # Test workspace and generate Codecov report.