Skip to content

Commit

Permalink
Toolchain & Dependency upgrades (#1035)
Browse files Browse the repository at this point in the history
* Upgraded Rust toolchain + cleaned errors
* itertools 14
* Petgraph 0.7
* tokio-tungstenite 0.26
* Few more little libs synced
  • Loading branch information
zaychenko-sergei authored Jan 15, 2025
1 parent 862e947 commit 05bc9fe
Show file tree
Hide file tree
Showing 125 changed files with 486 additions and 406 deletions.
443 changes: 261 additions & 182 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
unreadable-literal-lint-fractions = false
disallowed-macros = ["std::dbg"]
disallowed-names = []

# Note: bug in Clippy, introduced in nightly-2024-12-27
# https://github.com/rust-lang/rust-clippy/issues/13885
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2024-06-13
nightly-2024-12-26
2 changes: 1 addition & 1 deletion src/adapter/auth-oso/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kamu-accounts = { workspace = true }
kamu-core = { workspace = true }

async-trait = "0.1"
dill = "0.10"
dill = "0.11"
oso = "0.27"
oso-derive = "0.27"
tracing = { version = "0.1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/flight-sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ base64 = { version = "0.22", default-features = false }
bytes = { version = "1", default-features = false }
chrono = { version = "0.4", default-features = false }
datafusion = { version = "44", default-features = false }
dill = { version = "0.10", default-features = false }
dill = { version = "0.11", default-features = false }
futures = "0.3"
http = { version = "1", default-features = false }
http-body = { version = "1", default-features = false }
Expand Down
2 changes: 0 additions & 2 deletions src/adapter/flight-sql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

#![feature(lint_reasons)]

mod auth_layer;
mod service;
mod service_wrapper;
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/graphql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ chrono = "0.4"
datafusion = { version = "44", default-features = false, features = [
"serde",
] } # TODO: Currently needed for type conversions but ideally should be encapsulated by kamu-core
dill = "0.10"
dill = "0.11"
futures = "0.3"
secrecy = "0.10"
serde = { version = "1", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/graphql/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl async_graphql::extensions::Extension for TracingExtension {

struct ErrorMessageFormatter<'a>(&'a dyn std::error::Error);

impl<'a> std::fmt::Display for ErrorMessageFormatter<'a> {
impl std::fmt::Display for ErrorMessageFormatter<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut error = Some(self.0);
while let Some(e) = error {
Expand All @@ -82,7 +82,7 @@ impl<'a> std::fmt::Display for ErrorMessageFormatter<'a> {

struct ErrorBacktraceFormatter<'a>(&'a dyn std::error::Error);

impl<'a> std::fmt::Display for ErrorBacktraceFormatter<'a> {
impl std::fmt::Display for ErrorBacktraceFormatter<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// Uses the innermost captured backtrace
let mut error = Some(self.0);
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/graphql/src/queries/flows/flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Flow {
/// Outcome of the flow (Finished state only)
async fn outcome(&self, ctx: &Context<'_>) -> Result<Option<FlowOutcome>> {
Ok(
FlowOutcome::from_maybe_flow_outcome(&self.flow_state.outcome, ctx)
FlowOutcome::from_maybe_flow_outcome(self.flow_state.outcome.as_ref(), ctx)
.await
.int_err()?,
)
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/graphql/src/queries/flows/flow_outcome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) struct FlowFailureReasonInputDatasetCompacted {

impl FlowOutcome {
pub async fn from_maybe_flow_outcome(
outcome_result: &Option<kamu_flow_system::FlowOutcome>,
outcome_result: Option<&kamu_flow_system::FlowOutcome>,
ctx: &Context<'_>,
) -> Result<Option<Self>, InternalError> {
if let Some(value) = outcome_result {
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bytes = "1"
canonical_json = { version = "0.5.0", default-features = false }
chrono = { version = "0.4", features = ["serde"] }
datafusion = { version = "44", default-features = false } # TODO: Currently needed for type conversions but ideally should be encapsulated by kamu-core
dill = "0.10"
dill = "0.11"
ed25519-dalek = { version = "2", default-features = false, features = [
"std",
"fast",
Expand Down Expand Up @@ -83,7 +83,7 @@ tokio-util = { version = "0.7", default-features = false, features = [
"compat",
"io",
] }
tokio-tungstenite = { version = "0.24", features = [
tokio-tungstenite = { version = "0.26", features = [
"rustls-tls-native-roots",
"url",
] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl AxumServerPullProtocolInstance {
self.dataset.as_ref(),
&r,
&self.dataset_url,
&self.maybe_bearer_header,
self.maybe_bearer_header.as_ref(),
)
.await
.protocol_int_err(PullPhase::ObjectsRequest)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl AxumServerPushProtocolInstance {
dataset.as_ref(),
&r,
&self.dataset_url,
&self.maybe_bearer_header,
self.maybe_bearer_header.as_ref(),
)
.await
.protocol_int_err(PushPhase::MetadataRequest)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ pub async fn prepare_pull_object_transfer_strategy(
dataset: &dyn Dataset,
object_file_ref: &ObjectFileReference,
dataset_url: &Url,
maybe_bearer_header: &Option<BearerHeader>,
maybe_bearer_header: Option<&BearerHeader>,
) -> Result<PullObjectTransferStrategy, InternalError> {
let get_download_url_result = match object_file_ref.object_type {
ObjectType::DataSlice => {
Expand Down Expand Up @@ -481,7 +481,7 @@ fn get_simple_transfer_protocol_url(
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

fn get_simple_transfer_protocol_headers(
maybe_bearer_header: &Option<BearerHeader>,
maybe_bearer_header: Option<&BearerHeader>,
version: i32,
) -> Vec<HeaderRow> {
let mut headers = vec![HeaderRow {
Expand Down Expand Up @@ -533,7 +533,7 @@ pub async fn prepare_push_object_transfer_strategy(
dataset: &dyn Dataset,
object_file_ref: &ObjectFileReference,
dataset_url: &Url,
maybe_bearer_header: &Option<BearerHeader>,
maybe_bearer_header: Option<&BearerHeader>,
) -> Result<PushObjectTransferStrategy, InternalError> {
let object_repo = match object_file_ref.object_type {
ObjectType::DataSlice => dataset.as_data_repo(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ async fn write_payload<TMessagePayload: Serialize>(
) -> Result<(), WriteMessageError> {
let payload_as_json_string = ws_common::payload_to_json::<TMessagePayload>(payload)?;

let message = Message::Text(payload_as_json_string);
let message = Message::Text(payload_as_json_string.into());
let send_result = socket.send(message).await;
match send_result {
Ok(_) => Ok(()),
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/http/src/upload/upload_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl Serialize for UploadTokenBase64Json {
}

struct UploadTokenBase64JsonVisitor;
impl<'de> serde::de::Visitor<'de> for UploadTokenBase64JsonVisitor {
impl serde::de::Visitor<'_> for UploadTokenBase64JsonVisitor {
type Value = UploadTokenBase64Json;

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/http/tests/harness/common_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub(crate) async fn commit_add_data_event(
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

pub(crate) fn make_dataset_ref(
account_name: &Option<AccountName>,
account_name: Option<&AccountName>,
dataset_name: &str,
) -> DatasetRef {
match account_name {
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/http/tests/tests/test_account_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async fn test_get_account_info_with_wrong_token() {
let cl = reqwest::Client::new();

let res = cl
.get(&format!("{}accounts/me", harness.root_url))
.get(format!("{}accounts/me", harness.root_url))
.send()
.await
.unwrap();
Expand All @@ -49,7 +49,7 @@ async fn test_get_account_info() {
let cl = reqwest::Client::new();

let res = cl
.get(&format!("{}accounts/me", harness.root_url))
.get(format!("{}accounts/me", harness.root_url))
.header("Authorization", format!("Bearer {DUMMY_ACCESS_TOKEN}"))
.send()
.await
Expand Down
26 changes: 13 additions & 13 deletions src/adapter/http/tests/tests/test_data_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ async fn test_data_query_handler() {

// 1: Defaults - output only
let res = cl
.post(&format!("{}query", harness.root_url))
.post(format!("{}query", harness.root_url))
.json(&json!({
"query": query,
}))
Expand All @@ -382,7 +382,7 @@ async fn test_data_query_handler() {

// 2: Input and schema
let res = cl
.post(&format!("{}query", harness.root_url))
.post(format!("{}query", harness.root_url))
.json(&json!({
"query": query,
"include": ["input", "schema"],
Expand Down Expand Up @@ -427,7 +427,7 @@ async fn test_data_query_handler() {

// 3: Full with proof
let res = cl
.post(&format!("{}query", harness.root_url))
.post(format!("{}query", harness.root_url))
.json(&json!({
"query": query,
"include": ["schema", "proof"],
Expand Down Expand Up @@ -523,7 +523,7 @@ async fn test_data_query_handler() {

// Error: Dataset does not exist
let res = cl
.post(&format!("{}query", harness.root_url))
.post(format!("{}query", harness.root_url))
.json(&json!({
"query": query,
"datasets": [{
Expand All @@ -539,7 +539,7 @@ async fn test_data_query_handler() {

// Error: Block does not exist
let res = cl
.post(&format!("{}query", harness.root_url))
.post(format!("{}query", harness.root_url))
.json(&json!({
"query": query,
"datasets": [{
Expand Down Expand Up @@ -586,7 +586,7 @@ async fn test_data_verify_handler() {

// Get response with proof
let res = cl
.post(&format!("{}query", harness.root_url))
.post(format!("{}query", harness.root_url))
.json(&json!({
"query": query,
"include": ["proof"],
Expand Down Expand Up @@ -641,7 +641,7 @@ async fn test_data_verify_handler() {
request.as_object_mut().unwrap().remove("output");

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&request)
.send()
.await
Expand All @@ -658,7 +658,7 @@ async fn test_data_verify_handler() {
"f1620c3e929e13d3f0f55ce24e7579919e01b356e79b4212a622b4fc2e7b0acb10d0e".into();

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&invalid_request)
.send()
.await
Expand All @@ -683,7 +683,7 @@ async fn test_data_verify_handler() {
"f1620ca4510738395af1429224dd785675309c344b2b549632e20275c69b15ed1d211".into();

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&invalid_request)
.send()
.await
Expand All @@ -708,7 +708,7 @@ async fn test_data_verify_handler() {
"uZbm7fFcWc4l6iyvaKe_txdKntL3h3kvsGHOaKIbPV6c42PH1VnSmpYHMopv4TU68syzgoEdcS26AvpkSQb9dBQ".into();

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&invalid_request)
.send()
.await
Expand Down Expand Up @@ -737,7 +737,7 @@ async fn test_data_verify_handler() {
invalid_request["proof"]["proofValue"] = sig.to_string().into();

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&invalid_request)
.send()
.await
Expand Down Expand Up @@ -780,7 +780,7 @@ async fn test_data_verify_handler() {
invalid_request["proof"]["proofValue"] = sig.to_string().into();

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&invalid_request)
.send()
.await
Expand Down Expand Up @@ -823,7 +823,7 @@ async fn test_data_verify_handler() {
invalid_request["proof"]["proofValue"] = sig.to_string().into();

let res = cl
.post(&format!("{}verify", harness.root_url))
.post(format!("{}verify", harness.root_url))
.json(&invalid_request)
.send()
.await
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/http/tests/tests/test_dataset_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn test_get_dataset_info_by_id() {
let cl = reqwest::Client::new();

let res = cl
.get(&format!(
.get(format!(
"{}datasets/{}",
harness.root_url, create_result.dataset_handle.id
))
Expand Down Expand Up @@ -74,7 +74,7 @@ async fn test_get_dataset_info_by_id_not_found_err() {
let dataset_id = DatasetID::new_seeded_ed25519(b"foo");

let res = cl
.get(&format!("{}datasets/{dataset_id}", harness.root_url))
.get(format!("{}datasets/{dataset_id}", harness.root_url))
.header("Authorization", format!("Bearer {DUMMY_ACCESS_TOKEN}"))
.send()
.await
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/http/tests/tests/test_node_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async fn test_node_info_single_tenant() {
let cl = reqwest::Client::new();

let res = cl
.get(&format!("{}info", harness.root_url))
.get(format!("{}info", harness.root_url))
.send()
.await
.unwrap()
Expand All @@ -48,7 +48,7 @@ async fn test_node_info_multi_tenant() {
let cl = reqwest::Client::new();

let res = cl
.get(&format!("{}info", harness.root_url))
.get(format!("{}info", harness.root_url))
.send()
.await
.unwrap()
Expand Down
Loading

0 comments on commit 05bc9fe

Please sign in to comment.