From 791cbcc7ed3781b5ba1142ea67b1f6f6dda357d3 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 13:45:25 +0200 Subject: [PATCH 01/22] ci: add missing lints to datafusion_util This crate was missing some of the common lints we use everywhere else. --- datafusion_util/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/datafusion_util/src/lib.rs b/datafusion_util/src/lib.rs index 967d0bac21..284f2f17a4 100644 --- a/datafusion_util/src/lib.rs +++ b/datafusion_util/src/lib.rs @@ -1,4 +1,12 @@ -#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![deny( + clippy::future_not_send, + clippy::todo, + clippy::dbg_macro, + clippy::clone_on_ref_ptr, + rustdoc::broken_intra_doc_links, + rustdoc::bare_urls, + rust_2018_idioms +)] #![allow(clippy::clone_on_ref_ptr)] //! This module contains various DataFusion utility functions. From e74efae118940a8b04e900fedf1ae19a460d6039 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 13:50:27 +0200 Subject: [PATCH 02/22] refactor(lints): add missing lints to flightsql Adds the standard lints to flightsql and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs. --- flightsql/src/cmd.rs | 30 +++++++++++++++--------------- flightsql/src/error.rs | 4 ++-- flightsql/src/lib.rs | 14 ++++++++++++++ flightsql/src/planner.rs | 6 +++--- flightsql/src/sql_info/mod.rs | 2 +- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/flightsql/src/cmd.rs b/flightsql/src/cmd.rs index 7e8df8d999..586a095b4f 100644 --- a/flightsql/src/cmd.rs +++ b/flightsql/src/cmd.rs @@ -55,7 +55,7 @@ impl Display for PreparedStatementHandle { /// Encode a PreparedStatementHandle as Bytes impl From for Bytes { fn from(value: PreparedStatementHandle) -> Self { - Bytes::from(value.query.into_bytes()) + Self::from(value.query.into_bytes()) } } @@ -303,26 +303,26 @@ impl FlightSQLCommand { // Encode the command as a flightsql message (bytes) pub fn try_encode(self) -> Result { let msg = match self { - FlightSQLCommand::CommandStatementQuery(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandPreparedStatementQuery(handle) => { + Self::CommandStatementQuery(cmd) => Any::pack(&cmd), + Self::CommandPreparedStatementQuery(handle) => { let prepared_statement_handle = handle.encode(); let cmd = CommandPreparedStatementQuery { prepared_statement_handle, }; Any::pack(&cmd) } - FlightSQLCommand::CommandGetSqlInfo(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetCatalogs(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetCrossReference(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetDbSchemas(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetExportedKeys(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetImportedKeys(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetPrimaryKeys(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetTables(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetTableTypes(cmd) => Any::pack(&cmd), - FlightSQLCommand::CommandGetXdbcTypeInfo(cmd) => Any::pack(&cmd), - FlightSQLCommand::ActionCreatePreparedStatementRequest(cmd) => Any::pack(&cmd), - FlightSQLCommand::ActionClosePreparedStatementRequest(handle) => { + Self::CommandGetSqlInfo(cmd) => Any::pack(&cmd), + Self::CommandGetCatalogs(cmd) => Any::pack(&cmd), + Self::CommandGetCrossReference(cmd) => Any::pack(&cmd), + Self::CommandGetDbSchemas(cmd) => Any::pack(&cmd), + Self::CommandGetExportedKeys(cmd) => Any::pack(&cmd), + Self::CommandGetImportedKeys(cmd) => Any::pack(&cmd), + Self::CommandGetPrimaryKeys(cmd) => Any::pack(&cmd), + Self::CommandGetTables(cmd) => Any::pack(&cmd), + Self::CommandGetTableTypes(cmd) => Any::pack(&cmd), + Self::CommandGetXdbcTypeInfo(cmd) => Any::pack(&cmd), + Self::ActionCreatePreparedStatementRequest(cmd) => Any::pack(&cmd), + Self::ActionClosePreparedStatementRequest(handle) => { let prepared_statement_handle = handle.encode(); Any::pack(&ActionClosePreparedStatementRequest { prepared_statement_handle, diff --git a/flightsql/src/error.rs b/flightsql/src/error.rs index 85ea467631..bc13a90c66 100644 --- a/flightsql/src/error.rs +++ b/flightsql/src/error.rs @@ -44,8 +44,8 @@ impl From for DataFusionError { fn from(value: Error) -> Self { match value { Error::DataFusion { source } => source, - Error::Arrow { source } => DataFusionError::ArrowError(source), - value => DataFusionError::External(Box::new(value)), + Error::Arrow { source } => Self::ArrowError(source), + value => Self::External(Box::new(value)), } } } diff --git a/flightsql/src/lib.rs b/flightsql/src/lib.rs index ec1da4b144..4188e34a63 100644 --- a/flightsql/src/lib.rs +++ b/flightsql/src/lib.rs @@ -1,4 +1,18 @@ //! InfluxDB IOx implementation of FlightSQL + +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, + // Allow missing docs - there's lots missing! +)] + mod cmd; mod error; mod get_catalogs; diff --git a/flightsql/src/planner.rs b/flightsql/src/planner.rs index f917795c38..4b00fbd00a 100644 --- a/flightsql/src/planner.rs +++ b/flightsql/src/planner.rs @@ -46,7 +46,7 @@ impl FlightSQLPlanner { /// Returns the schema, in Arrow IPC encoded form, for the request in msg. pub async fn get_flight_info( - namespace_name: impl Into, + namespace_name: impl Into + Send, cmd: FlightSQLCommand, ctx: &IOxSessionContext, ) -> Result { @@ -101,7 +101,7 @@ impl FlightSQLPlanner { /// Returns a plan that computes results requested in msg pub async fn do_get( - namespace_name: impl Into, + namespace_name: impl Into + Send, _database: Arc, cmd: FlightSQLCommand, ctx: &IOxSessionContext, @@ -261,7 +261,7 @@ impl FlightSQLPlanner { /// the [`arrow_flight::Result`] (not the same as a rust /// [`Result`]!) pub async fn do_action( - namespace_name: impl Into, + namespace_name: impl Into + Send, _database: Arc, cmd: FlightSQLCommand, ctx: &IOxSessionContext, diff --git a/flightsql/src/sql_info/mod.rs b/flightsql/src/sql_info/mod.rs index 35d8afbb65..204312cb72 100644 --- a/flightsql/src/sql_info/mod.rs +++ b/flightsql/src/sql_info/mod.rs @@ -86,7 +86,7 @@ impl SqlInfoList { let mut name_builder = UInt32Builder::new(); let mut value_builder = SqlInfoUnionBuilder::new(); - for (&name, value) in self.infos.iter() { + for (&name, value) in &self.infos { name_builder.append_value(name); value_builder.append_value(value) } From 456cf2160b15dcfe44579f8ca7345b845ee2843a Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 13:55:39 +0200 Subject: [PATCH 03/22] ci: add missing lints to ingester_query_grpc This crate was missing some of the common lints we use everywhere else. --- ingester_query_grpc/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ingester_query_grpc/src/lib.rs b/ingester_query_grpc/src/lib.rs index 8c6b4f1a0e..0b23412e90 100644 --- a/ingester_query_grpc/src/lib.rs +++ b/ingester_query_grpc/src/lib.rs @@ -1,7 +1,17 @@ // This crate deliberately does not use the same linting rules as the other // crates because of all the generated code it contains that we don't have much // control over. -#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)] +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] #![allow(clippy::derive_partial_eq_without_eq, clippy::needless_borrow)] use crate::influxdata::iox::ingester::v1 as proto; @@ -16,6 +26,7 @@ use snafu::{ResultExt, Snafu}; /// This module imports the generated protobuf code into a Rust module /// hierarchy that matches the namespace hierarchy of the protobuf /// definitions +#[allow(clippy::use_self)] pub mod influxdata { pub mod iox { pub mod ingester { From adb135d47c5a02302a72c8293c512adbe6175b55 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 13:58:40 +0200 Subject: [PATCH 04/22] ci: add missing lints to iox_query_influxrpc This crate was missing some of the common lints we use everywhere else. --- iox_query_influxrpc/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iox_query_influxrpc/src/lib.rs b/iox_query_influxrpc/src/lib.rs index 444ce71c99..aafa3a7559 100644 --- a/iox_query_influxrpc/src/lib.rs +++ b/iox_query_influxrpc/src/lib.rs @@ -1,5 +1,18 @@ //! Query frontend for InfluxDB Storage gRPC requests +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_copy_implementations, + missing_debug_implementations, +)] + use arrow::datatypes::DataType; use data_types::ChunkId; use datafusion::{ From 8f49aabc563c7ba6ca8b947e2f60fc58a22fbe32 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:01:31 +0200 Subject: [PATCH 05/22] refactor(lints): add missing lints to ioxd_common Adds the standard lints to ioxd_common and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- ioxd_common/src/http/test_utils.rs | 1 + ioxd_common/src/lib.rs | 12 ++++++++++++ ioxd_common/src/service.rs | 1 + 3 files changed, 14 insertions(+) diff --git a/ioxd_common/src/http/test_utils.rs b/ioxd_common/src/http/test_utils.rs index b0fa5fb9b7..7066716c6e 100644 --- a/ioxd_common/src/http/test_utils.rs +++ b/ioxd_common/src/http/test_utils.rs @@ -83,6 +83,7 @@ pub fn get_content_type(response: &Result) -> } } +#[derive(Debug)] pub struct TestServer where M: ServerType, diff --git a/ioxd_common/src/lib.rs b/ioxd_common/src/lib.rs index 3fa3701d0a..0e4566232b 100644 --- a/ioxd_common/src/lib.rs +++ b/ioxd_common/src/lib.rs @@ -1,3 +1,15 @@ +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + pub mod http; pub mod rpc; pub mod server_type; diff --git a/ioxd_common/src/service.rs b/ioxd_common/src/service.rs index d4af18a2cf..6f1bf84035 100644 --- a/ioxd_common/src/service.rs +++ b/ioxd_common/src/service.rs @@ -5,6 +5,7 @@ use clap_blocks::{run_config::RunConfig, socket_addr::SocketAddr}; use crate::server_type::ServerType; /// A service that will start on the specified addresses +#[derive(Debug)] pub struct Service { pub http_bind_address: Option, pub grpc_bind_address: SocketAddr, From e15b57a3aa36faeba8092436382568d4bdcdd7b7 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:04:06 +0200 Subject: [PATCH 06/22] refactor(lints): add missing lints to ioxd_compactor Adds the standard lints to ioxd_compactor and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- ioxd_compactor/src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ioxd_compactor/src/lib.rs b/ioxd_compactor/src/lib.rs index 78fe14f592..069b207cc7 100644 --- a/ioxd_compactor/src/lib.rs +++ b/ioxd_compactor/src/lib.rs @@ -1,3 +1,15 @@ +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use async_trait::async_trait; use backoff::BackoffConfig; use clap_blocks::compactor::{CompactionType, CompactorConfig}; @@ -110,7 +122,7 @@ pub enum IoxHttpError { impl IoxHttpError { fn status_code(&self) -> HttpApiErrorCode { match self { - IoxHttpError::NotFound => HttpApiErrorCode::NotFound, + Self::NotFound => HttpApiErrorCode::NotFound, } } } From e33c17c6f73d459e5293619cae82c7205984d141 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:07:05 +0200 Subject: [PATCH 07/22] refactor(lints): add missing lints to ioxd_ingester Adds the standard lints to ioxd_ingester and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- ioxd_ingester/src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ioxd_ingester/src/lib.rs b/ioxd_ingester/src/lib.rs index c0d7f3d7b2..28d8ba6cf0 100644 --- a/ioxd_ingester/src/lib.rs +++ b/ioxd_ingester/src/lib.rs @@ -1,3 +1,15 @@ +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use arrow_flight::flight_service_server::FlightServiceServer; use async_trait::async_trait; use clap_blocks::ingester::IngesterConfig; @@ -162,7 +174,7 @@ pub enum IoxHttpError { impl IoxHttpError { fn status_code(&self) -> HttpApiErrorCode { match self { - IoxHttpError::NotFound => HttpApiErrorCode::NotFound, + Self::NotFound => HttpApiErrorCode::NotFound, } } } From 45ddeaa25e46f2dc4b8aebab29a5fd70c0308337 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:10:22 +0200 Subject: [PATCH 08/22] refactor(lints): add missing lints to ioxd_querier Adds the standard lints to ioxd_querier and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- ioxd_querier/src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ioxd_querier/src/lib.rs b/ioxd_querier/src/lib.rs index 805e901287..cacf426e8a 100644 --- a/ioxd_querier/src/lib.rs +++ b/ioxd_querier/src/lib.rs @@ -1,3 +1,15 @@ +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use async_trait::async_trait; use authz::{Authorizer, IoxAuthorizer}; use clap_blocks::querier::QuerierConfig; @@ -131,7 +143,7 @@ pub enum IoxHttpError { impl IoxHttpError { fn status_code(&self) -> HttpApiErrorCode { match self { - IoxHttpError::NotFound => HttpApiErrorCode::NotFound, + Self::NotFound => HttpApiErrorCode::NotFound, } } } From 86b5dd20f5c95e328f909c88b0e3bd9adf55cc25 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:20:18 +0200 Subject: [PATCH 09/22] ci: add missing lints to iox_query_influxrpc This crate was missing some of the common lints we use everywhere else. --- ioxd_router/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ioxd_router/src/lib.rs b/ioxd_router/src/lib.rs index b4ba3235e1..501da9ee12 100644 --- a/ioxd_router/src/lib.rs +++ b/ioxd_router/src/lib.rs @@ -1,3 +1,15 @@ +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use std::{ fmt::{Debug, Display}, sync::Arc, From 17c5f8d0b59e936ceddf01e4c51860f66030a73c Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:26:07 +0200 Subject: [PATCH 10/22] ci: add missing lints to ioxd_test This crate was missing some of the common lints we use everywhere else. --- ioxd_test/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ioxd_test/src/lib.rs b/ioxd_test/src/lib.rs index 9b390ad480..b2da623315 100644 --- a/ioxd_test/src/lib.rs +++ b/ioxd_test/src/lib.rs @@ -1,3 +1,15 @@ +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use std::sync::Arc; use async_trait::async_trait; From 29ab3a2913c11749ebf3ba2b595fcfa417f30ac1 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:29:12 +0200 Subject: [PATCH 11/22] refactor(lints): add missing lints to logfmt Adds the standard lints to logfmt and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- logfmt/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/logfmt/src/lib.rs b/logfmt/src/lib.rs index b4fbfbc8e4..5c5ba8437a 100644 --- a/logfmt/src/lib.rs +++ b/logfmt/src/lib.rs @@ -1,4 +1,14 @@ #![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro +)] use observability_deps::tracing::{ self, @@ -19,6 +29,7 @@ use tracing_subscriber::{fmt::MakeWriter, layer::Context, registry::LookupSpan, /// looked very small and did not (obviously) work with the tracing subscriber /// /// [logfmt]: https://brandur.org/logfmt +#[derive(Debug)] pub struct LogFmtLayer where W: for<'writer> MakeWriter<'writer>, From a6147dd03b1cb180030ec656d270bbf7be27d5e9 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:34:09 +0200 Subject: [PATCH 12/22] ci: add missing lints to object_store_metrics This crate was missing some of the common lints we use everywhere else. --- object_store_metrics/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/object_store_metrics/src/lib.rs b/object_store_metrics/src/lib.rs index 84869112b5..16171bbebf 100644 --- a/object_store_metrics/src/lib.rs +++ b/object_store_metrics/src/lib.rs @@ -1,5 +1,18 @@ //! A metric instrumentation wrapper over [`ObjectStore`] implementations. +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro, +)] + use std::ops::Range; use std::sync::Arc; use std::{ From 4f84b2122cb8c23836d2d7514254c74bbb531181 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:38:51 +0200 Subject: [PATCH 13/22] refactor(lints): add missing lints to parquet_to_line_protocol Adds the standard lints to parquet_to_line_protocol and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- parquet_to_line_protocol/src/lib.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/parquet_to_line_protocol/src/lib.rs b/parquet_to_line_protocol/src/lib.rs index 9c48d7d910..59ed3ffffe 100644 --- a/parquet_to_line_protocol/src/lib.rs +++ b/parquet_to_line_protocol/src/lib.rs @@ -1,5 +1,18 @@ //! Code that can convert between parquet files and line protocol +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro, +)] + use datafusion::{ arrow::datatypes::SchemaRef as ArrowSchemaRef, datasource::{ @@ -94,7 +107,7 @@ pub enum Error { /// protocol (aka lines are not split across the buffers) pub async fn convert_file

