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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed

- Replace the deprecated `serde_yaml` crate with the maintained `yaml_serde` fork ([#123]).

[#123]: https://github.com/stackabletech/trino-lb/pull/123

## [0.7.0] - 2026-08-03

### Changed
Expand Down
50 changes: 25 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ rustls = "0.23"
rstest = "0.26"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
serde_yaml = "0.9"
snafu = "0.9"
# 0.7.4 is the first release that includes https://github.com/launchbadge/sqlx/pull/2927
sqlx = { version = "0.9", features = [
Expand All @@ -100,6 +99,7 @@ trait-variant = "0.1"
trino-rust-client = "0.11"
url = { version = "2.5", features = ["serde"] }
urlencoding = "2.1"
yaml_serde = "0.10"

# For trino-lb-bench
indicatif = "0.18"
2 changes: 1 addition & 1 deletion trino-lb-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ opentelemetry-otlp.workspace = true
rand.workspace = true
reqwest.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
serde.workspace = true
snafu.workspace = true
strum.workspace = true
tracing.workspace = true
trino-rust-client.workspace = true
url.workspace = true
yaml_serde.workspace = true

[dev-dependencies]
rstest.workspace = true
8 changes: 4 additions & 4 deletions trino-lb-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum Error {

#[snafu(display("Failed to parse configuration file at {config_file:?}"))]
ParseConfigFile {
source: serde_yaml::Error,
source: yaml_serde::Error,
config_file: PathBuf,
},
}
Expand Down Expand Up @@ -361,14 +361,14 @@ pub struct StackableCluster {
}

impl Config {
/// Using [`std::fs::File`] over `tokio::fs::File`, as [`serde_yaml::from_reader`] does not support
/// Using [`std::fs::File`] over `tokio::fs::File`, as [`yaml_serde::from_reader`] does not support
/// async yet (?). Should not matter, as we only read the config once during startup.
pub async fn read_from_file(config_file: &PathBuf) -> Result<Self, Error> {
let config_file_content =
File::open(config_file).context(ReadConfigFileSnafu { config_file })?;

let deserializer = serde_yaml::Deserializer::from_reader(config_file_content);
serde_yaml::with::singleton_map_recursive::deserialize(deserializer)
let deserializer = yaml_serde::Deserializer::from_reader(config_file_content);
yaml_serde::with::singleton_map_recursive::deserialize(deserializer)
.context(ParseConfigFileSnafu { config_file })
}
}
Expand Down
2 changes: 1 addition & 1 deletion trino-lb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ regex.workspace = true
reqwest.workspace = true
rustls.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
serde.workspace = true
snafu.workspace = true
strum.workspace = true
Expand All @@ -56,6 +55,7 @@ tracing.workspace = true
trino-rust-client.workspace = true
url.workspace = true
urlencoding.workspace = true
yaml_serde.workspace = true

[dev-dependencies]
indoc.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions trino-lb/src/routing/client_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ mod tests {
#[case] x_trino_client_tags: Option<&str>,
#[case] expected: Option<&str>,
) {
let config = serde_yaml::from_str(
let config = yaml_serde::from_str(
r#"
trinoClusterGroup: my-target
oneOf: ["foo", "bar", "bak", "system=airflow"]
Expand Down Expand Up @@ -135,7 +135,7 @@ mod tests {
#[case] x_trino_client_tags: Option<&str>,
#[case] expected: Option<&str>,
) {
let config = serde_yaml::from_str(
let config = yaml_serde::from_str(
r#"
trinoClusterGroup: my-target
allOf: ["foo", "bar", "bak", "system=airflow"]
Expand All @@ -161,7 +161,7 @@ mod tests {
/// Seems like whatever comes first takes precedence
#[test]
fn test_configuring_one_of_and_all_of() {
let config: ClientTagsRouterConfig = serde_yaml::from_str(
let config: ClientTagsRouterConfig = yaml_serde::from_str(
r#"
trinoClusterGroup: my-target
allOf: ["allOf"]
Expand All @@ -174,7 +174,7 @@ mod tests {
TagMatchingStrategy::AllOf(_)
));

let config: ClientTagsRouterConfig = serde_yaml::from_str(
let config: ClientTagsRouterConfig = yaml_serde::from_str(
r#"
trinoClusterGroup: my-target
oneOf: ["oneOf"]
Expand Down
4 changes: 2 additions & 2 deletions trino-lb/src/routing/trino_routing_group_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mod tests {
#[case(Some("bar,bak"))]
#[tokio::test]
async fn test_standard_header(#[case] x_trino_routing_group: Option<&str>) {
let config = serde_yaml::from_str("").unwrap();
let config = yaml_serde::from_str("").unwrap();
let valid_target_groups = HashSet::from(["foo".to_string(), "bar,bak".to_string()]);
let router = TrinoRoutingGroupHeaderRouter::new(&config, valid_target_groups);

Expand Down Expand Up @@ -115,7 +115,7 @@ mod tests {

#[tokio::test]
async fn test_target_group_does_not_exist() {
let config = serde_yaml::from_str("").unwrap();
let config = yaml_serde::from_str("").unwrap();
let valid_target_groups = HashSet::from(["foo".to_string()]);
let router = TrinoRoutingGroupHeaderRouter::new(&config, valid_target_groups);

Expand Down
Loading