Skip to content

Commit

Permalink
Merge pull request #99 from 06chaynes/develop
Browse files Browse the repository at this point in the history
fix missing reload logic, bump versions
  • Loading branch information
06chaynes authored Jan 31, 2025
2 parents 0e5e59f + 4143052 commit 86d539d
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cargo llvm-cov --no-report --package http-cache-surf --features manager-moka
cargo llvm-cov --no-report --package http-cache-reqwest --features manager-moka
cargo llvm-cov report --lcov --output-path lcov.info
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: false
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: taiki-e/install-action@v2
with:
tool: cargo-binstall
- run: cargo binstall --version 0.15.1 --no-confirm cargo-msrv
- run: cargo binstall --version 0.17.1 --no-confirm cargo-msrv
- name: Run cargo msrv http-cache
working-directory: ./http-cache
run: cargo msrv verify
Expand All @@ -33,3 +33,9 @@ jobs:
- name: Run cargo msrv http-cache-darkbird
working-directory: ./http-cache-darkbird
run: cargo msrv verify
- name: Run cargo msrv http-cache-reqwest
working-directory: ./http-cache-reqwest
run: cargo msrv verify
- name: Run cargo msrv http-cache-surf
working-directory: ./http-cache-surf
run: cargo msrv verify
4 changes: 2 additions & 2 deletions .github/workflows/oranda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:

- name: Install and run oranda
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.4.0/oranda-installer.sh | sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.6.5/oranda-installer.sh | sh
oranda build
- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@v4.6.9
uses: JamesIves/github-pages-deploy-action@v4.7.2
if: ${{ github.ref == 'refs/heads/main' }}
with:
branch: gh-pages
Expand Down
14 changes: 13 additions & 1 deletion http-cache-darkbird/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@

# Changelog

## [0.3.1] - 2025-01-30

### Changed

- MSRV is now 1.71.1

- Updated the minimum versions of the following dependencies:
- http-cache [0.21.1]
- async-trait [0.1.85]
- darkbird [6.2.4]
- serde [1.0.217]
- thiserror [2.0.11]

## [0.3.0] - 2024-11-12

### Changed
Expand Down
24 changes: 12 additions & 12 deletions http-cache-darkbird/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "http-cache-darkbird"
version = "0.3.0"
version = "0.3.1"
description = "http-cache manager implementation for darkbird"
authors = ["Christian Haynes <[email protected]>", "Kat Marchán <[email protected]>"]
repository = "https://github.com/06chaynes/http-cache"
Expand All @@ -13,27 +13,27 @@ categories = [
"web-programming::http-client"
]
edition = "2021"
rust-version = "1.70.0"
rust-version = "1.71.1"

[dependencies]
async-trait = "0.1.72"
darkbird = "6.1.8"
async-trait = "0.1.85"
darkbird = "6.2.4"
http-cache-semantics = "2.1.0"
serde = { version = "1.0.178", features = ["derive"] }
thiserror = "2.0.3"
serde = { version = "1.0.217", features = ["derive"] }
thiserror = "2.0.11"

[dependencies.http-cache]
path = "../http-cache"
version = "0.20.0"
version = "0.20.1"
default-features = false

[dev-dependencies]
http = "1.1.0"
reqwest = { version = "0.12.3", default-features = false }
http = "1.2.0"
reqwest = { version = "0.12.12", default-features = false }
reqwest-middleware = "0.4.0"
tokio = { version = "1.29.1", features = [ "macros", "rt", "rt-multi-thread" ] }
wiremock = "0.6.0"
url = { version = "2.4.0", features = ["serde"] }
tokio = { version = "1.43.0", features = [ "macros", "rt", "rt-multi-thread" ] }
wiremock = "0.6.2"
url = { version = "2.5.4", features = ["serde"] }

