Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.0.0 #169

Merged
merged 69 commits into from
Oct 6, 2023
Merged

7.0.0 #169

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e5f1992
feat: resolve w/ multiple A records, looser boolean casting w/ FromRedis
aembke Aug 10, 2023
af5cd96
feat: builder interface, tls ff fixes, add connection config, tcp con…
aembke Aug 22, 2023
43b2d67
feat: refactor redis pool, event interface, command write counters, u…
aembke Sep 3, 2023
ecd98be
feat: remove global connection timeout interfaces
aembke Sep 4, 2023
c8c0643
feat: ArcStr -> Str, refactor connection init, add server field to pu…
aembke Sep 4, 2023
b83fef2
feat: remove serde json value -> redis value conversion logic
aembke Sep 4, 2023
3666195
doc: update builder example
aembke Sep 4, 2023
3037579
chore: rm prometheus example, update dependencies
aembke Sep 4, 2023
b698d8b
Feat: reusable pipeline interface
aembke Sep 4, 2023
89f43e4
fix: fix tests, update docs and examples
aembke Sep 4, 2023
a560cdc
feat: memory usage generic return type
aembke Sep 4, 2023
f16d1a4
feat: reconnect w/ server id, concurrent cluster reconnections
aembke Sep 4, 2023
a56d766
fix: check redirection counts
aembke Sep 5, 2023
b98e7bc
fix: check write attempt count and redirection counts
aembke Sep 5, 2023
2252b30
fix: optional mocks
aembke Sep 6, 2023
3bcef32
feat: better replica routing, mock tests, docs
aembke Sep 7, 2023
f07cef5
feat: docker tests init, pool docs
aembke Sep 10, 2023
b90c530
feat: reusable pipelines, improve replica routing and reconnection, m…
aembke Sep 13, 2023
64814d8
feat: add single element array checks to FromRedis
aembke Sep 14, 2023
1c2d35b
feat: FromRedis changes for loose-nils and bulk value unwraping, docs
aembke Sep 14, 2023
c807260
feat: FromRedis option specializations, better convert() docs, upgrad…
aembke Sep 14, 2023
f2279fe
doc: with options examples, changelog
aembke Sep 14, 2023
ab52f8c
feat: improved connect() impl, sync command channel ops, tests
aembke Sep 15, 2023
f24a653
feat: fix dns and custom examples, manual reconnection tests, tcp kee…
aembke Sep 16, 2023
781ab22
chore: cleanup warnings
aembke Sep 16, 2023
563eaf8
chore: fix xinfo group tests
aembke Sep 16, 2023
3038cb1
chore: xread docs
aembke Sep 16, 2023
bdc821a
feat: geo type conversions, arrays in FromRedis, alias MultipleValues…
aembke Sep 17, 2023
b57705f
chore: fix broken tests, update changelog
aembke Sep 17, 2023
bba0b61
chore: rename default-nil-types ff, update docs
aembke Sep 17, 2023
3b5b558
chore: rm cfg-if, docs
aembke Sep 17, 2023
b3f77a8
feat: refactor slowlog interface and parsing, docs, consolidate frame…
aembke Sep 17, 2023
4f60b4f
chore: refactor cluster info parsing
aembke Sep 18, 2023
4b6d395
chore: refactor memory stats parsing
aembke Sep 18, 2023
f5eba39
chore: refactor acl interface, remove old rules interface
aembke Sep 18, 2023
767aab1
feat: refactor client caching, fix sentinel tests, custom commands ma…
aembke Sep 18, 2023
60eabbd
feat: refactor cluster node interface into with_options
aembke Sep 18, 2023
3196774
chore: fix examples, docs
aembke Sep 18, 2023
bb2f581
feat: replica sync w/ unresponsive checks, docs, examples
aembke Sep 19, 2023
c3f14ee
chore: major routing refactoring, improved retry buffer logic, rebase…
aembke Sep 21, 2023
5f015fe
chore: update to rust 1.72.1, fix tls test issues
aembke Sep 21, 2023
71459fd
chore: fix sentinel test imports
aembke Sep 21, 2023
3214ddd
feat: redis-stack ci config, redis json scaffolding
aembke Sep 24, 2023
8a930c1
chore: move FromRedis default-nil-type checks to RedisValue, fix tests
aembke Sep 24, 2023
58af66d
feat: fix nested json in FromRedis, finish redisjson interface, json …
aembke Sep 24, 2023
f7f7a8c
chore: fix ci config
aembke Sep 24, 2023
491c20c
chore: stash
aembke Sep 26, 2023
1a8bef7
fix: json quote macro, arrappend, arrindex tests
aembke Sep 26, 2023
a291423
chore: stash
aembke Sep 27, 2023
5ccf87f
chore: json tests
aembke Sep 27, 2023
102cadf
feat: redis-json tests and examples
aembke Sep 28, 2023
3dcb7ac
chore: cleanup old non-generic interfaces
aembke Sep 28, 2023
0287cdb
feat: codec ff, docs
aembke Oct 1, 2023
60211f1
chore: clippy lint config
aembke Oct 1, 2023
4b200ee
chore: apply clippy fixes, refactor
aembke Oct 1, 2023
44426f3
chore: add clippy to ci, fix codec tests
aembke Oct 1, 2023
390a568
chore: typo
aembke Oct 1, 2023
6fcfb42
chore: fix resp3 example tests
aembke Oct 3, 2023
0e2af2b
fix: disable client interface on pool
aembke Oct 3, 2023
fd150f6
feat: allow opting out of the sha-1 dependency
rkday-pro Sep 30, 2023
8c57450
chore: add sha-1 ff docs
aembke Oct 3, 2023
ab889f4
chore: fix docs, examples, default tests
aembke Oct 3, 2023
ad63898
chore: refactoring
aembke Oct 4, 2023
dd77d77
fix: pipeline test w/ replicas
aembke Oct 4, 2023
3ee12fc
feat: WithOptions<Transaction>, fix tests, docs
aembke Oct 5, 2023
02e24a4
chore: fix timeout err, clippy
aembke Oct 5, 2023
ef0b78a
chore: fix pipeline test argv
aembke Oct 5, 2023
bae2d69
chore: cleanup docs, fix replica+tls errors
aembke Oct 6, 2023
450e1b7
chore: remove unused macros
aembke Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/Dockerfile.sentinel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# note: the top level target directory must be removed prior to running this

