Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
288 changes: 80 additions & 208 deletions .github/workflows/java-cd.yml

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
if: steps.event-check.outputs.event_name == 'pull_request'
shell: bash
run: |
RELEASE="255.255.255"
RELEASE="255.255.255-sncr"
SHOULD_PUB="false"
echo "release_version=$RELEASE" >> $GITHUB_OUTPUT
echo "should_publish=$SHOULD_PUB" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -153,18 +153,18 @@ jobs:
export PLATFORM_MATRIX=$(jq 'map(
select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["npm"])))
| .runner = (
if (.CD_RUNNER != null)
then .CD_RUNNER
elif (.RUNNER != null and (.RUNNER | type != "array")) then .RUNNER
if (.CD_RUNNER != null)
then .CD_RUNNER
elif (.RUNNER != null and (.RUNNER | type != "array")) then .RUNNER
else "ubuntu-latest"
end
)
| .build_type = (
if (.TARGET | contains("musl"))
then "musl"
elif (.TARGET | contains("gnu"))
then "gnu"
else "mac"
if (.TARGET | contains("musl"))
then "musl"
elif (.TARGET | contains("gnu"))
then "gnu"
else "mac"
end
)
| if .RUNNER == "macos13" then .["test-runner"] = "macos13" else . end
Expand Down Expand Up @@ -504,7 +504,7 @@ jobs:
if [[ "${{ matrix.build_type }}" == "gnu" ]]; then
echo "Installing Valkey on GNU/Linux..."
sudo apt update
sudo apt install -y valkey || {
sudo apt install -y valkey || {
echo "Valkey not found in default repos, trying alternative source..."
curl -fsSL https://packages.redis.io/valkey/setup-valkey | sudo bash -
sudo apt install -y valkey || {
Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
elif [[ "$build_type" == "gnu" ]]; then
additional_suffix="-gnu"
fi

package_name="@valkey/valkey-glide-${os}-${arch}${additional_suffix}"
attempt_deprecate "${package_name}@${VERSION}" "${DEPRECATION_MESSAGE}"
else
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 2.1.1-sncr

* JAVA: Multi-platform support with explicitly named libglide_rs runtimes and custom NativeUtils
* Rust: Add RUSTSEC-2025-0141 to ignore list in deny.toml ([#5137](https://github.com/valkey-io/valkey-glide/pull/5137))
* Rust: Add RUSTSEC-2025-0124 to ignore list in deny.toml
* Rust: Migrate from rustls-pemfile usage to rustls-pki-types ([#5037](https://github.com/valkey-io/valkey-glide/pull/5037))
* CORE: LOLWUT Tests and Add Version 9 Support ([#4907](https://github.com/valkey-io/valkey-glide/pull/4907))

## 2.1.1

#### Changes
Expand All @@ -15,7 +23,7 @@
* PYTHON: Add MOVE command support for cluster clients ([#4751](https://github.com/valkey-io/valkey-glide/pull/4751))
* JAVA: Add cluster support for Move command ([#4749])(https://github.com/valkey-io/valkey-glide/pull/4749)

#### Fixes
#### Fixes

* CORE: Fix SELECT Command Database Persistence Across Reconnections ([#4764](https://github.com/valkey-io/valkey-glide/issues/#4764))
* Rust: Updates the `install-rust-and-protoc` action to explicitly include the `rustfmt` and `clippy` components. ([#4816](https://github.com/valkey-io/valkey-glide/issues/4816))
Expand Down
4 changes: 4 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ ignore = [
# suppress this validation until #3226 not resolved
# https://github.com/valkey-io/valkey-glide/issues/3226
"RUSTSEC-2025-0007",
# bincode 1.3.3 is declared complete and used only in dev tooling
"RUSTSEC-2025-0141",
# The `rand_os` crate is deprecated and no longer actively maintained, as `OsRng` is now part of `rand_core`.
"RUSTSEC-2025-0124"
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down
2 changes: 2 additions & 0 deletions glide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ redis = { path = "./redis-rs/redis", features = [
"cluster",
"cluster-async",
] }
rustls = { version = "0.23", features = ["aws-lc-rs"] }
rustls-pki-types = "1.9"
telemetrylib = { path = "./telemetry" }
tokio = { version = "1", features = ["macros", "time"] }
logger_core = { path = "../logger_core" }
Expand Down
3 changes: 1 addition & 2 deletions glide-core/redis-rs/redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ tokio-retry2 = { version = "0.5", features = ["jitter"], optional = true }
rustls = { version = "0.23", features = ["aws-lc-rs"] }
rustls-platform-verifier = { version = "0.6", default-features = false }
tokio-rustls = { version = "0.26", default-features = false }
rustls-pemfile = { version = "2" }
rustls-pki-types = { version = "1" }
rustls-pki-types = { version = "1.9" }

# Only needed for bignum Support
num-bigint = "0.4"
Expand Down
13 changes: 7 additions & 6 deletions glide-core/redis-rs/redis/src/cluster_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ where
}

/// Send commands in `pipeline` to the given `route`. If `route` is [None], it will be computed from `pipeline`.
/// - `pipeline_retry_strategy`: Configures retry behavior for pipeline commands.
/// - `retry_server_error`: If `true`, retries commands on server errors (may cause reordering).
/// - `retry_connection_error`: If `true`, retries on connection errors (may lead to duplicate executions).
/// - `pipeline_retry_strategy`: Configures retry behavior for pipeline commands.
/// - `retry_server_error`: If `true`, retries commands on server errors (may cause reordering).
/// - `retry_connection_error`: If `true`, retries on connection errors (may lead to duplicate executions).
/// TODO: add wiki link.
pub async fn route_pipeline<'a>(
&'a mut self,
Expand Down Expand Up @@ -609,6 +609,7 @@ pub(crate) enum InternalSingleNodeRouting<C> {
},
}

#[allow(clippy::derivable_impls)]
impl<C> Default for InternalSingleNodeRouting<C> {
fn default() -> Self {
Self::Random
Expand Down Expand Up @@ -653,9 +654,9 @@ enum CmdArg<C> {
count: usize,
route: Option<InternalSingleNodeRouting<C>>,
sub_pipeline: bool,
/// Configures retry behavior for pipeline commands.
/// - `retry_server_error`: If `true`, retries commands on server errors (may cause reordering).
/// - `retry_connection_error`: If `true`, retries on connection errors (may lead to duplicate executions).
/// Configures retry behavior for pipeline commands.
/// - `retry_server_error`: If `true`, retries commands on server errors (may cause reordering).
/// - `retry_connection_error`: If `true`, retries on connection errors (may lead to duplicate executions).
pipeline_retry_strategy: PipelineRetryStrategy,
},
ClusterScan {
Expand Down
1 change: 1 addition & 0 deletions glide-core/redis-rs/redis/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ fn setup_connection(
}
}

#[allow(clippy::unnecessary_unwrap)]
if connection_info.client_name.is_some() {
match cmd("CLIENT")
.arg("SETNAME")
Expand Down
43 changes: 27 additions & 16 deletions glide-core/redis-rs/redis/src/tls.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::io::{BufRead, Error, ErrorKind as IOErrorKind};
use std::io::{Error, ErrorKind as IOErrorKind};

use rustls::RootCertStore;
use rustls_pki_types::pem::PemObject;
use rustls_pki_types::{CertificateDer, PrivateKeyDer};

use crate::{Client, ConnectionAddr, ConnectionInfo, ErrorKind, RedisError, RedisResult};
Expand Down Expand Up @@ -69,18 +70,22 @@ pub(crate) fn retrieve_tls_certificates(
client_key,
}) = client_tls
{
let buf = &mut client_cert.as_slice() as &mut dyn BufRead;
let certs = rustls_pemfile::certs(buf);
let client_cert_chain = certs.collect::<Result<Vec<_>, _>>()?;

let client_key =
rustls_pemfile::private_key(&mut client_key.as_slice() as &mut dyn BufRead)?
.ok_or_else(|| {
Error::new(
IOErrorKind::Other,
"Unable to extract private key from PEM file",
)
})?;
// Parse certificates using rustls-pki-types v1.9.0+ API
let certs = CertificateDer::pem_slice_iter(&client_cert);
let client_cert_chain = certs.collect::<Result<Vec<_>, _>>().map_err(|e| {
Error::new(
IOErrorKind::Other,
format!("Failed to parse certificate: {}", e),
)
})?;

// Parse private key using rustls-pki-types v1.9.0+ API
let client_key = PrivateKeyDer::from_pem_slice(&client_key).map_err(|e| {
Error::new(
IOErrorKind::Other,
format!("Failed to parse private key: {}", e),
)
})?;

Some(ClientTlsParams {
client_cert_chain,
Expand All @@ -91,11 +96,17 @@ pub(crate) fn retrieve_tls_certificates(
};

let root_cert_store = if let Some(root_cert) = root_cert {
let buf = &mut root_cert.as_slice() as &mut dyn BufRead;
let certs = rustls_pemfile::certs(buf);
// Parse root certificates using rustls-pki-types v1.9.0+ API
let certs = CertificateDer::pem_slice_iter(&root_cert);
let mut root_cert_store = RootCertStore::empty();
for result in certs {
if root_cert_store.add(result?.to_owned()).is_err() {
let cert = result.map_err(|e| {
Error::new(
IOErrorKind::Other,
format!("Failed to parse root certificate: {}", e),
)
})?;
if root_cert_store.add(cert.to_owned()).is_err() {
return Err(
Error::new(IOErrorKind::Other, "Unable to parse TLS trust anchors").into(),
);
Expand Down
1 change: 1 addition & 0 deletions glide-core/tests/utilities/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ fn set_connection_info_to_connection_request(
connection_request: &mut connection_request::ConnectionRequest,
) {
connection_request.protocol = convert_to_protobuf_protocol(connection_info.protocol).into();
#[allow(clippy::unnecessary_unwrap)]
if connection_info.password.is_some() {
connection_request.authentication_info =
protobuf::MessageField(Some(Box::new(AuthenticationInfo {
Expand Down
46 changes: 46 additions & 0 deletions go/integTest/cluster_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,52 @@ func (suite *GlideTestSuite) TestLolwutWithOptions_WithRandomRoute() {
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, singleValue)
}

func (suite *GlideTestSuite) TestLolwutWithOptions_Version9_AllNodes() {
client := suite.defaultClusterClient()
// Test LOLWUT version 9 (available in Valkey 9.0.0+)
if suite.serverVersion >= "9.0.0" {
options := options.ClusterLolwutOptions{
LolwutOptions: &options.LolwutOptions{
Version: 9,
Args: []int{30, 4},
},
RouteOption: &options.RouteOption{Route: config.AllNodes},
}
result, err := client.LolwutWithOptions(context.Background(), options)
assert.NoError(suite.T(), err)
assert.True(suite.T(), result.IsMultiValue())
multiValue := result.MultiValue()
for _, value := range multiValue {
hasVer := strings.Contains(value, "ver")
hasVersion := strings.Contains(value, suite.serverVersion)
assert.True(suite.T(), hasVer && hasVersion,
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, value)
}
}
}

func (suite *GlideTestSuite) TestLolwutWithOptions_Version9_RandomNode() {
client := suite.defaultClusterClient()
// Test LOLWUT version 9 (available in Valkey 9.0.0+)
if suite.serverVersion >= "9.0.0" {
options := options.ClusterLolwutOptions{
LolwutOptions: &options.LolwutOptions{
Version: 9,
Args: []int{40, 20, 1, 2},
},
RouteOption: &options.RouteOption{Route: config.RandomRoute},
}
result, err := client.LolwutWithOptions(context.Background(), options)
assert.NoError(suite.T(), err)
assert.True(suite.T(), result.IsSingleValue())
singleValue := result.SingleValue()
hasVer := strings.Contains(singleValue, "ver")
hasVersion := strings.Contains(singleValue, suite.serverVersion)
assert.True(suite.T(), hasVer && hasVersion,
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, singleValue)
}
}

func (suite *GlideTestSuite) TestClientIdCluster() {
client := suite.defaultClusterClient()
t := suite.T()
Expand Down
28 changes: 28 additions & 0 deletions go/integTest/standalone_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,34 @@ func (suite *GlideTestSuite) TestLolwutWithOptions_EmptyArgs() {
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, res)
}

func (suite *GlideTestSuite) TestLolwutWithOptions_Version9_TwoParams() {
client := suite.defaultClient()
// Test LOLWUT version 9 (available in Valkey 9.0.0+)
if suite.serverVersion >= "9.0.0" {
opts := options.NewLolwutOptions(9).SetArgs([]int{30, 4})
res, err := client.LolwutWithOptions(context.Background(), *opts)
assert.NoError(suite.T(), err)
hasVer := strings.Contains(res, "ver")
hasVersion := strings.Contains(res, suite.serverVersion)
assert.True(suite.T(), hasVer && hasVersion,
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, res)
}
}

func (suite *GlideTestSuite) TestLolwutWithOptions_Version9_FourParams() {
client := suite.defaultClient()
// Test LOLWUT version 9 (available in Valkey 9.0.0+)
if suite.serverVersion >= "9.0.0" {
opts := options.NewLolwutOptions(9).SetArgs([]int{40, 20, 1, 2})
res, err := client.LolwutWithOptions(context.Background(), *opts)
assert.NoError(suite.T(), err)
hasVer := strings.Contains(res, "ver")
hasVersion := strings.Contains(res, suite.serverVersion)
assert.True(suite.T(), hasVer && hasVersion,
"Expected output to contain 'ver' and version '%s', got: %s", suite.serverVersion, res)
}
}

func (suite *GlideTestSuite) TestClientId() {
client := suite.defaultClient()
result, err := client.ClientId(context.Background())
Expand Down
4 changes: 2 additions & 2 deletions java/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Some troubleshooting issues:

An example app (`glide.examples.ExamplesApp`) is available under [examples project](../examples/java). To run the ExamplesApp against a local build of valkey-glide client, you can publish your JAR to local Maven repository as a dependency.

To publish to local maven run (default version `255.255.255`):
To publish to local maven run (default version `255.255.255-sncr`):

```bash
# Run from the `examples/java` folder
Expand All @@ -193,7 +193,7 @@ repositories {
}
dependencies {
// Update to use version defined in the previous step
implementation group: 'io.valkey', name: 'valkey-glide', version: '255.255.255'
implementation group: 'io.valkey', name: 'valkey-glide', version: '255.255.255-sncr'
}
```

Expand Down
2 changes: 1 addition & 1 deletion java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ subprojects {
}

ext {
defaultReleaseVersion = "255.255.255"
defaultReleaseVersion = "255.255.255-sncr"
failedTests = []
}

Expand Down
Loading