Skip to content

feat(incremental-planner): add router integration and native_connectors config - #10156

Draft
tninesling wants to merge 6 commits into
tninesling/inc-port-25-connector-routingfrom
tninesling/inc-port-26-router-integration
Draft

feat(incremental-planner): add router integration and native_connectors config#10156
tninesling wants to merge 6 commits into
tninesling/inc-port-25-connector-routingfrom
tninesling/inc-port-26-router-integration

Conversation

@tninesling

@tninesling tninesling commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires the incremental planner end-to-end into the router and adds native_connectors configuration.

  • IncrementalPlanner config struct (enabled, beam_width, fuel) in router Configuration
  • native_connectors flag: when true, schema parsing skips expensive virtual-subgraph expansion and the incremental planner is implicitly enabled
  • BULB planner's wall-clock timeout derived from cooperative cancellation config when in enforce mode
  • Both config options register always-on usage gauges (apollo.router.config.incremental_planner, apollo.router.config.native_connectors) in populate_config_instruments
  • FetchProtocol wired through router execution layer: fetch_service tries the protocol coordinate first (native connector path), falling back to service-name lookup (expansion-based path)
  • Coverage tests bringing defer.rs (40%→98%), fetch_graph/mod.rs (28%→97%), selection_builder.rs (13%→99%) above thresholds
  • Integration tests: nested @defer, @skip/@include on cross-subgraph fields, three-way entity hops, aliased fields
  • native_connectors integration tests ported from router-private

Test plan

  • Unit tests for defer, fetch_graph, selection_builder coverage
  • Integration tests for nested defer, directive handling, entity hops
  • native_connectors end-to-end tests
  • Full apollo-federation suite (2938 tests) passes

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

No user-facing changes; internal planner feature behind feature flag. Config metrics added per guidelines.

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

tninesling and others added 4 commits September 2, 2026 15:39
Plumb the FetchProtocol field from federation's FetchNode into the
router's FetchNode and fetch dispatch. The incremental planner tags
connector fetches with FetchProtocol::Connector carrying the directive
coordinate, so the fetch service can resolve the connector by identity
instead of relying on the synthetic service name from expansion.

The dual-path lookup in fetch_service tries the protocol coordinate
first (native connector path), falling back to the service-name-based
lookup (expansion-based planner path).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the IncrementalPlanner config struct (enabled, beam_width, fuel)
and native_connectors flag to the router Configuration. When
native_connectors is true, schema parsing skips the expensive
virtual-subgraph expansion and the incremental planner is implicitly
enabled.

The BULB planner's wall-clock timeout is derived from the cooperative
cancellation config when in enforce mode, keeping fuel-based planning
deterministic while respecting request deadlines.

Both new config options register always-on usage gauges
(apollo.router.config.incremental_planner and
apollo.router.config.native_connectors) in populate_config_instruments
so adoption is measurable from day one.

Also removes the allow(dead_code) on the plan_builder module now that
the planner is wired end-to-end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port the native_connectors test module from router-private, covering
end-to-end connector execution, schema parsing without synthetic
subgraphs, and scaling benchmarks. Remove #[allow(dead_code)] from
the CommitTarget field now reachable through the wired-up planner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unit and integration tests to bring coverage above 50% for:
- defer.rs: 40% -> 98% (nested defer, bare fragments, serialization)
- fetch_graph/mod.rs: 28% -> 97% (Display, defer groups, root hops,
  reachability, rollback for deferred entities)
- selection_builder.rs: 13% -> 99% (save/restore, merge, signatures)

Also adds integration tests for nested @defer, @skip/@include on
cross-subgraph fields, three-way entity hops, and aliased fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tninesling
tninesling requested review from a team as code owners September 2, 2026 22:14
@apollo-librarian

apollo-librarian Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

1 new, 20 changed, 0 removed
+ graphos/routing/(latest)/upgrade/from-router-v2.mdx
* graphos/routing/(latest)/configuration/yaml.mdx
* graphos/routing/(latest)/customization/native-plugins.mdx
* graphos/routing/(latest)/customization/coprocessor/index.mdx
* graphos/routing/(latest)/customization/rhai/index.mdx
* graphos/routing/(latest)/observability/graphos/graphos-reporting.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/index.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/datadog/router-instrumentation.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog/datadog-agent/datadog-agent-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/jaeger/jaeger-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/zipkin/zipkin-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/conditions.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/spans.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/telemetry-pipelines/trace-exporters/overview.mdx
* graphos/routing/(latest)/performance/caching/response-caching/faq.mdx
* graphos/routing/(latest)/security/demand-control.mdx
* graphos/routing/(latest)/self-hosted/containerization/proxy-certificates.mdx
* graphos/routing/(latest)/upgrade/from-router-v1.mdx
* graphos/routing/(latest)/_sidebar.yaml

Build ID: 1d9c048f4df4f89c8c610c1c
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/1d9c048f4df4f89c8c610c1c


✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@mergify

mergify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 1 protections blocking · waiting on ⛓️ dependency

Protection Waiting on
🔴 ⛓️ Depends-On Requirements ⛓️ dependency

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

@tninesling
tninesling marked this pull request as draft September 2, 2026 23:12
@tninesling tninesling changed the title tninesling/inc port 26 router integration feat(incremental-planner): add router integration and native_connectors config Sep 2, 2026
tninesling and others added 2 commits September 2, 2026 19:28
The @requires branch added arguments to SelectionKey::Field to
distinguish fields with different arguments sharing a response name.
This changed shared operation code used by both planners, causing the
existing planner's type_conditions test to fail: artwork fields with
different variable arguments under different union members were no
longer merged, triggering apollo-compiler's conflicting-arguments
validation.

The incremental planner doesn't need arguments in SelectionKey — its
requires.rs handles argument-aware field identity through direct
field.arguments comparisons and aliasing before insertion into
SelectionSet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap the example coordinate in backticks so rustdoc doesn't interpret
[0] as a link reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant