Skip to content

Commit

Permalink
Cleanup post router-bridge removal (#6512)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin authored Jan 10, 2025
1 parent 4dd7df8 commit a80938d
Show file tree
Hide file tree
Showing 34 changed files with 139 additions and 302 deletions.
4 changes: 2 additions & 2 deletions apollo-router/src/axum_factory/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use crate::http_server_factory::HttpServerFactory;
use crate::http_server_factory::HttpServerHandle;
use crate::json_ext::Path;
use crate::plugin::test::MockSubgraph;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::router_factory::create_plugins;
use crate::router_factory::Endpoint;
use crate::router_factory::RouterFactory;
Expand Down Expand Up @@ -2266,7 +2266,7 @@ async fn test_supergraph_timeout() {

let schema = include_str!("..//testdata/minimal_supergraph.graphql");
let schema = Arc::new(Schema::parse(schema, &conf).unwrap());
let planner = BridgeQueryPlannerPool::new(schema.clone(), conf.clone())
let planner = QueryPlannerService::new(schema.clone(), conf.clone())
.await
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion apollo-router/src/plugins/authorization/authenticated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ mod tests {
#[tokio::test]
async fn introspection_mixed_with_authenticated_fields() {
// Note: in https://github.com/apollographql/router/pull/5952/ we moved introspection handling
// before authorization filtering in bridge_query_planner.rs, relying on the fact that queries
// before authorization filtering in query_planner_service.rs, relying on the fact that queries
// mixing introspection and concrete fields are not supported, so introspection answers right
// away. If this ever changes, we should make sure that unauthorized fields are still properly
// filtered out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,8 @@ mod tests {
use tower::Service;

use super::*;
use crate::introspection::IntrospectionCache;
use crate::plugins::authorization::CacheKeyMetadata;
use crate::query_planner::BridgeQueryPlanner;
use crate::query_planner::QueryPlannerService;
use crate::services::layers::query_analysis::ParsedDocument;
use crate::services::query_planner::PlanOptions;
use crate::services::QueryPlannerContent;
Expand Down Expand Up @@ -722,13 +721,9 @@ mod tests {
.unwrap_or_default();
let supergraph_schema = schema.supergraph_schema().clone();

let mut planner = BridgeQueryPlanner::new(
schema.into(),
config.clone(),
Arc::new(IntrospectionCache::new(&config)),
)
.await
.unwrap();
let mut planner = QueryPlannerService::new(schema.into(), config.clone())
.await
.unwrap();

let ctx = Context::new();
ctx.extensions()
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/include_subgraph_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod test {
use crate::json_ext::Object;
use crate::plugin::test::MockSubgraph;
use crate::plugin::DynPlugin;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::router_factory::create_plugins;
use crate::services::layers::persisted_queries::PersistedQueryLayer;
use crate::services::layers::query_analysis::QueryAnalysisLayer;
Expand Down Expand Up @@ -210,7 +210,7 @@ mod test {
include_str!("../../../apollo-router-benchmarks/benches/fixtures/supergraph.graphql");
let schema = Schema::parse(schema, &configuration).unwrap();

let planner = BridgeQueryPlannerPool::new(schema.into(), Arc::clone(&configuration))
let planner = QueryPlannerService::new(schema.into(), Arc::clone(&configuration))
.await
.unwrap();
let schema = planner.schema();
Expand Down
6 changes: 2 additions & 4 deletions apollo-router/src/plugins/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use tower::BoxError;
use tower::ServiceBuilder;
use tower_service::Service;

use crate::introspection::IntrospectionCache;
use crate::plugin::DynPlugin;
use crate::plugin::PluginInit;
use crate::plugin::PluginPrivate;
use crate::query_planner::BridgeQueryPlanner;
use crate::query_planner::QueryPlannerService;
use crate::services::execution;
use crate::services::http;
use crate::services::router;
Expand Down Expand Up @@ -94,8 +93,7 @@ impl<T: Into<Box<dyn DynPlugin + 'static>> + 'static> PluginTestHarness<T> {
let schema = Schema::parse(schema, &config).unwrap();
let sdl = schema.raw_sdl.clone();
let supergraph = schema.supergraph_schema().clone();
let introspection = Arc::new(IntrospectionCache::new(&config));
let planner = BridgeQueryPlanner::new(schema.into(), Arc::new(config), introspection)
let planner = QueryPlannerService::new(schema.into(), Arc::new(config))
.await
.unwrap();
(sdl, supergraph, planner.subgraph_schemas())
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/traffic_shaping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ mod test {
use crate::plugin::test::MockSubgraph;
use crate::plugin::test::MockSupergraphService;
use crate::plugin::DynPlugin;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::router_factory::create_plugins;
use crate::services::layers::persisted_queries::PersistedQueryLayer;
use crate::services::layers::query_analysis::QueryAnalysisLayer;
Expand Down Expand Up @@ -528,7 +528,7 @@ mod test {

let config = Arc::new(config);
let schema = Arc::new(Schema::parse(schema, &config).unwrap());
let planner = BridgeQueryPlannerPool::new(schema.clone(), config.clone())
let planner = QueryPlannerService::new(schema.clone(), config.clone())
.await
.unwrap();
let subgraph_schemas = planner.subgraph_schemas();
Expand Down
113 changes: 0 additions & 113 deletions apollo-router/src/query_planner/bridge_query_planner_pool.rs

This file was deleted.

4 changes: 2 additions & 2 deletions apollo-router/src/query_planner/caching_query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::plugins::authorization::CacheKeyMetadata;
use crate::plugins::progressive_override::LABELS_TO_OVERRIDE_KEY;
use crate::plugins::telemetry::utils::Timer;
use crate::query_planner::fetch::SubgraphSchemas;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::services::layers::persisted_queries::PersistedQueryLayer;
use crate::services::layers::query_analysis::ParsedDocument;
use crate::services::layers::query_analysis::QueryAnalysisLayer;
Expand Down Expand Up @@ -338,7 +338,7 @@ where
}
}

impl CachingQueryPlanner<BridgeQueryPlannerPool> {
impl CachingQueryPlanner<QueryPlannerService> {
pub(crate) fn subgraph_schemas(
&self,
) -> Arc<HashMap<String, Arc<Valid<apollo_compiler::Schema>>>> {
Expand Down
6 changes: 2 additions & 4 deletions apollo-router/src/query_planner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
#![allow(missing_docs)] // FIXME

pub(crate) use bridge_query_planner::*;
pub(crate) use bridge_query_planner_pool::*;
pub(crate) use caching_query_planner::*;
pub use plan::QueryPlan;
pub(crate) use plan::*;
pub(crate) use query_planner_service::*;

pub use self::fetch::OperationKind;

pub(crate) mod bridge_query_planner;
mod bridge_query_planner_pool;
mod caching_query_planner;
mod convert;
mod execution;
pub(crate) mod fetch;
mod labeler;
mod plan;
pub(crate) mod query_planner_service;
pub(crate) mod rewrites;
mod selection;
mod subgraph_context;
Expand Down
Loading

0 comments on commit a80938d

Please sign in to comment.