diff --git a/crates/rover-client/src/operations/graph/introspect/runner.rs b/crates/rover-client/src/operations/graph/introspect/runner.rs index f6f5655b7..9f891e78d 100644 --- a/crates/rover-client/src/operations/graph/introspect/runner.rs +++ b/crates/rover-client/src/operations/graph/introspect/runner.rs @@ -14,7 +14,6 @@ use std::convert::{Into, TryFrom}; response_derives = "PartialEq, Eq, Debug, Serialize, Deserialize", deprecated = "warn" )] - /// This struct is used to generate the module containing `Variables` and /// `ResponseData` structs. /// Snake case of this name is the mod name. i.e. graph_introspect_query diff --git a/crates/rover-client/src/operations/readme/publish/runner.rs b/crates/rover-client/src/operations/readme/publish/runner.rs index 2b0227373..7bddd1b90 100644 --- a/crates/rover-client/src/operations/readme/publish/runner.rs +++ b/crates/rover-client/src/operations/readme/publish/runner.rs @@ -16,7 +16,6 @@ type Timestamp = String; response_derives = "Eq, PartialEq, Debug, Serialize, Deserialize", deprecated = "warn" )] - pub struct ReadmePublishMutation; pub async fn run( diff --git a/crates/rover-client/src/operations/subgraph/introspect/runner.rs b/crates/rover-client/src/operations/subgraph/introspect/runner.rs index 95024a1e9..0611929a4 100644 --- a/crates/rover-client/src/operations/subgraph/introspect/runner.rs +++ b/crates/rover-client/src/operations/subgraph/introspect/runner.rs @@ -14,7 +14,6 @@ use graphql_client::*; response_derives = "Eq, PartialEq, Debug, Serialize, Deserialize", deprecated = "warn" )] - pub(crate) struct SubgraphIntrospectQuery; pub async fn run( diff --git a/rust-toolchain.toml b/rust-toolchain.toml index fad0bb2d8..c6d8cdf27 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.82.0" +channel = "1.83.0" components = [ "rustfmt", "clippy" ] diff --git a/src/composition/supergraph/config/resolve/mod.rs b/src/composition/supergraph/config/resolve/mod.rs index 07d1a8e5e..647c8aecf 100644 --- a/src/composition/supergraph/config/resolve/mod.rs +++ b/src/composition/supergraph/config/resolve/mod.rs @@ -222,6 +222,7 @@ pub struct FullyResolvedSubgraphs { impl FullyResolvedSubgraphs { #[cfg(test)] + /// Used to create a new set of FullyResolvedSubgraphs for testing purposes pub fn new(subgraphs: BTreeMap) -> FullyResolvedSubgraphs { FullyResolvedSubgraphs { subgraphs } } @@ -278,7 +279,6 @@ impl From for SupergraphConfig { #[cfg(test)] mod tests { - use std::{ collections::{BTreeMap, HashSet}, str::FromStr, diff --git a/src/error/mod.rs b/src/error/mod.rs index 2ed9a0611..de90b496d 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -104,14 +104,14 @@ impl RoverError { } pub(crate) fn get_internal_data_json(&self) -> Value { - return match self.error.downcast_ref::() { + match self.error.downcast_ref::() { Some(RoverClientError::CheckWorkflowFailure { graph_ref: _, check_response, }) => check_response.get_json(), Some(RoverClientError::LintFailures { lint_response }) => lint_response.get_json(), _ => Value::Null, - }; + } } pub(crate) fn get_internal_error_json(&self) -> Value { diff --git a/src/options/introspect.rs b/src/options/introspect.rs index 16b2fd47f..ba0515f42 100644 --- a/src/options/introspect.rs +++ b/src/options/introspect.rs @@ -22,9 +22,9 @@ pub struct IntrospectOpts { /// Headers to pass to the endpoint. Values must be key:value pairs. /// If a value has a space in it, use quotes around the pair, /// ex. -H "Auth:some key" - - // The `value_name` here is for the help text and error messages, to print like - // --header rather than the plural field name --header + /// + /// The `value_name` here is for the help text and error messages, to print like + /// --header rather than the plural field name --header #[arg(value_name="KEY:VALUE", long="header", short='H', value_parser = parse_header)] #[serde(skip_serializing)] pub headers: Option>, diff --git a/src/utils/supergraph_config.rs b/src/utils/supergraph_config.rs index a8f64e4e2..09820cbcc 100644 --- a/src/utils/supergraph_config.rs +++ b/src/utils/supergraph_config.rs @@ -487,7 +487,7 @@ mod test_get_supergraph_config { let supergraph_config_path = third_level_folder.path().join("supergraph.yaml"); fs::write( supergraph_config_path.clone(), - &supergraph_config.into_bytes(), + supergraph_config.into_bytes(), ) .expect("Could not write supergraph.yaml"); @@ -1185,7 +1185,7 @@ subgraphs: routing_url: https://people.example.com schema: file: ./people.graphql"#, - latest_fed2_version.to_string() + latest_fed2_version ); let tmp_home = TempDir::new().unwrap(); let mut config_path = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap(); @@ -1225,7 +1225,7 @@ subgraphs: routing_url: https://people.example.com schema: file: ../../people.graphql"#, - latest_fed2_version.to_string() + latest_fed2_version ); let tmp_home = TempDir::new().unwrap(); let tmp_dir = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap(); @@ -1279,7 +1279,7 @@ subgraphs: routing_url: https://people.example.com schema: file: ../../people.graphql"#, - latest_fed2_version.to_string() + latest_fed2_version ); let tmp_home = TempDir::new().unwrap(); let tmp_dir = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap(); diff --git a/tests/e2e/dev.rs b/tests/e2e/dev.rs index bed8df697..a39b3b72f 100644 --- a/tests/e2e/dev.rs +++ b/tests/e2e/dev.rs @@ -47,6 +47,7 @@ fn run_rover_dev(run_subgraphs_retail_supergraph: &RetailSupergraph) -> String { if let Ok(version) = env::var("APOLLO_ROVER_DEV_ROUTER_VERSION") { cmd.env("APOLLO_ROVER_DEV_ROUTER_VERSION", version); }; + #[allow(clippy::zombie_processes)] cmd.spawn().expect("Could not run rover dev command"); tokio::task::block_in_place(|| { let handle = tokio::runtime::Handle::current(); diff --git a/tests/e2e/graph/introspect.rs b/tests/e2e/graph/introspect.rs index 758adb47d..def8dc8eb 100644 --- a/tests/e2e/graph/introspect.rs +++ b/tests/e2e/graph/introspect.rs @@ -87,6 +87,7 @@ async fn e2e_test_rover_graph_introspect_watch( .expect("Could not create output file"); // Create the Rover command to run the introspection in `--watch` mode let mut cmd = Command::cargo_bin("rover").expect("Could not find necessary binary"); + let mut child = cmd .args([ "graph", @@ -141,6 +142,7 @@ async fn e2e_test_rover_graph_introspect_watch( info!("Killing rover process..."); // Kill the watch process to ensure the file doesn't change again now child.kill().expect("Could not kill rover process"); + child.wait().expect("Wait for rover process to finish"); info!("Extract new value from file..."); // Get the new result from the file diff --git a/tests/e2e/mod.rs b/tests/e2e/mod.rs index 90e14a72e..04ab41623 100644 --- a/tests/e2e/mod.rs +++ b/tests/e2e/mod.rs @@ -2,7 +2,6 @@ use std::collections::HashMap; use std::env; use std::io::BufRead; use std::io::BufReader; -use std::path::Path; use std::path::PathBuf; use std::process::ChildStderr; use std::time::Duration; diff --git a/tests/e2e/subgraph/introspect.rs b/tests/e2e/subgraph/introspect.rs index a05093540..c9dc4c4f9 100644 --- a/tests/e2e/subgraph/introspect.rs +++ b/tests/e2e/subgraph/introspect.rs @@ -96,6 +96,9 @@ async fn e2e_test_rover_subgraph_introspect_watch( .expect("Could not create output file"); // Create the Rover command to run the introspection in `--watch` mode let mut cmd = Command::cargo_bin("rover").expect("Could not find necessary binary"); + // TODO: We should return to this once Clippy have stabilised their linting on this issue: + // https://github.com/rust-lang/rust-clippy/pull/13760 + #[allow(clippy::zombie_processes)] let mut child = cmd .args([ "subgraph", @@ -158,6 +161,9 @@ async fn e2e_test_rover_subgraph_introspect_watch( info!("Killing rover process..."); // Kill the watch process to ensure the file doesn't change again now child.kill().expect("Could not kill rover process"); + child + .wait() + .expect("Could not wait for rover process to finish"); info!("Extract new value from file..."); // Get the new result from the file