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
2 changes: 2 additions & 0 deletions src/external_api/devnet_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,6 @@ pub struct YugabyteInfo {
pub master_rpc_port: u16,
/// YSQL port for Postgres-compatible connections
pub ysql_port: u16,
/// YCQL port for Cassandra-compatible connections
pub ycql_port: u16,
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YugabyteInfo is a public struct (re-exported via crate::external_api) and the crate is versioned as 1.x. Adding a new non-optional field is a semver-breaking API change for Rust consumers (struct literals / exhaustive patterns) and also makes deserializing older devnet-info.json (without ycql_port) fail. To keep this extension backward/forward compatible within schema v1, consider making ycql_port an Option<u16> with #[serde(default)] (and populate it as Some(...) in the exporter), or alternatively bump the exported schema version and introduce a v2 struct.

Suggested change
pub ycql_port: u16,
#[serde(default)]
pub ycql_port: Option<u16>,

Copilot uses AI. Check for mistakes.
}
9 changes: 9 additions & 0 deletions src/external_api/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,19 @@ fn build_yugabyte_info(
provider_id
))?;

let ycql_port: u16 = ctx
.get(&format!("yugabyte_{}_ycql_port", provider_id))
.and_then(|p| p.parse().ok())
.ok_or(format!(
"yugabyte_{}_ycql_port not found or invalid in context",
provider_id
))?;

Ok(YugabyteInfo {
web_ui_url: format!("http://localhost:{}", web_ui_port),
master_rpc_port,
ysql_port,
ycql_port,
})
}

Expand Down
Loading