[dev-dependencies.http-cache-reqwest]
path = "../http-cache-reqwest"
Expand Down
2 changes: 1 addition & 1 deletion http-cache-darkbird/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An http-cache manager implementation for [darkbird](https://github.com/Rustixir/

## Minimum Supported Rust Version (MSRV)

1.70.0
1.71.1

## Install

Expand Down
12 changes: 11 additions & 1 deletion http-cache-mokadeser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

# Changelog

## [0.3.1] - 2025-01-30

### Changed

- MSRV is now 1.71.1

- Updated the minimum versions of the following dependencies:
- http-cache [0.21.1]
- async-trait [0.1.85]
- moka [0.12.10]

## [0.3.0] - 2024-11-12

### Changed
Expand Down
20 changes: 10 additions & 10 deletions http-cache-mokadeser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "http-cache-mokadeser"
version = "0.3.0"
version = "0.3.1"
description = "http-cache manager implementation for moka stored deserialized"
authors = ["Christian Haynes <[email protected]>", "Kat Marchán <[email protected]>"]
repository = "https://github.com/06chaynes/http-cache"
Expand All @@ -13,26 +13,26 @@ categories = [
"web-programming::http-client"
]
edition = "2021"
rust-version = "1.67.1"
rust-version = "1.71.1"

[dependencies]
async-trait = "0.1.72"
async-trait = "0.1.85"
http-cache-semantics = "2.1.0"
moka = { version = "0.12.0", features = ["future"]}
moka = { version = "0.12.10", features = ["future"]}

[dependencies.http-cache]
path = "../http-cache"
version = "0.20.0"
version = "0.20.1"
default-features = false
features = ["bincode"]

[dev-dependencies]
http = "1.1.0"
reqwest = { version = "0.12.3", default-features = false }
http = "1.2.0"
reqwest = { version = "0.12.12", default-features = false }
reqwest-middleware = "0.4.0"
tokio = { version = "1.29.1", features = [ "macros", "rt", "rt-multi-thread" ] }
url = { version = "2.4.0", features = ["serde"] }
wiremock = "0.6.0"
tokio = { version = "1.43.0", features = [ "macros", "rt", "rt-multi-thread" ] }
url = { version = "2.5.4", features = ["serde"] }
wiremock = "0.6.2"

[dev-dependencies.http-cache-reqwest]
path = "../http-cache-reqwest"
Expand Down
2 changes: 1 addition & 1 deletion http-cache-mokadeser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An http-cache manager implementation for [moka](https://github.com/moka-rs/moka)

## Minimum Supported Rust Version (MSRV)

1.67.1
1.71.1

## Install

Expand Down
12 changes: 11 additions & 1 deletion http-cache-quickcache/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

# Changelog

## [0.8.1] - 2025-01-30

### Changed

- Updated the minimum versions of the following dependencies:
- http-cache [0.21.1]
- async-trait [0.1.85]
- darkbird [6.2.4]
- serde [1.0.217]
- url [2.5.4]

## [0.8.0] - 2024-11-12

### Changed
Expand Down
18 changes: 9 additions & 9 deletions http-cache-quickcache/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "http-cache-quickcache"
version = "0.8.0"
version = "0.8.1"
description = "http-cache manager implementation for quick-cache"
authors = ["Christian Haynes <[email protected]>", "Kat Marchán <[email protected]>"]
repository = "https://github.com/06chaynes/http-cache"
Expand All @@ -16,25 +16,25 @@ edition = "2021"
rust-version = "1.71.1"

[dependencies]
async-trait = "0.1.72"
async-trait = "0.1.85"
bincode = "1.3.3"
http-cache-semantics = "2.1.0"
serde = { version = "1.0.178", features = ["derive"] }
url = { version = "2.4.0", features = ["serde"] }
serde = { version = "1.0.217", features = ["derive"] }
url = { version = "2.5.4", features = ["serde"] }
quick_cache = "0.6.9"

[dependencies.http-cache]
path = "../http-cache"
version = "0.20.0"
version = "0.20.1"
default-features = false
features = ["bincode"]

[dev-dependencies]
http = "1.1.0"
reqwest = { version = "0.12.3", default-features = false }
http = "1.2.0"
reqwest = { version = "0.12.12", default-features = false }
reqwest-middleware = "0.4.0"
tokio = { version = "1.29.1", features = [ "macros", "rt", "rt-multi-thread" ] }
wiremock = "0.6.0"
tokio = { version = "1.43.0", features = [ "macros", "rt", "rt-multi-thread" ] }
wiremock = "0.6.2"

[dev-dependencies.http-cache-reqwest]
path = "../http-cache-reqwest"
Expand Down
13 changes: 13 additions & 0 deletions http-cache-reqwest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [0.15.1] - 2025-01-30

### Changed

- Updated the minimum versions of the following dependencies:
- http-cache [0.21.1]
- anyhow [1.0.95]
- async-trait [0.1.85]
- http [1.2.0]
- reqwest [0.12.12]
- serde [1.0.217]
- url [2.5.4]

## [0.15.0] - 2024-11-12

### Changed
Expand Down
19 changes: 10 additions & 9 deletions http-cache-reqwest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "http-cache-reqwest"
version = "0.15.0"
version = "0.15.1"
description = "http-cache middleware implementation for reqwest"
authors = ["Christian Haynes <[email protected]>", "Kat Marchán <[email protected]>"]
repository = "https://github.com/06chaynes/http-cache"
Expand All @@ -13,24 +13,25 @@ categories = [
"web-programming::http-client"
]
edition = "2021"
rust-version = "1.71.1"

[dependencies]
anyhow = "1.0.72"
async-trait = "0.1.72"
http = "1.1.0"
anyhow = "1.0.95"
async-trait = "0.1.85"
http = "1.2.0"
http-cache-semantics = "2.1.0"
reqwest = { version = "0.12.3", default-features = false }
reqwest = { version = "0.12.12", default-features = false }
reqwest-middleware = "0.4.0"
serde = { version = "1.0.178", features = ["derive"] }
url = { version = "2.4.0", features = ["serde"] }
serde = { version = "1.0.217", features = ["derive"] }
url = { version = "2.5.4", features = ["serde"] }

[dependencies.http-cache]
path = "../http-cache"
version = "0.20.0"
version = "0.20.1"
default-features = false

[dev-dependencies]
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.43.0", features = ["macros", "rt-multi-thread"] }
wiremock = "0.6.0"

[features]
Expand Down
2 changes: 1 addition & 1 deletion http-cache-reqwest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Uses [reqwest-middleware](https://github.com/TrueLayer/reqwest-middleware) for m

## Minimum Supported Rust Version (MSRV)

1.67.1
1.71.1

## Install

Expand Down
39 changes: 39 additions & 0 deletions http-cache-reqwest/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,45 @@ async fn no_cache_mode() -> Result<()> {
Ok(())
}

#[tokio::test]
async fn reload_mode() -> Result<()> {
let mock_server = MockServer::start().await;
let m = build_mock(CACHEABLE_PUBLIC, TEST_BODY, 200, 2);
let _mock_guard = mock_server.register_as_scoped(m).await;
let url = format!("{}/", &mock_server.uri());
let manager = MokaManager::default();

// Construct reqwest client with cache options override
let client = ClientBuilder::new(Client::new())
.with(Cache(HttpCache {
mode: CacheMode::Reload,
manager: manager.clone(),
options: HttpCacheOptions {
cache_key: None,
cache_options: Some(CacheOptions {
shared: false,
..Default::default()
}),
cache_mode_fn: None,
cache_bust: None,
cache_status_headers: true,
},
}))
.build();

// Cold pass to load cache
client.get(url.clone()).send().await?;

// Try to load cached object
let data = manager.get(&format!("{}:{}", GET, &Url::parse(&url)?)).await?;
assert!(data.is_some());

// Another pass to make sure request is made to the endpoint
client.get(url).send().await?;

Ok(())
}

#[tokio::test]
async fn custom_cache_key() -> Result<()> {
let mock_server = MockServer::start().await;
Expand Down
13 changes: 13 additions & 0 deletions http-cache-surf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [0.14.1] - 2025-01-30

### Changed

- Updated the minimum versions of the following dependencies:
- http-cache [0.21.1]
- anyhow [1.0.95]
- async-trait [0.1.85]
- http [1.2.0]
- serde [1.0.217]
- url [2.5.4]
- thiserror [2.0.11]

## [0.14.0] - 2024-11-12

### Changed
Expand Down
Loading

0 comments on commit 86d539d

Please sign in to comment.