FROM cimg/rust:1.72.0
FROM cimg/rust:1.72.1
USER circleci

ARG REDIS_VERSION
Expand Down
125 changes: 69 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ commands:
- run:
name: Build documentation
command: tests/doc.sh
test_mocks:
steps:
- run:
name: Run mock tests
command: cargo test --lib --features mocks --no-default-features
test_default_features:
steps:
- checkout
Expand All @@ -50,6 +55,14 @@ commands:
name: Run tests with all features
command: source tests/environ && tests/runners/all-features.sh
- save-cargo-deps-cache
test_redis_stack:
steps:
- checkout
- restore-cargo-deps-cache
- run:
name: Run tests with redis-stack features
command: source tests/environ && tests/runners/redis-stack.sh
- save-cargo-deps-cache
test_no_features:
steps:
- checkout
Expand Down Expand Up @@ -82,122 +95,122 @@ commands:
name: Run cluster tests with rustls features
command: source tests/environ && tests/scripts/tls-creds.sh && tests/runners/cluster-rustls.sh
- save-cargo-deps-cache
test_default_nil_types_features:
steps:
- checkout
- restore-cargo-deps-cache
- run:
name: Run tests with default-nil-types features
command: source tests/environ && tests/runners/default-nil-types.sh
- save-cargo-deps-cache