(path: P) -> Result>>> where - P: AsRef, + P: AsRef + Send, { let path = path.as_ref(); let object_store_path = @@ -172,6 +185,18 @@ pub struct ParquetFileReader { session_ctx: SessionContext, } +impl std::fmt::Debug for ParquetFileReader { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ParquetFileReader") + .field("object_store", &self.object_store) + .field("object_store_url", &self.object_store_url) + .field("object_meta", &self.object_meta) + .field("schema", &self.schema) + .field("session_ctx", &"") + .finish() + } +} + impl ParquetFileReader { /// Find and open the specified parquet file, and read its metadata / schema pub async fn try_new( From 7bddba8eae6ede22ef774903c7f020d8989930b6 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:41:07 +0200 Subject: [PATCH 14/22] ci: add missing lints to schema This crate was missing some of the common lints we use everywhere else. --- schema/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schema/src/lib.rs b/schema/src/lib.rs index f755a0c117..642de4dfb0 100644 --- a/schema/src/lib.rs +++ b/schema/src/lib.rs @@ -1,4 +1,18 @@ //! This module contains the schema definition for IOx + +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro +)] + use std::{ cmp::Ordering, collections::HashMap, From bc95c70144b3fa9a07f4a69c136dc9924a697f4f Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:44:48 +0200 Subject: [PATCH 15/22] refactor(lints): add missing lints to service_common Adds the standard lints to service_common and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- service_common/src/lib.rs | 13 +++++++++ service_common/src/planner.rs | 54 +++++++++++++++++------------------ 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/service_common/src/lib.rs b/service_common/src/lib.rs index 34c922f372..c92e3cae1d 100644 --- a/service_common/src/lib.rs +++ b/service_common/src/lib.rs @@ -1,5 +1,18 @@ //! Common methods for RPC service implementations +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro, +)] + mod error; pub mod planner; pub mod test_util; diff --git a/service_common/src/planner.rs b/service_common/src/planner.rs index d7d38b0ef9..35aa29af4f 100644 --- a/service_common/src/planner.rs +++ b/service_common/src/planner.rs @@ -18,10 +18,10 @@ use predicate::rpc_predicate::InfluxRpcPredicate; /// Query planner that plans queries on a separate threadpool. /// -/// Query planning was, at time of writing, a single threaded -/// affair. In order to avoid tying up the tokio executor that is -/// handling API requests, IOx plan queries using a separate thread -/// pool. +/// Query planning was, at time of writing, a single threaded affair. In order +/// to avoid tying up the tokio executor that is handling API requests, IOx plan +/// queries using a separate thread pool. +#[derive(Debug)] pub struct Planner { /// Executors (whose threadpool to use) ctx: IOxSessionContext, @@ -62,12 +62,11 @@ impl Planner { .await } - /// Creates a plan for a `DoGet` FlightSQL message, - /// as described on [`FlightSQLPlanner::do_get`], on a - /// separate threadpool + /// Creates a plan for a `DoGet` FlightSQL message, as described on + /// [`FlightSQLPlanner::do_get`], on a separate threadpool pub async fn flight_sql_do_get( &self, - namespace_name: impl Into, + namespace_name: impl Into + Send, namespace: Arc, cmd: FlightSQLCommand, ) -> Result> @@ -86,12 +85,11 @@ impl Planner { .await } - /// Creates a plan for a `DoAction` FlightSQL message, - /// as described on [`FlightSQLPlanner::do_action`], on a - /// separate threadpool + /// Creates a plan for a `DoAction` FlightSQL message, as described on + /// [`FlightSQLPlanner::do_action`], on a separate threadpool pub async fn flight_sql_do_action( &self, - namespace_name: impl Into, + namespace_name: impl Into + Send, namespace: Arc, cmd: FlightSQLCommand, ) -> Result @@ -110,12 +108,12 @@ impl Planner { .await } - /// Creates the response for a `GetFlightInfo` FlightSQL message - /// as described on [`FlightSQLPlanner::get_flight_info`], on a - /// separate threadpool. + /// Creates the response for a `GetFlightInfo` FlightSQL message as + /// described on [`FlightSQLPlanner::get_flight_info`], on a separate + /// threadpool. pub async fn flight_sql_get_flight_info( &self, - namespace_name: impl Into, + namespace_name: impl Into + Send, cmd: FlightSQLCommand, ) -> Result { let namespace_name = namespace_name.into(); @@ -130,8 +128,8 @@ impl Planner { .await } - /// Creates a plan as described on - /// [`InfluxRpcPlanner::table_names`], on a separate threadpool + /// Creates a plan as described on [`InfluxRpcPlanner::table_names`], on a + /// separate threadpool pub async fn table_names( &self, namespace: Arc, @@ -152,8 +150,8 @@ impl Planner { .await } - /// Creates a plan as described on - /// [`InfluxRpcPlanner::tag_keys`], on a separate threadpool + /// Creates a plan as described on [`InfluxRpcPlanner::tag_keys`], on a + /// separate threadpool pub async fn tag_keys( &self, namespace: Arc, @@ -174,8 +172,8 @@ impl Planner { .await } - /// Creates a plan as described on - /// [`InfluxRpcPlanner::tag_values`], on a separate threadpool + /// Creates a plan as described on [`InfluxRpcPlanner::tag_values`], on a + /// separate threadpool pub async fn tag_values( &self, namespace: Arc, @@ -198,8 +196,8 @@ impl Planner { .await } - /// Creates a plan as described on - /// [`InfluxRpcPlanner::field_columns`], on a separate threadpool + /// Creates a plan as described on [`InfluxRpcPlanner::field_columns`], on a + /// separate threadpool pub async fn field_columns( &self, namespace: Arc, @@ -220,8 +218,8 @@ impl Planner { .await } - /// Creates a plan as described on - /// [`InfluxRpcPlanner::read_filter`], on a separate threadpool + /// Creates a plan as described on [`InfluxRpcPlanner::read_filter`], on a + /// separate threadpool pub async fn read_filter( &self, namespace: Arc, @@ -242,8 +240,8 @@ impl Planner { .await } - /// Creates a plan as described on - /// [`InfluxRpcPlanner::read_group`], on a separate threadpool + /// Creates a plan as described on [`InfluxRpcPlanner::read_group`], on a + /// separate threadpool pub async fn read_group( &self, namespace: Arc, From 6acf7f10dddfbab0192a63fe126c3f81038f8c5f Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:51:56 +0200 Subject: [PATCH 16/22] refactor(lints): add missing lints to service_grpc_flight Adds the standard lints to service_grpc_flight and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- service_grpc_flight/src/lib.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/service_grpc_flight/src/lib.rs b/service_grpc_flight/src/lib.rs index 14cd5594e0..f64eb4ca59 100644 --- a/service_grpc_flight/src/lib.rs +++ b/service_grpc_flight/src/lib.rs @@ -1,6 +1,19 @@ //! Implements the InfluxDB IOx Flight API and Arrow FlightSQL, based //! on Arrow Flight and gRPC. See [`FlightService`] for full detail. +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro, +)] + mod request; use arrow::error::ArrowError; @@ -1115,7 +1128,7 @@ mod tests { #[tokio::test] async fn do_get_authz() { let test_storage = Arc::new(TestDatabaseStore::default()); - test_storage.clone().db_or_create("bananas").await; + test_storage.db_or_create("bananas").await; let svc = FlightService { server: Arc::clone(&test_storage), @@ -1217,7 +1230,7 @@ mod tests { #[tokio::test] async fn get_flight_info_authz() { let test_storage = Arc::new(TestDatabaseStore::default()); - test_storage.clone().db_or_create("bananas").await; + test_storage.db_or_create("bananas").await; let svc = FlightService { server: Arc::clone(&test_storage), From b783bb1967a5b7f5ab14a1240cdaa9693c01c0fd Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:56:45 +0200 Subject: [PATCH 17/22] refactor(lints): add missing lints to service_grpc_influxrpc Adds the standard lints to service_grpc_influxrpc and fixes any lint failures. Note this doesn't include the normal "document things" lint, because there's a load of missing docs --- service_grpc_influxrpc/src/expr.rs | 1 + service_grpc_influxrpc/src/lib.rs | 16 +++++++++++++++- service_grpc_influxrpc/src/permit.rs | 1 + .../src/query_completed_token.rs | 7 ++++--- service_grpc_influxrpc/src/service.rs | 4 ++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/service_grpc_influxrpc/src/expr.rs b/service_grpc_influxrpc/src/expr.rs index 915c34310f..e3de7f3dfd 100644 --- a/service_grpc_influxrpc/src/expr.rs +++ b/service_grpc_influxrpc/src/expr.rs @@ -456,6 +456,7 @@ impl InListBuilder { /// Decoded special tag key. /// /// The storage gRPC layer uses magic special bytes to encode measurement name and field name as tag +#[derive(Debug)] pub enum DecodedTagKey { Measurement, Field, diff --git a/service_grpc_influxrpc/src/lib.rs b/service_grpc_influxrpc/src/lib.rs index ae4f3ee879..2869037412 100644 --- a/service_grpc_influxrpc/src/lib.rs +++ b/service_grpc_influxrpc/src/lib.rs @@ -1,4 +1,18 @@ -//! This module contains gRPC service implementation for "InfluxRPC" (aka the storage RPC API used for Flux and InfluxQL) +//! This module contains gRPC service implementation for "InfluxRPC" (aka the +//! storage RPC API used for Flux and InfluxQL) + +#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)] +#![allow(clippy::clone_on_ref_ptr)] +#![warn( + missing_copy_implementations, + missing_debug_implementations, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::clone_on_ref_ptr, + clippy::todo, + clippy::dbg_macro, +)] /// `[0x00]` is the magic value that that the storage gRPC layer uses to /// encode a tag_key that means "measurement name" diff --git a/service_grpc_influxrpc/src/permit.rs b/service_grpc_influxrpc/src/permit.rs index 3041070d6d..58e5f41e6e 100644 --- a/service_grpc_influxrpc/src/permit.rs +++ b/service_grpc_influxrpc/src/permit.rs @@ -3,6 +3,7 @@ use pin_project::pin_project; use tracker::InstrumentedAsyncOwnedSemaphorePermit; /// Helper to keep a semaphore permit attached to a stream. +#[derive(Debug)] #[pin_project] pub struct StreamWithPermit { #[pin] diff --git a/service_grpc_influxrpc/src/query_completed_token.rs b/service_grpc_influxrpc/src/query_completed_token.rs index 0c27e46a89..097877f978 100644 --- a/service_grpc_influxrpc/src/query_completed_token.rs +++ b/service_grpc_influxrpc/src/query_completed_token.rs @@ -7,9 +7,10 @@ use futures::{ready, Stream, StreamExt}; use iox_query::QueryCompletedToken; /// Wraps an inner query stream, calling the `QueryCompletedToken::set_success` on success +#[derive(Debug)] pub struct QueryCompletedTokenStream where - S: Stream> + Unpin, + S: Stream> + Unpin + Send, { inner: S, token: QueryCompletedToken, @@ -18,7 +19,7 @@ where impl QueryCompletedTokenStream where - S: Stream> + Unpin, + S: Stream> + Unpin + Send, { pub fn new(inner: S, token: QueryCompletedToken) -> Self { Self { @@ -31,7 +32,7 @@ where impl Stream for QueryCompletedTokenStream where - S: Stream> + Unpin, + S: Stream> + Unpin + Send, { type Item = Result; diff --git a/service_grpc_influxrpc/src/service.rs b/service_grpc_influxrpc/src/service.rs index 2308593165..3c5cb15861 100644 --- a/service_grpc_influxrpc/src/service.rs +++ b/service_grpc_influxrpc/src/service.rs @@ -308,7 +308,7 @@ enum InfluxCode { } impl Display for InfluxCode { - fn fmt(&self, f: &mut Formatter) -> FmtResult { + fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { let str = match self { InfluxCode::EInternal => "internal error", InfluxCode::ENotFound => "not found", @@ -1705,7 +1705,7 @@ pub fn make_response( permit: InstrumentedAsyncOwnedSemaphorePermit, ) -> Result>>, Status> where - S: Stream> + Unpin, + S: Stream> + Unpin + Send, { let mut response = Response::new(StreamWithPermit::new( QueryCompletedTokenStream::new(stream, token), From 9696b754761a8e4d8d286c8821525f9db46dc04d Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 14:58:25 +0200 Subject: [PATCH 18/22] ci: add missing lints to service_grpc_namespace This crate was missing some of the common lints we use everywhere else. --- service_grpc_namespace/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/service_grpc_namespace/src/lib.rs b/service_grpc_namespace/src/lib.rs index 83efb9f6da..937ca60367 100644 --- a/service_grpc_namespace/src/lib.rs +++ b/service_grpc_namespace/src/lib.rs @@ -1,4 +1,17 @@ //! Implementation of the namespace gRPC service + +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use std::sync::Arc; use data_types::{Namespace as CatalogNamespace, NamespaceName}; From 983a3b44b818e41fb8a9eec740ccc98831df88b7 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 15:01:00 +0200 Subject: [PATCH 19/22] ci: add missing lints to service_grpc_schema This crate was missing some of the common lints we use everywhere else. --- service_grpc_schema/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/service_grpc_schema/src/lib.rs b/service_grpc_schema/src/lib.rs index 76f579b0fe..cd386d6b09 100644 --- a/service_grpc_schema/src/lib.rs +++ b/service_grpc_schema/src/lib.rs @@ -1,5 +1,17 @@ //! Implementation of the schema gRPC service +#![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] +#![warn( + clippy::clone_on_ref_ptr, + clippy::dbg_macro, + clippy::explicit_iter_loop, + // See https://github.com/influxdata/influxdb_iox/pull/1671 + clippy::future_not_send, + clippy::todo, + clippy::use_self, + missing_debug_implementations, +)] + use std::{ops::DerefMut, sync::Arc}; use generated_types::influxdata::iox::schema::v1::*; From 928a4d163ef9bbbb5a274bd1e5b7b1a9da829137 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 15:08:20 +0200 Subject: [PATCH 20/22] build: remove unused dependencies from crates This commit fixes loads of crates (47!) had unused dependencies, or mis-configured dependencies (test deps as normal deps). I added the "unused_crate_dependencies" to all crates to help prevent this mess from growing again! https://doc.rust-lang.org/beta/nightly-rustc/rustc_lint_defs/builtin/static.UNUSED_CRATE_DEPENDENCIES.html This has the minor downside of false-positives when specifying dev-dependencies for test/bench binaries - these are files in /test or /benches (not normal tests). This commit includes a workaround, importing them in lib.rs (gated by a feature flag). I think the trade-off of better dependency management is worth it! --- Cargo.lock | 49 ------------------------ arrow_util/Cargo.toml | 1 - arrow_util/src/lib.rs | 6 ++- authz/src/lib.rs | 6 ++- backoff/src/lib.rs | 7 +++- cache_system/src/lib.rs | 8 +++- clap_blocks/Cargo.toml | 5 --- clap_blocks/src/lib.rs | 7 +++- client_util/src/lib.rs | 6 ++- compactor/src/lib.rs | 6 ++- compactor_test_utils/Cargo.toml | 5 ++- compactor_test_utils/src/lib.rs | 6 ++- data_types/Cargo.toml | 3 -- data_types/src/lib.rs | 6 ++- datafusion_util/src/lib.rs | 6 ++- dml/src/lib.rs | 6 ++- executor/src/lib.rs | 6 ++- flightsql/Cargo.toml | 3 -- flightsql/src/lib.rs | 4 ++ garbage_collector/src/lib.rs | 7 +++- generated_types/Cargo.toml | 6 +-- generated_types/src/lib.rs | 4 ++ grpc-binary-logger-proto/src/lib.rs | 5 +++ grpc-binary-logger-test-proto/Cargo.toml | 1 - grpc-binary-logger-test-proto/src/lib.rs | 5 +++ grpc-binary-logger/src/lib.rs | 12 +++++- import_export/Cargo.toml | 20 ---------- import_export/src/lib.rs | 6 ++- influxdb2_client/src/lib.rs | 11 +++++- influxdb_influxql_parser/src/lib.rs | 6 ++- influxdb_iox/Cargo.toml | 6 +-- influxdb_iox_client/src/lib.rs | 3 +- influxdb_line_protocol/src/lib.rs | 3 +- influxdb_storage_client/src/lib.rs | 6 ++- influxdb_tsm/src/lib.rs | 6 ++- influxrpc_parser/src/lib.rs | 6 ++- ingester/Cargo.toml | 2 +- ingester/src/lib.rs | 10 +++++ ingester_query_grpc/Cargo.toml | 1 - ingester_query_grpc/src/lib.rs | 4 ++ ingester_test_ctx/Cargo.toml | 1 - ingester_test_ctx/src/lib.rs | 6 ++- iox_catalog/Cargo.toml | 1 - iox_catalog/src/lib.rs | 6 ++- iox_data_generator/src/lib.rs | 9 ++++- iox_query/src/lib.rs | 6 ++- iox_query_influxql/Cargo.toml | 5 +-- iox_query_influxql/src/lib.rs | 6 ++- iox_query_influxrpc/src/lib.rs | 4 ++ iox_tests/Cargo.toml | 5 +-- iox_tests/src/lib.rs | 6 ++- iox_time/src/lib.rs | 6 ++- ioxd_common/src/lib.rs | 4 ++ ioxd_compactor/src/lib.rs | 4 ++ ioxd_garbage_collector/Cargo.toml | 1 - ioxd_garbage_collector/src/lib.rs | 6 ++- ioxd_ingester/src/lib.rs | 4 ++ ioxd_querier/src/lib.rs | 4 ++ ioxd_router/Cargo.toml | 5 ++- ioxd_router/src/lib.rs | 4 ++ ioxd_test/src/lib.rs | 4 ++ logfmt/src/lib.rs | 12 +++++- metric/src/lib.rs | 6 ++- metric_exporters/src/lib.rs | 6 ++- mutable_batch/src/lib.rs | 6 ++- mutable_batch_lp/Cargo.toml | 2 +- mutable_batch_lp/src/lib.rs | 8 +++- mutable_batch_pb/src/lib.rs | 10 ++++- mutable_batch_tests/Cargo.toml | 12 +++--- mutable_batch_tests/src/lib.rs | 22 +++++++++++ object_store_metrics/Cargo.toml | 1 - object_store_metrics/src/lib.rs | 4 ++ panic_logging/src/lib.rs | 6 ++- parquet_file/Cargo.toml | 2 - parquet_file/src/lib.rs | 6 ++- parquet_to_line_protocol/Cargo.toml | 1 - parquet_to_line_protocol/src/lib.rs | 4 ++ predicate/src/lib.rs | 6 ++- querier/src/lib.rs | 6 ++- query_functions/Cargo.toml | 3 +- query_functions/src/lib.rs | 6 ++- router/Cargo.toml | 5 +-- router/src/lib.rs | 8 +++- schema/src/lib.rs | 6 ++- service_common/src/lib.rs | 4 ++ service_grpc_catalog/Cargo.toml | 2 +- service_grpc_catalog/src/lib.rs | 6 ++- service_grpc_flight/Cargo.toml | 7 ++-- service_grpc_flight/src/lib.rs | 4 ++ service_grpc_influxrpc/Cargo.toml | 8 ++-- service_grpc_influxrpc/src/lib.rs | 4 ++ service_grpc_namespace/Cargo.toml | 1 - service_grpc_namespace/src/lib.rs | 4 ++ service_grpc_object_store/Cargo.toml | 4 +- service_grpc_object_store/src/lib.rs | 6 ++- service_grpc_schema/src/lib.rs | 4 ++ service_grpc_testing/src/lib.rs | 5 +++ sharder/Cargo.toml | 1 - sharder/src/lib.rs | 10 ++++- sqlx-hotswap-pool/Cargo.toml | 2 +- sqlx-hotswap-pool/src/lib.rs | 6 ++- test_helpers/src/lib.rs | 6 ++- test_helpers_end_to_end/src/lib.rs | 5 +++ trace/src/lib.rs | 6 ++- trace_exporters/Cargo.toml | 2 +- trace_exporters/src/lib.rs | 6 ++- trace_http/src/lib.rs | 6 ++- tracker/src/lib.rs | 6 ++- trogging/src/lib.rs | 3 +- wal/src/lib.rs | 13 +++++-- wal_inspect/Cargo.toml | 8 ++-- wal_inspect/src/lib.rs | 7 +++- 112 files changed, 468 insertions(+), 199 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 302432933d..05b1564c41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -383,7 +383,6 @@ version = "0.1.0" dependencies = [ "ahash 0.8.3", "arrow", - "arrow-flight", "chrono", "comfy-table", "datafusion", @@ -898,21 +897,16 @@ name = "clap_blocks" version = "0.1.0" dependencies = [ "clap 4.3.0", - "data_types", "futures", "http", "humantime", "iox_catalog", - "iox_time", "metric", "object_store", "observability_deps", - "serde", - "serde_json", "snafu", "tempfile", "test_helpers", - "trace", "trace_exporters", "trogging", "uuid 1.3.3", @@ -1409,12 +1403,9 @@ dependencies = [ "observability_deps", "once_cell", "ordered-float 3.7.0", - "percent-encoding", "proptest", "schema", - "serde", "sqlx", - "test_helpers", "thiserror", "uuid 1.3.3", "workspace-hack", @@ -1845,14 +1836,11 @@ dependencies = [ "arrow_util", "bytes", "datafusion", - "futures", "iox_query", "observability_deps", "once_cell", "prost", "snafu", - "tokio", - "tonic", "workspace-hack", ] @@ -2040,7 +2028,6 @@ dependencies = [ name = "generated_types" version = "0.1.0" dependencies = [ - "base64 0.21.1", "bytes", "observability_deps", "pbjson", @@ -2049,7 +2036,6 @@ dependencies = [ "prost", "prost-build", "serde", - "snafu", "tonic", "tonic-build", "workspace-hack", @@ -2142,7 +2128,6 @@ version = "0.1.0" dependencies = [ "prost", "prost-build", - "prost-types", "tonic", "tonic-build", "workspace-hack", @@ -2447,24 +2432,12 @@ dependencies = [ name = "import_export" version = "0.1.0" dependencies = [ - "assert_matches", - "chrono", - "client_util", - "data_types", - "futures", "futures-util", "influxdb_iox_client", - "iox_catalog", - "metric", - "object_store", "observability_deps", - "parking_lot 0.12.1", - "schema", - "serde", "serde_json", "thiserror", "tokio", - "tokio-stream", "tokio-util", "workspace-hack", ] @@ -2759,7 +2732,6 @@ dependencies = [ "datafusion-proto", "pbjson", "pbjson-build", - "pbjson-types", "predicate", "prost", "prost-build", @@ -2800,7 +2772,6 @@ dependencies = [ "tokio", "tokio-util", "tonic", - "wal", "workspace-hack", ] @@ -2877,7 +2848,6 @@ dependencies = [ "sqlx", "sqlx-hotswap-pool", "tempfile", - "test_helpers", "thiserror", "tokio", "uuid 1.3.3", @@ -2958,7 +2928,6 @@ dependencies = [ "assert_matches", "chrono", "chrono-tz", - "data_types", "datafusion", "datafusion_util", "generated_types", @@ -2967,11 +2936,9 @@ dependencies = [ "iox_query", "itertools", "observability_deps", - "once_cell", "query_functions", "regex", "schema", - "serde", "serde_json", "test_helpers", "thiserror", @@ -3005,11 +2972,9 @@ name = "iox_tests" version = "0.1.0" dependencies = [ "arrow", - "bytes", "data_types", "datafusion", "datafusion_util", - "futures", "iox_catalog", "iox_query", "iox_time", @@ -3018,7 +2983,6 @@ dependencies = [ "object_store", "observability_deps", "parquet_file", - "predicate", "schema", "uuid 1.3.3", "workspace-hack", @@ -3107,7 +3071,6 @@ dependencies = [ "hyper", "ioxd_common", "metric", - "observability_deps", "snafu", "tokio", "tokio-util", @@ -3184,7 +3147,6 @@ dependencies = [ "mutable_batch", "object_store", "router", - "sharder", "thiserror", "tokio", "tokio-util", @@ -3900,7 +3862,6 @@ version = "0.1.0" dependencies = [ "async-trait", "bytes", - "dotenvy", "futures", "iox_time", "metric", @@ -4080,10 +4041,8 @@ dependencies = [ "iox_time", "object_store", "observability_deps", - "parking_lot 0.12.1", "parquet", "pbjson-types", - "predicate", "prost", "schema", "snafu", @@ -4103,7 +4062,6 @@ dependencies = [ "datafusion_util", "futures", "influxdb-line-protocol", - "mutable_batch", "mutable_batch_lp", "num_cpus", "object_store", @@ -4601,7 +4559,6 @@ dependencies = [ "datafusion", "datafusion_util", "itertools", - "observability_deps", "once_cell", "regex", "regex-syntax 0.7.2", @@ -4915,7 +4872,6 @@ dependencies = [ "rand 0.8.5", "schema", "serde", - "serde_json", "serde_urlencoded", "service_grpc_catalog", "service_grpc_namespace", @@ -5191,7 +5147,6 @@ version = "0.1.0" dependencies = [ "arrow", "arrow-flight", - "arrow_util", "assert_matches", "async-trait", "authz", @@ -5222,7 +5177,6 @@ name = "service_grpc_influxrpc" version = "0.1.0" dependencies = [ "arrow", - "async-trait", "data_types", "datafusion", "datafusion_util", @@ -5243,7 +5197,6 @@ dependencies = [ "schema", "serde", "serde_json", - "serde_urlencoded", "service_common", "service_grpc_testing", "snafu", @@ -5265,7 +5218,6 @@ dependencies = [ "data_types", "generated_types", "iox_catalog", - "iox_tests", "metric", "observability_deps", "paste", @@ -5360,7 +5312,6 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "siphasher", - "test_helpers", "workspace-hack", ] diff --git a/arrow_util/Cargo.toml b/arrow_util/Cargo.toml index 237eb38fec..942e07cbc9 100644 --- a/arrow_util/Cargo.toml +++ b/arrow_util/Cargo.toml @@ -22,6 +22,5 @@ uuid = "1" workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] -arrow-flight = { workspace = true } datafusion = { workspace = true } rand = "0.8.3" diff --git a/arrow_util/src/lib.rs b/arrow_util/src/lib.rs index daf22de7af..613d794afc 100644 --- a/arrow_util/src/lib.rs +++ b/arrow_util/src/lib.rs @@ -8,9 +8,13 @@ clippy::future_not_send, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod bitset; pub mod dictionary; pub mod display; diff --git a/authz/src/lib.rs b/authz/src/lib.rs index 393af5b92c..7b2fd5442a 100644 --- a/authz/src/lib.rs +++ b/authz/src/lib.rs @@ -13,10 +13,14 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(rustdoc::private_intra_doc_links)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use base64::{prelude::BASE64_STANDARD, Engine}; use generated_types::influxdata::iox::authz::v1::{self as proto}; use observability_deps::tracing::warn; diff --git a/backoff/src/lib.rs b/backoff/src/lib.rs index 2164acc150..e126484026 100644 --- a/backoff/src/lib.rs +++ b/backoff/src/lib.rs @@ -10,8 +10,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use observability_deps::tracing::warn; use rand::prelude::*; use snafu::Snafu; diff --git a/cache_system/src/lib.rs b/cache_system/src/lib.rs index 2000090717..d0752d6572 100644 --- a/cache_system/src/lib.rs +++ b/cache_system/src/lib.rs @@ -9,9 +9,15 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use criterion as _; +use workspace_hack as _; + pub mod addressable_heap; pub mod backend; pub mod cache; diff --git a/clap_blocks/Cargo.toml b/clap_blocks/Cargo.toml index 6bc4c970af..538921dcc3 100644 --- a/clap_blocks/Cargo.toml +++ b/clap_blocks/Cargo.toml @@ -7,19 +7,14 @@ license.workspace = true [dependencies] clap = { version = "4", features = ["derive", "env"] } -data_types = { path = "../data_types" } futures = "0.3" http = "0.2.9" humantime = "2.1.0" iox_catalog = { path = "../iox_catalog" } -iox_time = { path = "../iox_time" } metric = { path = "../metric" } object_store = "0.5.6" observability_deps = { path = "../observability_deps" } -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0.96" snafu = "0.7" -trace = { path = "../trace" } trace_exporters = { path = "../trace_exporters" } trogging = { path = "../trogging", default-features = false, features = ["clap"] } uuid = { version = "1", features = ["v4"] } diff --git a/clap_blocks/src/lib.rs b/clap_blocks/src/lib.rs index 4aaffefedb..88be147da4 100644 --- a/clap_blocks/src/lib.rs +++ b/clap_blocks/src/lib.rs @@ -11,8 +11,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod catalog_dsn; pub mod compactor; pub mod garbage_collector; diff --git a/client_util/src/lib.rs b/client_util/src/lib.rs index 204d5822bd..b3c71fdded 100644 --- a/client_util/src/lib.rs +++ b/client_util/src/lib.rs @@ -14,10 +14,14 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + /// Builder for constructing connections for use with the various gRPC clients pub mod connection; diff --git a/compactor/src/lib.rs b/compactor/src/lib.rs index 44c6d92b4b..711f6118b4 100644 --- a/compactor/src/lib.rs +++ b/compactor/src/lib.rs @@ -200,10 +200,14 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(rustdoc::private_intra_doc_links)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod compactor; mod components; pub mod config; diff --git a/compactor_test_utils/Cargo.toml b/compactor_test_utils/Cargo.toml index 452ac20ac7..3d6592576c 100644 --- a/compactor_test_utils/Cargo.toml +++ b/compactor_test_utils/Cargo.toml @@ -10,12 +10,13 @@ license.workspace = true async-trait = "0.1.68" backoff = { path = "../backoff" } compactor = { path = "../compactor" } +data_types = { path = "../data_types" } datafusion = { workspace = true } datafusion_util = { path = "../datafusion_util" } -data_types = { path = "../data_types" } futures = "0.3" iox_catalog = { path = "../iox_catalog" } iox_query = { path = "../iox_query" } +iox_tests = { path = "../iox_tests" } iox_time = { path = "../iox_time" } object_store = "0.5.6" observability_deps = { path = "../observability_deps" } @@ -26,5 +27,5 @@ tracker = { path = "../tracker" } uuid = { version = "1", features = ["v4"] } workspace-hack = { version = "0.1", path = "../workspace-hack" } -iox_tests = { path = "../iox_tests" } +[dev-dependencies] insta = { version = "1.29.0", features = ["yaml"] } diff --git a/compactor_test_utils/src/lib.rs b/compactor_test_utils/src/lib.rs index 49716f6513..6bbe56a323 100644 --- a/compactor_test_utils/src/lib.rs +++ b/compactor_test_utils/src/lib.rs @@ -10,9 +10,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod commit_wrapper; mod display; mod simulator; diff --git a/data_types/Cargo.toml b/data_types/Cargo.toml index f3c3d4db1a..299ee5a231 100644 --- a/data_types/Cargo.toml +++ b/data_types/Cargo.toml @@ -14,9 +14,7 @@ generated_types = { path = "../generated_types" } observability_deps = { path = "../observability_deps" } once_cell = "1" ordered-float = "3" -percent-encoding = "2.2.0" schema = { path = "../schema" } -serde = { version = "1.0", features = ["derive"] } sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "postgres", "uuid"] } thiserror = "1.0.40" uuid = { version = "1", features = ["v4"] } @@ -24,4 +22,3 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] # In alphabetical order proptest = "1.1.0" -test_helpers = { path = "../test_helpers" } diff --git a/data_types/src/lib.rs b/data_types/src/lib.rs index 5a6e454535..551f310375 100644 --- a/data_types/src/lib.rs +++ b/data_types/src/lib.rs @@ -11,9 +11,13 @@ clippy::future_not_send, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod sequence_number_set; mod columns; diff --git a/datafusion_util/src/lib.rs b/datafusion_util/src/lib.rs index 284f2f17a4..024983a0b8 100644 --- a/datafusion_util/src/lib.rs +++ b/datafusion_util/src/lib.rs @@ -5,7 +5,8 @@ clippy::clone_on_ref_ptr, rustdoc::broken_intra_doc_links, rustdoc::bare_urls, - rust_2018_idioms + rust_2018_idioms, + unused_crate_dependencies )] #![allow(clippy::clone_on_ref_ptr)] @@ -18,6 +19,9 @@ //! [datafusion_optimizer::utils](https://docs.rs/datafusion-optimizer/13.0.0/datafusion_optimizer/utils/index.html) //! for expression manipulation functions. +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod config; pub mod sender; pub mod watch; diff --git a/dml/src/lib.rs b/dml/src/lib.rs index ae7e27571b..f09d6f9428 100644 --- a/dml/src/lib.rs +++ b/dml/src/lib.rs @@ -11,9 +11,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::time::Duration; use data_types::{ diff --git a/executor/src/lib.rs b/executor/src/lib.rs index 391277d70a..33af856044 100644 --- a/executor/src/lib.rs +++ b/executor/src/lib.rs @@ -11,9 +11,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use once_cell::sync::Lazy; use parking_lot::Mutex; use pin_project::{pin_project, pinned_drop}; diff --git a/flightsql/Cargo.toml b/flightsql/Cargo.toml index b46b347081..f84586d0ef 100644 --- a/flightsql/Cargo.toml +++ b/flightsql/Cargo.toml @@ -17,10 +17,7 @@ iox_query = { path = "../iox_query" } # Crates.io dependencies, in alphabetical order bytes = "1.4" -futures = "0.3" snafu = "0.7" once_cell = { version = "1", default-features = false } prost = "0.11" -tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } -tonic = { workspace = true } workspace-hack = { version = "0.1", path = "../workspace-hack" } diff --git a/flightsql/src/lib.rs b/flightsql/src/lib.rs index 4188e34a63..f27e584e2c 100644 --- a/flightsql/src/lib.rs +++ b/flightsql/src/lib.rs @@ -11,8 +11,12 @@ clippy::use_self, missing_debug_implementations, // Allow missing docs - there's lots missing! + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod cmd; mod error; mod get_catalogs; diff --git a/garbage_collector/src/lib.rs b/garbage_collector/src/lib.rs index 5a0a1fffb0..2aab40fdb5 100644 --- a/garbage_collector/src/lib.rs +++ b/garbage_collector/src/lib.rs @@ -14,10 +14,15 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +use clap as _; +use workspace_hack as _; + use crate::{ objectstore::{checker as os_checker, deleter as os_deleter, lister as os_lister}, parquetfile::deleter as pf_deleter, diff --git a/generated_types/Cargo.toml b/generated_types/Cargo.toml index 26c8729261..ff2b87311c 100644 --- a/generated_types/Cargo.toml +++ b/generated_types/Cargo.toml @@ -6,17 +6,17 @@ edition.workspace = true license.workspace = true [dependencies] # In alphabetical order -base64 = "0.21" -bytes = "1.4" observability_deps = { path = "../observability_deps" } pbjson = "0.5" pbjson-types = "0.5" prost = "0.11" serde = { version = "1.0", features = ["derive"] } -snafu = "0.7" tonic = { workspace = true } workspace-hack = { version = "0.1", path = "../workspace-hack" } +[dev-dependencies] +bytes = "1.4" + [build-dependencies] # In alphabetical order tonic-build = { workspace = true } prost-build = "0.11" diff --git a/generated_types/src/lib.rs b/generated_types/src/lib.rs index db013bad74..8c6d5451ac 100644 --- a/generated_types/src/lib.rs +++ b/generated_types/src/lib.rs @@ -3,6 +3,10 @@ // control over. #![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)] #![allow(clippy::derive_partial_eq_without_eq, clippy::needless_borrow)] +#![warn(unused_crate_dependencies)] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; /// This module imports the generated protobuf code into a Rust module /// hierarchy that matches the namespace hierarchy of the protobuf diff --git a/grpc-binary-logger-proto/src/lib.rs b/grpc-binary-logger-proto/src/lib.rs index 4338e1f077..b4d8e817c4 100644 --- a/grpc-binary-logger-proto/src/lib.rs +++ b/grpc-binary-logger-proto/src/lib.rs @@ -1,4 +1,9 @@ +#![warn(unused_crate_dependencies)] #![allow(clippy::derive_partial_eq_without_eq)] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod proto { tonic::include_proto!("grpc.binarylog.v1"); } diff --git a/grpc-binary-logger-test-proto/Cargo.toml b/grpc-binary-logger-test-proto/Cargo.toml index af6b2cd0f1..fb94cbe6ae 100644 --- a/grpc-binary-logger-test-proto/Cargo.toml +++ b/grpc-binary-logger-test-proto/Cargo.toml @@ -7,7 +7,6 @@ license.workspace = true [dependencies] prost = "0.11" -prost-types = { version = "0.11.9", features = ["std"] } tonic = { workspace = true } workspace-hack = { version = "0.1", path = "../workspace-hack" } diff --git a/grpc-binary-logger-test-proto/src/lib.rs b/grpc-binary-logger-test-proto/src/lib.rs index 2b24570fc4..08193ea944 100644 --- a/grpc-binary-logger-test-proto/src/lib.rs +++ b/grpc-binary-logger-test-proto/src/lib.rs @@ -1,4 +1,9 @@ +#![warn(unused_crate_dependencies)] #![allow(clippy::derive_partial_eq_without_eq)] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod proto { tonic::include_proto!("test"); } diff --git a/grpc-binary-logger/src/lib.rs b/grpc-binary-logger/src/lib.rs index 65c3395a35..14be5df43b 100644 --- a/grpc-binary-logger/src/lib.rs +++ b/grpc-binary-logger/src/lib.rs @@ -11,9 +11,19 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use assert_matches as _; +#[cfg(test)] +use grpc_binary_logger_test_proto as _; +#[cfg(test)] +use tokio_stream as _; +use workspace_hack as _; + mod predicate; pub use self::predicate::{NoReflection, Predicate}; pub mod sink; diff --git a/import_export/Cargo.toml b/import_export/Cargo.toml index f1f4c09a3e..73c85e7ffb 100644 --- a/import_export/Cargo.toml +++ b/import_export/Cargo.toml @@ -6,31 +6,11 @@ edition.workspace = true license.workspace = true [dependencies] -chrono = { version = "0.4", default-features = false } -data_types = { path = "../data_types" } -futures = "0.3" futures-util = { version = "0.3" } influxdb_iox_client = { path = "../influxdb_iox_client", features = ["flight", "format"] } -iox_catalog = { path = "../iox_catalog" } -object_store = { version = "0.5.6", features = ["aws"] } observability_deps = { path = "../observability_deps" } -schema = { path = "../schema" } -serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.96" thiserror = "1.0.40" tokio = { version = "1.28" } tokio-util = { version = "0.7.8" } workspace-hack = { version = "0.1", path = "../workspace-hack" } - - -[dev-dependencies] -assert_matches = "1.5" -client_util = { path = "../client_util" } -metric = { path = "../metric" } -parking_lot = "0.12" -tokio-stream = { version = "0.1", features = ["net"] } - -[features] -azure = ["object_store/azure"] # Optional Azure Object store support -gcp = ["object_store/gcp"] # Optional GCP object store support -aws = ["object_store/aws"] # Optional AWS / S3 object store support diff --git a/import_export/src/lib.rs b/import_export/src/lib.rs index e6809e6d51..df7c5efbd5 100644 --- a/import_export/src/lib.rs +++ b/import_export/src/lib.rs @@ -6,8 +6,12 @@ clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr, - clippy::future_not_send + clippy::future_not_send, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + /// Import/Export data to files pub mod file; diff --git a/influxdb2_client/src/lib.rs b/influxdb2_client/src/lib.rs index d0488d5b0a..0db577e643 100644 --- a/influxdb2_client/src/lib.rs +++ b/influxdb2_client/src/lib.rs @@ -10,7 +10,8 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] //! # influxdb2_client @@ -67,6 +68,14 @@ //! } //! ``` +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use once_cell as _; +#[cfg(test)] +use parking_lot as _; +#[cfg(test)] +use test_helpers as _; + use reqwest::Method; use snafu::Snafu; diff --git a/influxdb_influxql_parser/src/lib.rs b/influxdb_influxql_parser/src/lib.rs index 49735e289f..29ef9aca73 100644 --- a/influxdb_influxql_parser/src/lib.rs +++ b/influxdb_influxql_parser/src/lib.rs @@ -12,9 +12,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use crate::common::{statement_terminator, ws0}; use crate::internal::Error as InternalError; use crate::statement::{statement, Statement}; diff --git a/influxdb_iox/Cargo.toml b/influxdb_iox/Cargo.toml index 83b31f7541..e926bcfbeb 100644 --- a/influxdb_iox/Cargo.toml +++ b/influxdb_iox/Cargo.toml @@ -96,9 +96,9 @@ insta = { version = "1", features = ["yaml"] } [features] default = ["jemalloc_replacing_malloc"] -azure = ["clap_blocks/azure", "import_export/azure"] # Optional Azure Object store support -gcp = ["clap_blocks/gcp", "import_export/gcp"] # Optional GCP object store support -aws = ["clap_blocks/aws", "import_export/aws"] # Optional AWS / S3 object store support +azure = ["clap_blocks/azure"] # Optional Azure Object store support +gcp = ["clap_blocks/gcp"] # Optional GCP object store support +aws = ["clap_blocks/aws"] # Optional AWS / S3 object store support pprof = ["ioxd_common/pprof"] # Optional http://localhost:8080/debug/pprof/profile support heappy = ["ioxd_common/heappy"] # Optional http://localhost:8080/debug/pproc/alloc support diff --git a/influxdb_iox_client/src/lib.rs b/influxdb_iox_client/src/lib.rs index b2f52e7b90..40312e5d6d 100644 --- a/influxdb_iox_client/src/lib.rs +++ b/influxdb_iox_client/src/lib.rs @@ -14,7 +14,8 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] diff --git a/influxdb_line_protocol/src/lib.rs b/influxdb_line_protocol/src/lib.rs index fc7d5eec42..0042ca8a5a 100644 --- a/influxdb_line_protocol/src/lib.rs +++ b/influxdb_line_protocol/src/lib.rs @@ -63,7 +63,8 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] pub mod builder; diff --git a/influxdb_storage_client/src/lib.rs b/influxdb_storage_client/src/lib.rs index 639947f675..7529baf780 100644 --- a/influxdb_storage_client/src/lib.rs +++ b/influxdb_storage_client/src/lib.rs @@ -14,10 +14,14 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use client_util::connection::GrpcConnection; use futures_util::TryStreamExt; use prost::Message; diff --git a/influxdb_tsm/src/lib.rs b/influxdb_tsm/src/lib.rs index e646b2ebc5..45b6229796 100644 --- a/influxdb_tsm/src/lib.rs +++ b/influxdb_tsm/src/lib.rs @@ -6,9 +6,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod encoders; pub mod key; pub mod mapper; diff --git a/influxrpc_parser/src/lib.rs b/influxrpc_parser/src/lib.rs index e96ec2a8d3..92d4feb67e 100644 --- a/influxrpc_parser/src/lib.rs +++ b/influxrpc_parser/src/lib.rs @@ -10,7 +10,11 @@ clippy::str_to_string, clippy::string_to_string, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod predicate; diff --git a/ingester/Cargo.toml b/ingester/Cargo.toml index dbaa7b1a3f..8fe93aa97c 100644 --- a/ingester/Cargo.toml +++ b/ingester/Cargo.toml @@ -29,7 +29,6 @@ iox_time = { path = "../iox_time" } metric = { version = "0.1.0", path = "../metric" } mutable_batch = { version = "0.1.0", path = "../mutable_batch" } mutable_batch_pb = { version = "0.1.0", path = "../mutable_batch_pb" } -object_store = "0.5.6" observability_deps = { version = "0.1.0", path = "../observability_deps" } once_cell = "1.17" parking_lot = "0.12.1" @@ -59,6 +58,7 @@ influxdb_iox_client = { path = "../influxdb_iox_client" } ingester_test_ctx = { path = "../ingester_test_ctx" } lazy_static = "1.4.0" mutable_batch_lp = { path = "../mutable_batch_lp" } +object_store = "0.5.6" paste = "1.0.12" tempfile = "3.5.0" test_helpers = { path = "../test_helpers", features = ["future_timeout"] } diff --git a/ingester/src/lib.rs b/ingester/src/lib.rs index 1ea3deb534..6fb7e939bf 100644 --- a/ingester/src/lib.rs +++ b/ingester/src/lib.rs @@ -197,9 +197,19 @@ clippy::use_self, missing_copy_implementations, missing_debug_implementations, + unused_crate_dependencies, missing_docs )] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use criterion as _; +#[cfg(test)] +use influxdb_iox_client as _; +#[cfg(test)] +use ingester_test_ctx as _; +use workspace_hack as _; + /// Ingester initialisation methods & types. /// /// This module defines the public API boundary of the Ingester crate. diff --git a/ingester_query_grpc/Cargo.toml b/ingester_query_grpc/Cargo.toml index 35b9623e52..b0ae432b86 100644 --- a/ingester_query_grpc/Cargo.toml +++ b/ingester_query_grpc/Cargo.toml @@ -11,7 +11,6 @@ data_types = { path = "../data_types" } datafusion = { workspace = true } datafusion-proto = { workspace = true } pbjson = "0.5" -pbjson-types = "0.5" predicate = { path = "../predicate" } prost = "0.11" query_functions = { path = "../query_functions" } diff --git a/ingester_query_grpc/src/lib.rs b/ingester_query_grpc/src/lib.rs index 0b23412e90..90eab12153 100644 --- a/ingester_query_grpc/src/lib.rs +++ b/ingester_query_grpc/src/lib.rs @@ -11,9 +11,13 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] #![allow(clippy::derive_partial_eq_without_eq, clippy::needless_borrow)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use crate::influxdata::iox::ingester::v1 as proto; use base64::{prelude::BASE64_STANDARD, Engine}; use data_types::{NamespaceId, TableId, TimestampRange}; diff --git a/ingester_test_ctx/Cargo.toml b/ingester_test_ctx/Cargo.toml index 57ce7dd861..91dab9b750 100644 --- a/ingester_test_ctx/Cargo.toml +++ b/ingester_test_ctx/Cargo.toml @@ -32,5 +32,4 @@ test_helpers = { path = "../test_helpers", features = ["future_timeout"] } tokio = { version = "1.28", features = ["macros", "parking_lot", "rt-multi-thread", "sync", "time"] } tokio-util = "0.7.8" tonic = { workspace = true } -wal = { version = "0.1.0", path = "../wal" } workspace-hack = { version = "0.1", path = "../workspace-hack" } diff --git a/ingester_test_ctx/src/lib.rs b/ingester_test_ctx/src/lib.rs index 5f0ab578ec..bcc0cc316c 100644 --- a/ingester_test_ctx/src/lib.rs +++ b/ingester_test_ctx/src/lib.rs @@ -10,9 +10,13 @@ clippy::use_self, missing_copy_implementations, missing_debug_implementations, - missing_docs + missing_docs, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{collections::HashMap, sync::Arc, time::Duration}; use arrow::record_batch::RecordBatch; diff --git a/iox_catalog/Cargo.toml b/iox_catalog/Cargo.toml index 7c43417201..129f9cb563 100644 --- a/iox_catalog/Cargo.toml +++ b/iox_catalog/Cargo.toml @@ -32,4 +32,3 @@ paste = "1.0.12" pretty_assertions = "1.3.0" rand = "0.8" tempfile = "3" -test_helpers = { path = "../test_helpers" } diff --git a/iox_catalog/src/lib.rs b/iox_catalog/src/lib.rs index 606d2e8419..18a9738fc1 100644 --- a/iox_catalog/src/lib.rs +++ b/iox_catalog/src/lib.rs @@ -11,9 +11,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use crate::interface::{ColumnTypeMismatchSnafu, Error, RepoCollection, Result}; use data_types::{ColumnType, NamespaceSchema, TableSchema}; use mutable_batch::MutableBatch; diff --git a/iox_data_generator/src/lib.rs b/iox_data_generator/src/lib.rs index fb726d2635..a496e61c27 100644 --- a/iox_data_generator/src/lib.rs +++ b/iox_data_generator/src/lib.rs @@ -27,9 +27,16 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use clap as _; +#[cfg(test)] +use criterion as _; +use tracing_subscriber as _; + use crate::{ agent::{Agent, AgentGenerateStats}, tag_set::GeneratedTagSets, diff --git a/iox_query/src/lib.rs b/iox_query/src/lib.rs index 50937b9c2e..a28645d8fd 100644 --- a/iox_query/src/lib.rs +++ b/iox_query/src/lib.rs @@ -8,9 +8,13 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use arrow::{ datatypes::{DataType, Field}, record_batch::RecordBatch, diff --git a/iox_query_influxql/Cargo.toml b/iox_query_influxql/Cargo.toml index 3da5f6cfd9..5c021e3a3e 100644 --- a/iox_query_influxql/Cargo.toml +++ b/iox_query_influxql/Cargo.toml @@ -9,7 +9,6 @@ license.workspace = true arrow = { workspace = true, features = ["prettyprint"] } chrono = { version = "0.4", default-features = false } chrono-tz = { version = "0.8" } -data_types = { path = "../data_types" } datafusion = { workspace = true } datafusion_util = { path = "../datafusion_util" } generated_types = { path = "../generated_types" } @@ -17,8 +16,7 @@ influxdb_influxql_parser = { path = "../influxdb_influxql_parser" } iox_query = { path = "../iox_query" } itertools = "0.10.5" observability_deps = { path = "../observability_deps" } -once_cell = "1" -query_functions = { path = "../query_functions"} +query_functions = { path = "../query_functions" } regex = "1" schema = { path = "../schema" } serde_json = "1.0.96" @@ -29,4 +27,3 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" } test_helpers = { path = "../test_helpers" } assert_matches = "1" insta = { version = "1", features = ["yaml"] } -serde = { version = "1.0", features = ["derive"] } diff --git a/iox_query_influxql/src/lib.rs b/iox_query_influxql/src/lib.rs index 6d71e380ab..fd9b545106 100644 --- a/iox_query_influxql/src/lib.rs +++ b/iox_query_influxql/src/lib.rs @@ -8,8 +8,12 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod frontend; pub mod plan; diff --git a/iox_query_influxrpc/src/lib.rs b/iox_query_influxrpc/src/lib.rs index aafa3a7559..c50fff5f23 100644 --- a/iox_query_influxrpc/src/lib.rs +++ b/iox_query_influxrpc/src/lib.rs @@ -11,8 +11,12 @@ clippy::use_self, missing_copy_implementations, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use arrow::datatypes::DataType; use data_types::ChunkId; use datafusion::{ diff --git a/iox_tests/Cargo.toml b/iox_tests/Cargo.toml index 213365cced..2beef32128 100644 --- a/iox_tests/Cargo.toml +++ b/iox_tests/Cargo.toml @@ -8,20 +8,17 @@ license.workspace = true [dependencies] arrow = { workspace = true } -bytes = "1.4" data_types = { path = "../data_types" } datafusion = { workspace = true } datafusion_util = { path = "../datafusion_util" } iox_catalog = { path = "../iox_catalog" } +iox_query = { path = "../iox_query" } iox_time = { path = "../iox_time" } metric = { path = "../metric" } mutable_batch_lp = { path = "../mutable_batch_lp" } object_store = "0.5.6" observability_deps = { path = "../observability_deps" } parquet_file = { path = "../parquet_file" } -predicate = { path = "../predicate" } -iox_query = { path = "../iox_query" } schema = { path = "../schema" } uuid = { version = "1", features = ["v4"] } workspace-hack = { version = "0.1", path = "../workspace-hack" } -futures = "0.3.28" diff --git a/iox_tests/src/lib.rs b/iox_tests/src/lib.rs index 6d3bc38697..60cdf73bab 100644 --- a/iox_tests/src/lib.rs +++ b/iox_tests/src/lib.rs @@ -10,9 +10,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod catalog; pub use catalog::{ TestCatalog, TestNamespace, TestParquetFile, TestParquetFileBuilder, TestPartition, TestTable, diff --git a/iox_time/src/lib.rs b/iox_time/src/lib.rs index 6f47dc0da6..f7e30b720c 100644 --- a/iox_time/src/lib.rs +++ b/iox_time/src/lib.rs @@ -7,9 +7,13 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use chrono::{DateTime, TimeZone, Timelike, Utc}; use parking_lot::{lock_api::RwLockUpgradableReadGuard, RwLock}; use std::{ diff --git a/ioxd_common/src/lib.rs b/ioxd_common/src/lib.rs index 0e4566232b..cbc82c63dc 100644 --- a/ioxd_common/src/lib.rs +++ b/ioxd_common/src/lib.rs @@ -8,8 +8,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod http; pub mod rpc; pub mod server_type; diff --git a/ioxd_compactor/src/lib.rs b/ioxd_compactor/src/lib.rs index 069b207cc7..ec66c14654 100644 --- a/ioxd_compactor/src/lib.rs +++ b/ioxd_compactor/src/lib.rs @@ -8,8 +8,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use async_trait::async_trait; use backoff::BackoffConfig; use clap_blocks::compactor::{CompactionType, CompactorConfig}; diff --git a/ioxd_garbage_collector/Cargo.toml b/ioxd_garbage_collector/Cargo.toml index bc108d8bbc..7adc06f191 100644 --- a/ioxd_garbage_collector/Cargo.toml +++ b/ioxd_garbage_collector/Cargo.toml @@ -12,7 +12,6 @@ hyper = "0.14" garbage_collector = { path = "../garbage_collector" } ioxd_common = { path = "../ioxd_common" } metric = { path = "../metric" } -observability_deps = { path = "../observability_deps" } snafu = "0.7" tokio = { version = "1", features = ["sync"] } trace = { path = "../trace" } diff --git a/ioxd_garbage_collector/src/lib.rs b/ioxd_garbage_collector/src/lib.rs index 17f1259d8a..500f560992 100644 --- a/ioxd_garbage_collector/src/lib.rs +++ b/ioxd_garbage_collector/src/lib.rs @@ -14,10 +14,14 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use async_trait::async_trait; use futures::{ future::{BoxFuture, Shared}, diff --git a/ioxd_ingester/src/lib.rs b/ioxd_ingester/src/lib.rs index 28d8ba6cf0..1388797b66 100644 --- a/ioxd_ingester/src/lib.rs +++ b/ioxd_ingester/src/lib.rs @@ -8,8 +8,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use arrow_flight::flight_service_server::FlightServiceServer; use async_trait::async_trait; use clap_blocks::ingester::IngesterConfig; diff --git a/ioxd_querier/src/lib.rs b/ioxd_querier/src/lib.rs index cacf426e8a..8ca37084e4 100644 --- a/ioxd_querier/src/lib.rs +++ b/ioxd_querier/src/lib.rs @@ -8,8 +8,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use async_trait::async_trait; use authz::{Authorizer, IoxAuthorizer}; use clap_blocks::querier::QuerierConfig; diff --git a/ioxd_router/Cargo.toml b/ioxd_router/Cargo.toml index 6aaa7dacf8..84942fc9d9 100644 --- a/ioxd_router/Cargo.toml +++ b/ioxd_router/Cargo.toml @@ -18,9 +18,10 @@ metric = { path = "../metric" } mutable_batch = { path = "../mutable_batch" } object_store = "0.5.6" router = { path = "../router" } -sharder = { path = "../sharder" } thiserror = "1.0.40" -tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } tokio-util = { version = "0.7.8" } trace = { path = "../trace" } workspace-hack = { version = "0.1", path = "../workspace-hack" } + +[dev-dependencies] +tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } diff --git a/ioxd_router/src/lib.rs b/ioxd_router/src/lib.rs index 501da9ee12..83c333b8c4 100644 --- a/ioxd_router/src/lib.rs +++ b/ioxd_router/src/lib.rs @@ -8,8 +8,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{ fmt::{Debug, Display}, sync::Arc, diff --git a/ioxd_test/src/lib.rs b/ioxd_test/src/lib.rs index b2da623315..fe652e5dc9 100644 --- a/ioxd_test/src/lib.rs +++ b/ioxd_test/src/lib.rs @@ -8,8 +8,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::sync::Arc; use async_trait::async_trait; diff --git a/logfmt/src/lib.rs b/logfmt/src/lib.rs index 5c5ba8437a..e63b5b2092 100644 --- a/logfmt/src/lib.rs +++ b/logfmt/src/lib.rs @@ -7,9 +7,19 @@ clippy::future_not_send, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use once_cell as _; +#[cfg(test)] +use parking_lot as _; +#[cfg(test)] +use regex as _; +use workspace_hack as _; + use observability_deps::tracing::{ self, field::{Field, Visit}, diff --git a/metric/src/lib.rs b/metric/src/lib.rs index 4c63bb1e4c..614e406262 100644 --- a/metric/src/lib.rs +++ b/metric/src/lib.rs @@ -109,9 +109,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use parking_lot::Mutex; use std::any::Any; use std::borrow::Cow; diff --git a/metric_exporters/src/lib.rs b/metric_exporters/src/lib.rs index 04b7f26044..ff62a864ad 100644 --- a/metric_exporters/src/lib.rs +++ b/metric_exporters/src/lib.rs @@ -5,9 +5,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use metric::{Attributes, MetricKind, Observation}; use std::io::Write; diff --git a/mutable_batch/src/lib.rs b/mutable_batch/src/lib.rs index 82f0756406..4875556c8d 100644 --- a/mutable_batch/src/lib.rs +++ b/mutable_batch/src/lib.rs @@ -9,7 +9,8 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] //! A mutable data structure for a collection of writes. @@ -18,6 +19,9 @@ //! owner of its buffers, permitting mutability. The in-memory layout is similar, however, //! permitting fast conversion to [`RecordBatch`]. +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use crate::column::{Column, ColumnData}; use arrow::record_batch::RecordBatch; use data_types::StatValues; diff --git a/mutable_batch_lp/Cargo.toml b/mutable_batch_lp/Cargo.toml index 9cc191b9b0..6a2beebe39 100644 --- a/mutable_batch_lp/Cargo.toml +++ b/mutable_batch_lp/Cargo.toml @@ -10,7 +10,6 @@ license.workspace = true hashbrown = { workspace = true } influxdb-line-protocol = { path = "../influxdb_line_protocol" } mutable_batch = { path = "../mutable_batch" } -schema = { path = "../schema" } snafu = "0.7" workspace-hack = { version = "0.1", path = "../workspace-hack" } @@ -18,6 +17,7 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" } arrow_util = { path = "../arrow_util" } assert_matches = "1.5.0" criterion = { version = "0.4", default-features = false, features = ["rayon"]} +schema = { path = "../schema" } [[bench]] name = "parse_lp" diff --git a/mutable_batch_lp/src/lib.rs b/mutable_batch_lp/src/lib.rs index effb4ea686..630061d4fc 100644 --- a/mutable_batch_lp/src/lib.rs +++ b/mutable_batch_lp/src/lib.rs @@ -11,9 +11,15 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use criterion as _; +use workspace_hack as _; + use hashbrown::{hash_map::Entry, HashMap, HashSet}; use influxdb_line_protocol::{parse_lines, FieldValue, ParsedLine}; use mutable_batch::writer::Writer; diff --git a/mutable_batch_pb/src/lib.rs b/mutable_batch_pb/src/lib.rs index ddba5cbd43..f42f556264 100644 --- a/mutable_batch_pb/src/lib.rs +++ b/mutable_batch_pb/src/lib.rs @@ -11,8 +11,16 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use data_types as _; +#[cfg(test)] +use mutable_batch_lp as _; +use workspace_hack as _; + pub mod decode; pub mod encode; diff --git a/mutable_batch_tests/Cargo.toml b/mutable_batch_tests/Cargo.toml index afeecf3a60..2e098255b1 100644 --- a/mutable_batch_tests/Cargo.toml +++ b/mutable_batch_tests/Cargo.toml @@ -7,18 +7,18 @@ edition.workspace = true license.workspace = true [dependencies] -dml = { path = "../dml" } flate2 = "1.0" -generated_types = { path = "../generated_types" } -mutable_batch = { path = "../mutable_batch" } -mutable_batch_lp = { path = "../mutable_batch_lp" } -mutable_batch_pb = { path = "../mutable_batch_pb" } -prost = "0.11" [dev-dependencies] bytes = "1.4" criterion = { version = "0.4", default-features = false, features = ["rayon"]} data_types = { path = "../data_types", default-features = false } +dml = { path = "../dml" } +generated_types = { path = "../generated_types" } +mutable_batch = { path = "../mutable_batch" } +mutable_batch_lp = { path = "../mutable_batch_lp" } +mutable_batch_pb = { path = "../mutable_batch_pb" } +prost = "0.11" [[bench]] name = "write_lp" diff --git a/mutable_batch_tests/src/lib.rs b/mutable_batch_tests/src/lib.rs index 47f4661cc2..b4cbbd0a4d 100644 --- a/mutable_batch_tests/src/lib.rs +++ b/mutable_batch_tests/src/lib.rs @@ -1,5 +1,27 @@ //! This crate only exists for its tests and benchmarks +#![warn(unused_crate_dependencies)] + +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use bytes as _; +#[cfg(test)] +use criterion as _; +#[cfg(test)] +use data_types as _; +#[cfg(test)] +use dml as _; +#[cfg(test)] +use generated_types as _; +#[cfg(test)] +use mutable_batch as _; +#[cfg(test)] +use mutable_batch_lp as _; +#[cfg(test)] +use mutable_batch_pb as _; +#[cfg(test)] +use prost as _; + use flate2::read::GzDecoder; use std::io::Read; use std::path::Path; diff --git a/object_store_metrics/Cargo.toml b/object_store_metrics/Cargo.toml index 02a6b18728..2f0fca4d71 100644 --- a/object_store_metrics/Cargo.toml +++ b/object_store_metrics/Cargo.toml @@ -17,6 +17,5 @@ tokio = { version = "1.28", features = ["io-util"] } workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] # In alphabetical order -dotenvy = "0.15.7" snafu = "0.7" tokio = { version = "1.28", features = ["macros", "io-util"] } diff --git a/object_store_metrics/src/lib.rs b/object_store_metrics/src/lib.rs index 16171bbebf..fa6c308a48 100644 --- a/object_store_metrics/src/lib.rs +++ b/object_store_metrics/src/lib.rs @@ -11,8 +11,12 @@ clippy::clone_on_ref_ptr, clippy::todo, clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::ops::Range; use std::sync::Arc; use std::{ diff --git a/panic_logging/src/lib.rs b/panic_logging/src/lib.rs index 846d68ba85..b046c55462 100644 --- a/panic_logging/src/lib.rs +++ b/panic_logging/src/lib.rs @@ -8,9 +8,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{collections::HashMap, fmt, panic, sync::Arc}; use metric::U64Counter; diff --git a/parquet_file/Cargo.toml b/parquet_file/Cargo.toml index fc1dc57378..e3faaf80e8 100644 --- a/parquet_file/Cargo.toml +++ b/parquet_file/Cargo.toml @@ -17,10 +17,8 @@ generated_types = { path = "../generated_types" } iox_time = { path = "../iox_time" } object_store = "0.5.6" observability_deps = { path = "../observability_deps" } -parking_lot = "0.12" parquet = { workspace = true, features = ["experimental"]} pbjson-types = "0.5" -predicate = { path = "../predicate" } prost = "0.11" schema = { path = "../schema" } snafu = "0.7" diff --git a/parquet_file/src/lib.rs b/parquet_file/src/lib.rs index 0c3ec8f466..a2b523650c 100644 --- a/parquet_file/src/lib.rs +++ b/parquet_file/src/lib.rs @@ -12,10 +12,14 @@ unreachable_pub, missing_docs, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod chunk; pub mod metadata; pub mod serialize; diff --git a/parquet_to_line_protocol/Cargo.toml b/parquet_to_line_protocol/Cargo.toml index 2af479c56e..5bbbb44993 100644 --- a/parquet_to_line_protocol/Cargo.toml +++ b/parquet_to_line_protocol/Cargo.toml @@ -20,5 +20,4 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] -mutable_batch = { path = "../mutable_batch" } mutable_batch_lp = { path = "../mutable_batch_lp" } diff --git a/parquet_to_line_protocol/src/lib.rs b/parquet_to_line_protocol/src/lib.rs index 59ed3ffffe..6845e5255e 100644 --- a/parquet_to_line_protocol/src/lib.rs +++ b/parquet_to_line_protocol/src/lib.rs @@ -11,8 +11,12 @@ clippy::clone_on_ref_ptr, clippy::todo, clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use datafusion::{ arrow::datatypes::SchemaRef as ArrowSchemaRef, datasource::{ diff --git a/predicate/src/lib.rs b/predicate/src/lib.rs index 973a886c0b..778042a0ce 100644 --- a/predicate/src/lib.rs +++ b/predicate/src/lib.rs @@ -8,9 +8,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + pub mod delete_expr; pub mod delete_predicate; pub mod rpc_predicate; diff --git a/querier/src/lib.rs b/querier/src/lib.rs index dac46d765e..f47dd3723e 100644 --- a/querier/src/lib.rs +++ b/querier/src/lib.rs @@ -9,9 +9,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod cache; mod database; mod handler; diff --git a/query_functions/Cargo.toml b/query_functions/Cargo.toml index a0729d0e75..228c2fb019 100644 --- a/query_functions/Cargo.toml +++ b/query_functions/Cargo.toml @@ -9,8 +9,6 @@ license.workspace = true arrow = { workspace = true, features = ["prettyprint"] } chrono = { version = "0.4", default-features = false } datafusion = { workspace = true } -itertools = "0.10.5" -observability_deps = { path = "../observability_deps" } once_cell = "1" regex = "1" regex-syntax = "0.7.1" @@ -19,5 +17,6 @@ snafu = "0.7" workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] +itertools = "0.10.5" tokio = { version = "1.28", features = ["macros", "parking_lot"] } datafusion_util = { path = "../datafusion_util" } diff --git a/query_functions/src/lib.rs b/query_functions/src/lib.rs index 541a6efae9..34586b8dc1 100644 --- a/query_functions/src/lib.rs +++ b/query_functions/src/lib.rs @@ -9,9 +9,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use datafusion::{ execution::FunctionRegistry, prelude::{lit, Expr, SessionContext}, diff --git a/router/Cargo.toml b/router/Cargo.toml index 288752d063..0417991469 100644 --- a/router/Cargo.toml +++ b/router/Cargo.toml @@ -8,7 +8,6 @@ license.workspace = true [dependencies] async-trait = "0.1" authz = { path = "../authz", features = ["http"] } -base64 = "0.21.1" bytes = "1.4" crossbeam-utils = "0.8.15" data_types = { path = "../data_types" } @@ -27,9 +26,7 @@ mutable_batch_pb = { version = "0.1.0", path = "../mutable_batch_pb" } object_store = "0.5.6" observability_deps = { path = "../observability_deps" } parking_lot = "0.12" -schema = { version = "0.1.0", path = "../schema" } serde = "1.0" -serde_json = "1.0.96" serde_urlencoded = "0.7" service_grpc_catalog = { path = "../service_grpc_catalog"} service_grpc_namespace = { path = "../service_grpc_namespace"} @@ -45,6 +42,7 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] assert_matches = "1.5" +base64 = "0.21.0" criterion = { version = "0.4", default-features = false, features = ["async_tokio", "rayon"]} influxdb-line-protocol = { path = "../influxdb_line_protocol" } iox_tests = { path = "../iox_tests" } @@ -53,6 +51,7 @@ paste = "1.0.12" pretty_assertions = "1.3.0" proptest = "1.1.0" rand = "0.8.3" +schema = { version = "0.1.0", path = "../schema" } test_helpers = { version = "0.1.0", path = "../test_helpers", features = ["future_timeout"] } tokio = { version = "1", features = ["test-util"] } tokio-stream = { version = "0.1.13", default_features = false, features = [] } diff --git a/router/src/lib.rs b/router/src/lib.rs index b02a0409e5..9f82b308c9 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -126,10 +126,16 @@ clippy::explicit_iter_loop, clippy::clone_on_ref_ptr, // See https://github.com/influxdata/influxdb_iox/pull/1671 - clippy::future_not_send + clippy::future_not_send, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use criterion as _; +use workspace_hack as _; + pub mod dml_handlers; pub mod namespace_cache; pub mod namespace_resolver; diff --git a/schema/src/lib.rs b/schema/src/lib.rs index 642de4dfb0..98d0113a39 100644 --- a/schema/src/lib.rs +++ b/schema/src/lib.rs @@ -10,9 +10,13 @@ clippy::future_not_send, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{ cmp::Ordering, collections::HashMap, diff --git a/service_common/src/lib.rs b/service_common/src/lib.rs index c92e3cae1d..ce99bee4d2 100644 --- a/service_common/src/lib.rs +++ b/service_common/src/lib.rs @@ -11,8 +11,12 @@ clippy::clone_on_ref_ptr, clippy::todo, clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod error; pub mod planner; pub mod test_util; diff --git a/service_grpc_catalog/Cargo.toml b/service_grpc_catalog/Cargo.toml index 7af0a415b5..f78d34f179 100644 --- a/service_grpc_catalog/Cargo.toml +++ b/service_grpc_catalog/Cargo.toml @@ -10,10 +10,10 @@ data_types = { path = "../data_types" } generated_types = { path = "../generated_types" } iox_catalog = { path = "../iox_catalog" } observability_deps = { path = "../observability_deps" } -tokio = { version = "1", features = ["rt-multi-thread", "macros"] } tonic = { workspace = true } workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] metric = { path = "../metric" } uuid = { version = "1", features = ["v4"] } +tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } diff --git a/service_grpc_catalog/src/lib.rs b/service_grpc_catalog/src/lib.rs index cbf2efc627..f3731a89d0 100644 --- a/service_grpc_catalog/src/lib.rs +++ b/service_grpc_catalog/src/lib.rs @@ -11,9 +11,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use data_types::{PartitionId, TableId}; use generated_types::influxdata::iox::catalog::v1::*; use iox_catalog::interface::{Catalog, SoftDeletedRows}; diff --git a/service_grpc_flight/Cargo.toml b/service_grpc_flight/Cargo.toml index 70f3d5c6d4..6a6eef9a63 100644 --- a/service_grpc_flight/Cargo.toml +++ b/service_grpc_flight/Cargo.toml @@ -8,7 +8,6 @@ license.workspace = true [dependencies] # Workspace dependencies, in alphabetical order authz = { path = "../authz" } -arrow_util = { path = "../arrow_util" } data_types = { path = "../data_types" } datafusion = { workspace = true } flightsql = { path = "../flightsql" } @@ -23,17 +22,17 @@ tracker = { path = "../tracker" } # Crates.io dependencies, in alphabetical order arrow = { workspace = true, features = ["prettyprint"] } arrow-flight = { workspace = true, features=["flight-sql-experimental"] } -async-trait = "0.1" bytes = "1.4" futures = "0.3" prost = "0.11" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.96" snafu = "0.7" -tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } tonic = { workspace = true } workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] -metric = { path = "../metric" } assert_matches = "1" +async-trait = "0.1" +metric = { path = "../metric" } +tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } diff --git a/service_grpc_flight/src/lib.rs b/service_grpc_flight/src/lib.rs index f64eb4ca59..0e5cf6cf9a 100644 --- a/service_grpc_flight/src/lib.rs +++ b/service_grpc_flight/src/lib.rs @@ -12,8 +12,12 @@ clippy::clone_on_ref_ptr, clippy::todo, clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod request; use arrow::error::ArrowError; diff --git a/service_grpc_influxrpc/Cargo.toml b/service_grpc_influxrpc/Cargo.toml index d392265059..d96e0b479f 100644 --- a/service_grpc_influxrpc/Cargo.toml +++ b/service_grpc_influxrpc/Cargo.toml @@ -15,7 +15,6 @@ observability_deps = { path = "../observability_deps" } predicate = { path = "../predicate" } iox_query = { path = "../iox_query" } query_functions = { path = "../query_functions"} -schema = { path = "../schema" } service_common = { path = "../service_common" } trace = { path = "../trace"} trace_http = { path = "../trace_http"} @@ -23,7 +22,6 @@ tracker = { path = "../tracker" } # Crates.io dependencies, in alphabetical order arrow = { workspace = true, features = ["prettyprint"] } -async-trait = "0.1" futures = "0.3" pin-project = "1.1" prost = "0.11" @@ -31,7 +29,6 @@ regex = "1.8.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.96" snafu = "0.7" -tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } tokio-stream = { version = "0.1", features = ["net"] } tonic = { workspace = true } workspace-hack = { version = "0.1", path = "../workspace-hack" } @@ -43,10 +40,11 @@ influxdb_storage_client = { path = "../influxdb_storage_client" } metric = { path = "../metric" } panic_logging = { path = "../panic_logging" } procspawn = { version = "0.10", default-features = false, features = ["test-support", "safe-shared-libraries"] } +schema = { path = "../schema" } +service_grpc_testing = { path = "../service_grpc_testing" } test_helpers = { path = "../test_helpers" } trace_http = { path = "../trace_http" } -service_grpc_testing = { path = "../service_grpc_testing" } # Crates.io dependencies, in alphabetical order parking_lot = "0.12" -serde_urlencoded = "0.7.0" +tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } diff --git a/service_grpc_influxrpc/src/lib.rs b/service_grpc_influxrpc/src/lib.rs index 2869037412..9d3bdb8e3d 100644 --- a/service_grpc_influxrpc/src/lib.rs +++ b/service_grpc_influxrpc/src/lib.rs @@ -12,8 +12,12 @@ clippy::clone_on_ref_ptr, clippy::todo, clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + /// `[0x00]` is the magic value that that the storage gRPC layer uses to /// encode a tag_key that means "measurement name" pub(crate) const TAG_KEY_MEASUREMENT: &[u8] = &[0]; diff --git a/service_grpc_namespace/Cargo.toml b/service_grpc_namespace/Cargo.toml index 1d7488f45a..c44898771b 100644 --- a/service_grpc_namespace/Cargo.toml +++ b/service_grpc_namespace/Cargo.toml @@ -15,7 +15,6 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] assert_matches = "1.5.0" -iox_tests = { path = "../iox_tests" } metric = { path = "../metric" } paste = "1.0.12" tokio = { version = "1", features = ["rt-multi-thread", "macros"] } diff --git a/service_grpc_namespace/src/lib.rs b/service_grpc_namespace/src/lib.rs index 937ca60367..84f754a89c 100644 --- a/service_grpc_namespace/src/lib.rs +++ b/service_grpc_namespace/src/lib.rs @@ -10,8 +10,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::sync::Arc; use data_types::{Namespace as CatalogNamespace, NamespaceName}; diff --git a/service_grpc_object_store/Cargo.toml b/service_grpc_object_store/Cargo.toml index db11c7be1c..dfa76aeebd 100644 --- a/service_grpc_object_store/Cargo.toml +++ b/service_grpc_object_store/Cargo.toml @@ -6,18 +6,18 @@ edition.workspace = true license.workspace = true [dependencies] -data_types = { path = "../data_types" } futures = "0.3" generated_types = { path = "../generated_types" } iox_catalog = { path = "../iox_catalog" } object_store = "0.5.6" observability_deps = { path = "../observability_deps" } parquet_file = { path = "../parquet_file" } -tokio = { version = "1", features = ["rt-multi-thread", "macros"] } tonic = { workspace = true } uuid = { version = "1", features = ["v4"] } workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] bytes = "1.4" +data_types = { path = "../data_types" } metric = { path = "../metric" } +tokio = { version = "1.28", features = ["macros", "net", "parking_lot", "rt-multi-thread", "signal", "sync", "time"] } diff --git a/service_grpc_object_store/src/lib.rs b/service_grpc_object_store/src/lib.rs index d0fc9e41c8..2e388ca4c0 100644 --- a/service_grpc_object_store/src/lib.rs +++ b/service_grpc_object_store/src/lib.rs @@ -12,9 +12,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use futures::{stream::BoxStream, StreamExt}; use generated_types::influxdata::iox::object_store::v1::*; use iox_catalog::interface::Catalog; diff --git a/service_grpc_schema/src/lib.rs b/service_grpc_schema/src/lib.rs index cd386d6b09..612a6da6a4 100644 --- a/service_grpc_schema/src/lib.rs +++ b/service_grpc_schema/src/lib.rs @@ -10,8 +10,12 @@ clippy::todo, clippy::use_self, missing_debug_implementations, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{ops::DerefMut, sync::Arc}; use generated_types::influxdata::iox::schema::v1::*; diff --git a/service_grpc_testing/src/lib.rs b/service_grpc_testing/src/lib.rs index d517f0bc40..6729ca9d35 100644 --- a/service_grpc_testing/src/lib.rs +++ b/service_grpc_testing/src/lib.rs @@ -1,3 +1,8 @@ +#![warn(unused_crate_dependencies)] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use generated_types::i_ox_testing_server::{IOxTesting, IOxTestingServer}; use generated_types::{TestErrorRequest, TestErrorResponse}; use observability_deps::tracing::warn; diff --git a/sharder/Cargo.toml b/sharder/Cargo.toml index 06c4512748..b307e3f298 100644 --- a/sharder/Cargo.toml +++ b/sharder/Cargo.toml @@ -17,7 +17,6 @@ criterion = { version = "0.4", default-features = false, features = ["async_toki hashbrown = { workspace = true } mutable_batch_lp = { path = "../mutable_batch_lp" } rand = "0.8.3" -test_helpers = { path = "../test_helpers" } [[bench]] name = "sharder" diff --git a/sharder/src/lib.rs b/sharder/src/lib.rs index e7c5be757d..aba17a092b 100644 --- a/sharder/src/lib.rs +++ b/sharder/src/lib.rs @@ -14,10 +14,18 @@ clippy::dbg_macro, clippy::clone_on_ref_ptr, // See https://github.com/influxdata/influxdb_iox/pull/1671 - clippy::future_not_send + clippy::future_not_send, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items)] +// Workaround for "unused crate" lint false positives. +#[cfg(test)] +use criterion as _; +#[cfg(test)] +use rand as _; +use workspace_hack as _; + mod r#trait; pub use r#trait::*; diff --git a/sqlx-hotswap-pool/Cargo.toml b/sqlx-hotswap-pool/Cargo.toml index 9d470c3556..3bed63d6ec 100644 --- a/sqlx-hotswap-pool/Cargo.toml +++ b/sqlx-hotswap-pool/Cargo.toml @@ -12,10 +12,10 @@ publish = false [dependencies] sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "postgres", "json", "tls"] } either = "1.8.1" -tokio = { version = "1.28", features = ["rt-multi-thread", "macros", "parking_lot"] } futures = "0.3" workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] dotenvy = "0.15.7" rand = { version = "0.8", features = ["small_rng"] } +tokio = { version = "1.28", features = ["rt-multi-thread", "macros", "parking_lot"] } diff --git a/sqlx-hotswap-pool/src/lib.rs b/sqlx-hotswap-pool/src/lib.rs index 8a35c36852..db913cf8d8 100644 --- a/sqlx-hotswap-pool/src/lib.rs +++ b/sqlx-hotswap-pool/src/lib.rs @@ -13,10 +13,14 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #![allow(clippy::missing_docs_in_private_items, clippy::type_complexity)] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::sync::{Arc, RwLock}; use either::Either; diff --git a/test_helpers/src/lib.rs b/test_helpers/src/lib.rs index a895a905cc..1e4dc0b5b3 100644 --- a/test_helpers/src/lib.rs +++ b/test_helpers/src/lib.rs @@ -6,9 +6,13 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{ env, f64, sync::{Arc, Once}, diff --git a/test_helpers_end_to_end/src/lib.rs b/test_helpers_end_to_end/src/lib.rs index 227c6e43ce..e6d1db77a0 100644 --- a/test_helpers_end_to_end/src/lib.rs +++ b/test_helpers_end_to_end/src/lib.rs @@ -1,3 +1,8 @@ +#![warn(unused_crate_dependencies)] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use rand::{ distributions::{Alphanumeric, Standard}, thread_rng, Rng, diff --git a/trace/src/lib.rs b/trace/src/lib.rs index c7cf92eefa..f56e900e6d 100644 --- a/trace/src/lib.rs +++ b/trace/src/lib.rs @@ -7,9 +7,13 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{any::Any, collections::VecDeque}; use parking_lot::Mutex; diff --git a/trace_exporters/Cargo.toml b/trace_exporters/Cargo.toml index 60abf1e1da..c8cb715b3e 100644 --- a/trace_exporters/Cargo.toml +++ b/trace_exporters/Cargo.toml @@ -8,7 +8,6 @@ license.workspace = true [dependencies] async-trait = "0.1" -chrono = { version = "0.4", default-features = false, features = ["clock"] } clap = { version = "4", features = ["derive", "env"] } futures = "0.3" iox_time = { path = "../iox_time" } @@ -20,3 +19,4 @@ trace = { path = "../trace" } workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] +chrono = { version = "0.4", default-features = false, features = ["clock"] } \ No newline at end of file diff --git a/trace_exporters/src/lib.rs b/trace_exporters/src/lib.rs index 1b2d778408..d45af9a1c9 100644 --- a/trace_exporters/src/lib.rs +++ b/trace_exporters/src/lib.rs @@ -7,9 +7,13 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use crate::export::AsyncExporter; use crate::jaeger::JaegerAgentExporter; use iox_time::SystemProvider; diff --git a/trace_http/src/lib.rs b/trace_http/src/lib.rs index c2f16a2c0b..2aeb039813 100644 --- a/trace_http/src/lib.rs +++ b/trace_http/src/lib.rs @@ -7,9 +7,13 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod classify; pub mod ctx; mod metrics; diff --git a/tracker/src/lib.rs b/tracker/src/lib.rs index dac4673630..0070cb3eb2 100644 --- a/tracker/src/lib.rs +++ b/tracker/src/lib.rs @@ -7,9 +7,13 @@ // See https://github.com/influxdata/influxdb_iox/pull/1671 clippy::future_not_send, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + mod async_semaphore; mod lock; mod task; diff --git a/trogging/src/lib.rs b/trogging/src/lib.rs index 14fd4809a6..2f58c6a432 100644 --- a/trogging/src/lib.rs +++ b/trogging/src/lib.rs @@ -10,7 +10,8 @@ clippy::use_self, clippy::clone_on_ref_ptr, clippy::todo, - clippy::dbg_macro + clippy::dbg_macro, + unused_crate_dependencies )] #[cfg(feature = "clap")] diff --git a/wal/src/lib.rs b/wal/src/lib.rs index 4b1fdc1d6e..b9695321d4 100644 --- a/wal/src/lib.rs +++ b/wal/src/lib.rs @@ -1,15 +1,20 @@ +//! # WAL +//! +//! This crate provides a local-disk WAL for the IOx ingestion pipeline. + #![deny(rustdoc::broken_intra_doc_links, rust_2018_idioms)] #![warn( missing_copy_implementations, missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, - clippy::clone_on_ref_ptr + clippy::clone_on_ref_ptr, + unused_crate_dependencies )] -//! # WAL -//! -//! This crate provides a local-disk WAL for the IOx ingestion pipeline. +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::{ collections::BTreeMap, fs::File, diff --git a/wal_inspect/Cargo.toml b/wal_inspect/Cargo.toml index 9b5f30678b..e35aa3965c 100644 --- a/wal_inspect/Cargo.toml +++ b/wal_inspect/Cargo.toml @@ -7,19 +7,19 @@ license.workspace = true [dependencies] # In alphabetical order data_types = { version = "0.1.0", path = "../data_types" } -dml = { version = "0.1.0", path = "../dml" } -generated_types = { version = "0.1.0", path = "../generated_types" } hashbrown.workspace = true mutable_batch = { version = "0.1.0", path = "../mutable_batch" } -mutable_batch_pb = { version = "0.1.0", path = "../mutable_batch_pb" } parquet_to_line_protocol = { version = "0.1.0", path = "../parquet_to_line_protocol" } schema = { version = "0.1.0", path = "../schema" } thiserror = "1.0.40" -wal = { version = "0.1.0", path = "../wal" } workspace-hack = { version = "0.1", path = "../workspace-hack" } [dev-dependencies] # In alphabetical order assert_matches = "1.5.0" +dml = { version = "0.1.0", path = "../dml" } +generated_types = { version = "0.1.0", path = "../generated_types" } mutable_batch_lp = { path = "../mutable_batch_lp" } +mutable_batch_pb = { version = "0.1.0", path = "../mutable_batch_pb" } test_helpers = { path = "../test_helpers" } tokio = { version = "1.27", features = ["macros", "parking_lot", "rt-multi-thread", "sync", "time"] } +wal = { version = "0.1.0", path = "../wal" } diff --git a/wal_inspect/src/lib.rs b/wal_inspect/src/lib.rs index 3f9ac0c7c6..dab35c356c 100644 --- a/wal_inspect/src/lib.rs +++ b/wal_inspect/src/lib.rs @@ -14,8 +14,13 @@ clippy::use_self, missing_copy_implementations, missing_debug_implementations, - missing_docs + missing_docs, + unused_crate_dependencies )] + +// Workaround for "unused crate" lint false positives. +use workspace_hack as _; + use std::borrow::Cow; use std::io::Write; From e61fb3a78cc37480cd4483cd6bed19b336ccfa8d Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Mon, 22 May 2023 17:19:37 +0200 Subject: [PATCH 21/22] test: remove line numbers from asserts I don't think the tests are that specific that they need to assert the line. --- influxdb_iox/tests/end_to_end_cases/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/influxdb_iox/tests/end_to_end_cases/error.rs b/influxdb_iox/tests/end_to_end_cases/error.rs index 095e085ebd..cd40cf94ae 100644 --- a/influxdb_iox/tests/end_to_end_cases/error.rs +++ b/influxdb_iox/tests/end_to_end_cases/error.rs @@ -37,6 +37,6 @@ async fn assert_panic_logging(connection: Connection, log_path: Box) { // check logs let logs = std::fs::read_to_string(log_path).unwrap(); - let expected_error = "'This is a test panic', service_grpc_testing/src/lib.rs:18:9"; + let expected_error = "'This is a test panic', service_grpc_testing/src/lib.rs:"; assert_contains!(logs, expected_error); } From 94203287f0308dfc1fb3b69647cc6dc92102c1d1 Mon Sep 17 00:00:00 2001 From: Dom Dwyer Date: Tue, 23 May 2023 14:53:24 +0200 Subject: [PATCH 22/22] test: fix line number test This test failed because it references line numbers that changed. --- panic_logging/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panic_logging/src/lib.rs b/panic_logging/src/lib.rs index b046c55462..b82f3b461f 100644 --- a/panic_logging/src/lib.rs +++ b/panic_logging/src/lib.rs @@ -260,9 +260,9 @@ mod tests { assert_eq!( capture.to_string(), - "level = ERROR; message = Thread panic; panic_type = \"unknown\"; panic_info = panicked at 'it's bananas', panic_logging/src/lib.rs:223:13; \ - \nlevel = ERROR; message = Thread panic; panic_type = \"offset_overflow\"; panic_info = panicked at 'offset', panic_logging/src/lib.rs:231:13; \ - \nlevel = ERROR; message = Thread panic; panic_type = \"offset_overflow\"; panic_info = panicked at 'offset overflow', panic_logging/src/lib.rs:240:13; ", + "level = ERROR; message = Thread panic; panic_type = \"unknown\"; panic_info = panicked at 'it's bananas', panic_logging/src/lib.rs:227:13; \n\ + level = ERROR; message = Thread panic; panic_type = \"offset_overflow\"; panic_info = panicked at 'offset', panic_logging/src/lib.rs:235:13; \n\ + level = ERROR; message = Thread panic; panic_type = \"offset_overflow\"; panic_info = panicked at 'offset overflow', panic_logging/src/lib.rs:244:13; " ); } }