Skip to content

Commit

Permalink
ROVER-244 Remove dead code and tidy up (#2352)
Browse files Browse the repository at this point in the history
As per title, now we're coming to the end of the refactor we can remove
the code we're no longer using and tidy up our dependencies etc.
  • Loading branch information
jonathanrainer authored Jan 20, 2025
1 parent 167c8e5 commit e3226cb
Show file tree
Hide file tree
Showing 45 changed files with 89 additions and 3,824 deletions.
3 changes: 1 addition & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
xtask = "run --package xtask --"
rover = "run --package rover --"
install-rover = "run --release --package rover -- install --force"
test-next = "test --all-features -- --nocapture"
build-next = "build --features composition-js,dev-next"
test-next = "test --all-features -- --nocapture"
4 changes: 0 additions & 4 deletions .github/workflows/run-smokes-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
description: 'JSON list of router versions'
required: true
type: string
dev-next:
description: 'Compile binaries with the dev-next flag'
type: boolean

name: "Run Smoke Tests (Manually)"
jobs:
Expand All @@ -20,5 +17,4 @@ jobs:
with:
composition-versions: ${{ inputs.composition-versions }}
router-versions: ${{ inputs.router-versions }}
dev-next: ${{ inputs.dev-next }}
secrets: inherit
7 changes: 2 additions & 5 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
description: 'JSON list of router versions'
required: true
type: string
dev-next:
description: 'Compile with the dev-next flag'
type: boolean

#TODO: When GitHub Actions supports ARM based Linux images for public repos: https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/ this will need to be added
name: Smoke Tests
Expand Down Expand Up @@ -47,12 +44,12 @@ jobs:
yum -y install perl-core gcc openssl-devel openssl git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
cargo build --features ${{ inputs.dev-next && 'dev-next' || 'default' }} --target ${{ matrix.compile_target.target }} --test e2e
cargo build --target ${{ matrix.compile_target.target }} --test e2e
- if: ${{ matrix.compile_target.container == '' }}
name: "Build binaries on host"
run: |
rustup target add ${{ matrix.compile_target.target }}
cargo build --features ${{ inputs.dev-next && 'dev-next' || 'default' }} --target ${{ matrix.compile_target.target }} --test e2e
cargo build --target ${{ matrix.compile_target.target }} --test e2e
- uses: actions/upload-artifact@v4
name: "Store built binaries to use later on"
with:
Expand Down
57 changes: 0 additions & 57 deletions Cargo.lock

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

9 changes: 0 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ default = ["composition-js"]
# notably, it is disabled for x86_64-unknown-linux-musl builds
# because of this GitHub issue: https://github.com/denoland/deno/issues/3711
composition-js = []
dev-next = ["composition-rewrite"]
composition-rewrite = []

### cross-workspace dependencies
# these dependencies can be used by any other workspace crate by specifying the dependency like so:
Expand Down Expand Up @@ -95,8 +93,6 @@ clap = "4"
chrono = "0.4"
ci_info = "0.14"
console = "0.15"
crossbeam-channel = "0.5"
ctrlc = "3"
derive-getters = "0.5.0"
dialoguer = "0.11"
directories-next = "2.0"
Expand All @@ -112,7 +108,6 @@ http-body = "1.0.1"
http-body-util = "0.1.2"
httpmock = "0.7"
hyper = "1.0"
interprocess = { version = "2", default-features = false }
indoc = "2"
itertools = "0.13.0"
lazycell = "1"
Expand Down Expand Up @@ -181,8 +176,6 @@ camino = { workspace = true }
clap = { workspace = true, features = ["color", "derive", "env"] }
chrono = { workspace = true }
console = { workspace = true }
crossbeam-channel = { workspace = true }
ctrlc = { workspace = true }
derive-getters = { workspace = true }
dialoguer = { workspace = true }
flate2 = { workspace = true }
Expand All @@ -191,7 +184,6 @@ graphql_client = { workspace = true }
heck = { workspace = true }
http = { workspace = true }
houston = { workspace = true }
interprocess = { workspace = true }
itertools = { workspace = true }
prettytable-rs = { workspace = true }
lazycell = { workspace = true }
Expand Down Expand Up @@ -228,7 +220,6 @@ toml = { workspace = true }
tower = { workspace = true }
tower-lsp = { version = "0.20.0" }
tracing = { workspace = true }
which = { workspace = true }
uuid = { workspace = true }
url = { workspace = true, features = ["serde"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/rover-std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl Fs {
}));
return;
}
Err(err) => {
Err(_err) => {
let _ = tx.send(Err(RoverStdError::FileRemoved {
file: path.display().to_string(),
}));
Expand Down
57 changes: 18 additions & 39 deletions src/command/dev/next/mod.rs → src/command/dev/do_dev.rs
Original file line number Diff line number Diff line change
@@ -1,52 +1,33 @@
#![warn(missing_docs)]

use std::{io::stdin, str::FromStr};
use std::io::stdin;
use std::str::FromStr;

use apollo_federation_types::config::{FederationVersion, RouterVersion};
use camino::Utf8PathBuf;
use futures::StreamExt;
use houston::{Config, Profile};
use router::{
hot_reload::HotReloadConfigOverrides, install::InstallRouter, run::RunRouter,
watchers::file::FileWatcher,
};
use rover_client::operations::config::who_am_i::WhoAmI;
use rover_std::{errln, infoln, warnln};
use semver::Version;
use tower::ServiceExt;

use self::router::config::{RouterAddress, RunRouterConfig};
use crate::command::dev::router::config::RouterAddress;
use crate::command::dev::router::hot_reload::HotReloadConfigOverrides;
use crate::command::dev::router::run::RunRouter;
use crate::command::dev::{OVERRIDE_DEV_COMPOSITION_VERSION, OVERRIDE_DEV_ROUTER_VERSION};
use crate::command::Dev;
use crate::composition::pipeline::CompositionPipeline;
use crate::composition::supergraph::binary::OutputTarget;
use crate::composition::supergraph::config::full::introspect::MakeResolveIntrospectSubgraph;
use crate::composition::supergraph::config::resolver::fetch_remote_subgraph::MakeFetchRemoteSubgraph;
use crate::composition::supergraph::config::resolver::fetch_remote_subgraphs::MakeFetchRemoteSubgraphs;
use crate::composition::supergraph::config::resolver::SubgraphPrompt;
use crate::composition::FederationUpdaterConfig;
use crate::{
command::{
dev::{OVERRIDE_DEV_COMPOSITION_VERSION, OVERRIDE_DEV_ROUTER_VERSION},
Dev,
},
composition::{
pipeline::CompositionPipeline,
supergraph::config::{
full::introspect::MakeResolveIntrospectSubgraph,
resolver::{
fetch_remote_subgraph::MakeFetchRemoteSubgraph,
fetch_remote_subgraphs::MakeFetchRemoteSubgraphs,
},
},
},
utils::{
client::StudioClientConfig,
effect::{
exec::{TokioCommand, TokioSpawn},
read_file::FsReadFile,
write_file::FsWriteFile,
},
env::RoverEnvKey,
},
RoverOutput, RoverResult,
};

mod router;
use crate::utils::client::StudioClientConfig;
use crate::utils::effect::exec::{TokioCommand, TokioSpawn};
use crate::utils::effect::read_file::FsReadFile;
use crate::utils::effect::write_file::FsWriteFile;
use crate::utils::env::RoverEnvKey;
use crate::{RoverOutput, RoverResult};

impl Dev {
/// Runs rover dev
Expand Down Expand Up @@ -76,7 +57,6 @@ impl Dev {
let service = client_config
.get_authenticated_client(profile)?
.studio_graphql_service()?;

let who_am_i_service = WhoAmI::new(service);

let fetch_remote_subgraphs_factory = MakeFetchRemoteSubgraphs::builder()
Expand Down Expand Up @@ -208,7 +188,7 @@ impl Dev {
);

let run_router = RunRouter::default()
.install::<InstallRouter>(
.install(
router_version,
client_config.clone(),
override_install_path,
Expand All @@ -224,7 +204,6 @@ impl Dev {
Some(credential.clone()),
)
.await;

// This RouterAddress has some logic figuring out _which_ of the potentially multiple
// address options we should use (eg, CLI, config, env var, or default). It will be used in
// the overrides for the temporary config we set for hot-reloading the router, but also as
Expand Down
Loading

0 comments on commit e3226cb

Please sign in to comment.