jobs:
test-default-7_0:
test-default-nil-types-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 7.0.9
REDIS_VERSION: 7.2.1
steps:
- test_default_features
test-no-features-7_0:
- test_default_nil_types_features
test-default-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 7.0.9
REDIS_VERSION: 7.2.1
steps:
- test_no_features
test-all-features-7_0:
- test_default_features
test-redis-stack-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 7.0.9
REDIS_VERSION: 7.2.1
steps:
- test_all_features
test-cluster-tls-features-7_0:
- test_redis_stack
test-no-features-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 7.0.9
FRED_CI_TLS: true
REDIS_VERSION: 7.2.1
steps:
- test_tls_cluster
test-cluster-rustls-features-7_0:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 7.0.9
FRED_CI_TLS: true
steps:
- test_rustls_cluster
test-default-6_2:
- test_no_features
test-all-features-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 6.2.2
REDIS_VERSION: 7.2.1
steps:
- test_default_features
test-no-features-6_2:
- test_all_features
test-cluster-tls-features-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 6.2.2
REDIS_VERSION: 7.2.1
FRED_CI_TLS: true
steps:
- test_no_features
test-all-features-6_2:
- test_tls_cluster
test-cluster-rustls-features-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 6.2.2
REDIS_VERSION: 7.2.1
FRED_CI_TLS: true
steps:
- test_all_features
test-sentinel-6_2:
- test_rustls_cluster
test-sentinel-7_2:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
environment:
REDIS_VERSION: 6.2.2
REDIS_VERSION: 7.2.1
steps:
- test_sentinel
test-sentinel-7_0:
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: true
resource_class: medium
test-misc:
docker:
- image: cimg/rust:1.72.1
environment:
REDIS_VERSION: 7.0.9
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
- test_sentinel
test-docs:
- checkout
- build_docs
- test_mocks
clippy-lint:
docker:
- image: cimg/rust:1.72.0
- image: cimg/rust:1.72.1
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
steps:
- checkout
- build_docs
- run:
name: Clippy
command: cargo clippy -- -Dwarnings


workflows:
version: 2
build:
jobs:
# the older bitnami Redis images require a different process to bootstrap ACL rules...
#- test-default-6_2
#- test-all-features-6_2
#- test-no-features-6_2
#- test-sentinel-6_2
- test-default-7_0
- test-all-features-7_0
- test-no-features-7_0
- test-sentinel-7_0
- test-docs
- test-cluster-tls-features-7_0
- test-cluster-rustls-features-7_0
- test-default-7_2
- test-all-features-7_2
- test-no-features-7_2
- test-default-nil-types-7_2
- test-redis-stack-7_2
- test-sentinel-7_2
- test-misc
- test-cluster-tls-features-7_2
- test-cluster-rustls-features-7_2
- clippy-lint
47 changes: 40 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## 7.0.0

* Added a new client [builder](src/types/builder.rs) and configuration interface.
* Reworked or removed the majority of the `globals` interface.
* Support multiple IP addresses in the `Resolve` interface.
* Add `with_options` command configuration interface.
* Replaced the `no-client-setname` feature flag with `auto-client-setname`.
* Add an interface to configure TCP socket options.
* Removed the automatic `serde_json::Value` -> `RedisValue` type conversion logic.
* This unintentionally introduced some ambiguity on certain interfaces.
* The `RedisValue` -> `serde_json::Value` type conversion logic was not changed.
* Reworked the majority of the `RedisPool` interface.
* Moved and refactored the `on_*` functions into a new `EventInterface`.
* Fixed bugs with the `Replica` routing implementation.
* Fixed bugs related to parsing single-element arrays.
* Changed several `FromRedis` type conversion rules. See below or the `FromRedis` docs for more information.
* Add a [RedisJSON](https://github.com/RedisJSON/RedisJSON/) interface.
* Add a RESP2 and RESP3 codec interface.

### Upgrading from 6.x

Notable interface changes:

* `ArcStr` has been replaced with `bytes_utils::Str`.
* Timeout arguments or fields now all use `std::time::Duration`.
* Many of the old global or performance config values can now be set on individual commands via the `with_options` interface.
* The `RedisPool` interface now directly implements `ClientLike` rather than relying on `Deref` shenanigans.
* The `on_*` event functions were moved and renamed. Reconnection events now include the associated `Server`.
* The `tls_server_name` field on `Server` is now properly gated by the TLS feature flags.
* Mocks are now optional even when the feature flag is enabled.

Notable implementation Changes:

* `Pipeline` and `Transaction` structs can now be reused. Calling `exec`, `all`, `last`, or `try_all` no longer drains the inner command buffer.
* Many of the default timeout values have been lowered significantly, often from 60 sec to 10 sec.
* In earlier versions the `FromRedis` trait implemented a few inconsistent or ambiguous type conversions policies.
* Most of these were consolidated under the `default-nil-types` feature flag.
* It is recommended that callers review the updated `FromRedis` docs or see the unit tests in [responses](src/modules/response.rs).
* The `connect` function can now be called more than once to force reset all client state.

## 6.3.2

* Fix a bug with connection errors unexpectedly ending the connection task.
Expand All @@ -15,13 +55,6 @@
* Fix compilation error with `full-tracing`
* Support `Vec<(T1, T2, ...)>` with `FromRedis`

## 6.2.2

* Fix cluster replica discovery with Elasticache
* Fix cluster replica `READONLY` usage
* Fix compilation error with `full-tracing`
* Support `Vec<(T1, T2, ...)>` with `FromRedis`

## 6.2.1

* Fix cluster failover with paused nodes
Expand Down
17 changes: 8 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ This document gives some background on how the library is structured and how to
# General

* Use 2 spaces instead of tabs.
* Run rustfmt before submitting any changes.
* Run rustfmt and clippy before submitting any changes.
* Clean up any compiler warnings.
* Use the `async` syntax rather than `impl Future` where possible.

## Branches

* Create external PRs against the `staging` branch.
* Please create external PRs against the `staging` branch.
* Use topic branches with [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).
* Branching strategy is `<topic>` -> (squash) `staging` -> `main` -> `release-<major version>`
* Remove `chore` commits when squashing PRs.

## TODO List

Expand Down Expand Up @@ -54,7 +52,7 @@ impl RedisCommandKind {

// ..

pub fn to_str_debug(&self) -> &'static str {
pub fn to_str_debug(&self) -> &str {
match *self {
// ..
RedisCommandKind::Mget => "MGET",
Expand All @@ -64,7 +62,7 @@ impl RedisCommandKind {

// ..

pub fn cmd_str(&self) -> &'static str {
pub fn cmd_str(&self) -> Str {
match *self {
// ..
RedisCommandKind::Mget => "MGET"
Expand All @@ -80,10 +78,11 @@ impl RedisCommandKind {

```rust
pub async fn mget<C: ClientLike>(client: &C, keys: MultipleKeys) -> Result<RedisValue, RedisError> {
// maybe do some kind of validation
utils::check_empty_keys(&keys)?;

let frame = utils::request_response(client, move || {
// time spent here will show up in traces
// time spent here will show up in traces in the `prepare_command` span
Ok((RedisCommandKind::Mget, keys.into_values()))
})
.await?;
Expand All @@ -92,7 +91,7 @@ pub async fn mget<C: ClientLike>(client: &C, keys: MultipleKeys) -> Result<Redis
}
```

Or use one of the shorthand helper functions.
Or use one of the shorthand helper functions or macros.

```rust
pub async fn mget<C: ClientLike>(client: &C, keys: MultipleKeys) -> Result<RedisValue, RedisError> {
Expand Down Expand Up @@ -121,7 +120,7 @@ pub trait KeysInterface: ClientLike {
K: Into<MultipleKeys> + Send,
{
into!(keys);
commands::keys::mget(self, keys).await
commands::keys::mget(self, keys).await?.convert()
}
// ...
}
Expand Down
Loading