Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prep release: v1.57.0 #6183

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .changesets/feat_bnjjj_feat_schema_id_context.md

This file was deleted.

20 changes: 0 additions & 20 deletions .changesets/feat_rhai_uri_port.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changesets/feat_simon_replatform_introspection.md

This file was deleted.

20 changes: 0 additions & 20 deletions .changesets/fix_feature_rhairouterrequesturi.md

This file was deleted.

23 changes: 0 additions & 23 deletions .changesets/fix_fix_typename.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changesets/fix_renee_router_815_changeset.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changesets/fix_router_bridge_v0_6_4_v2_9_3.md

This file was deleted.

135 changes: 135 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,141 @@ All notable changes to Router will be documented in this file.

This project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).

# [1.57.0] - 2024-10-22

> [!IMPORTANT]
> If you have enabled [Distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), updates to the query planner in this release will result in query plan caches being re-generated rather than re-used. On account of this, you should anticipate additional cache regeneration cost when updating between these versions while the new query plans come into service.

## 🚀 Features

### Remove legacy schema introspection ([PR #6139](https://github.com/apollographql/router/pull/6139))

Schema introspection in the router now runs natively without JavaScript. We have high confidence that the new native implementation returns responses that match the previous Javascript implementation, based on differential testing: fuzzing arbitrary queries against a large schema, and testing a corpus of customer schemas against a comprehensive query.

Changes to the router's YAML configuration:

* The `experimental_introspection_mode` key has been removed, with the `new` mode as the only behavior in this release.
* The `supergraph.query_planning.legacy_introspection_caching` key is removed, with the behavior in this release now similar to what was `false`: introspection responses are not part of the query plan cache but instead in a separate, small in-memory—only cache.

When using the above deprecated configuration options, the router's automatic configuration migration will ensure that existing configuration continue to work until the next major version of the router. To simplify major upgrades, we recommend reviewing incremental updates to your YAML configuration by comparing the output of `./router config upgrade --config path/to/config.yaml` with your existing configuration.

By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/6139

### Support new `request_context` selector for telemetry ([PR #6160](https://github.com/apollographql/router/pull/6160))

The router supports a new `request_context` selector for telemetry that enables access to the supergraph schema ID.

You can configure the context to access the supergraph schema ID at the router service level:

```yaml
telemetry:
instrumentation:
events:
router:
my.request_event:
message: "my request event message"
level: info
on: request
attributes:
schema.id:
request_context: "apollo::supergraph_schema_id" # The key containing the supergraph schema id
```

You can use the selector in any service at any stage. While this example applies to `events` attributes, the selector can also be used on spans and instruments.

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/6160

### Support reading and setting `port` on request URIs using Rhai ([Issue #5437](https://github.com/apollographql/router/issues/5437))

Custom Rhai scripts in the router now support the `request.uri.port` and `request.subgraph.uri.port` functions for reading and setting URI ports. These functions enable you to update the full URI for subgraph fetches. For example:

```rust
fn subgraph_service(service, subgraph){
service.map_request(|request|{
log_info(``);
if request.subgraph.uri.port == {} {
log_info("Port is not explicitly set");
}
request.subgraph.uri.host = "api.apollographql.com";
request.subgraph.uri.path = "/api/graphql";
request.subgraph.uri.port = 1234;
log_info(``);
});
}
```

By [@lleadbet](https://github.com/lleadbet) in https://github.com/apollographql/router/pull/5439

## 🐛 Fixes

### Fix various edge cases for `__typename` field ([PR #6009](https://github.com/apollographql/router/pull/6009))

The router now correctly handles the `__typename` field used on operation root types, even when the subgraph's root type has a name that differs from the supergraph's root type.

For example, given a query like this:

```graphql
{
...RootFragment
}

fragment RootFragment on Query {
__typename
me {
name
}
}
```

Even if the subgraph's root type returns a `__typename` that differs from `Query`, the router will still use `Query` as the value of the `__typename` field.

This change also includes fixes for other edge cases related to the handling of `__typename` fields. For a detailed technical description of the edge cases that were fixed, please see [this description](https://github.com/apollographql/router/pull/6009#issue-2529717207).

By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/6009

### Support `uri` and `method` properties on router "request" objects in Rhai ([PR #6147](https://github.com/apollographql/router/pull/6147))

The router now supports accessing `request.uri` and `request.method` properties from custom Rhai scripts. Previously, when trying to access `request.uri` and `request.method` on a router request in Rhai, the router would return error messages stating the properties were undefined.

An example Rhai script using these properties:

```rhai
fn router_service(service) {
let router_request_callback = Fn("router_request_callback");
service.map_request(router_request_callback);
}

fn router_request_callback (request) {
log_info(`Router Request... Host: , Path: `);
}
```

By [@andrewmcgivery](https://github.com/andrewmcgivery) in https://github.com/apollographql/router/pull/6114

### Cost calculation for subgraph requests with named fragments ([PR #6162](https://github.com/apollographql/router/issues/6162))

In some cases where subgraph GraphQL operations contain named fragments and abstract types, demand control used the wrong type for cost calculation, and could reject valid operations. Now, the correct type is used.

This fixes errors of the form:

```
Attempted to look up a field on type MyInterface, but the field does not exist
```

By [@goto-bus-stop](https://github.com/goto-bus-stop) in https://github.com/apollographql/router/pull/6162

### Federation v2.9.3 ([PR #6161](https://github.com/apollographql/router/pull/6161))

This release updates to Federation v2.9.3, with query planner fixes:

- Fixes a query planning bug where operation variables for a subgraph query wouldn't match what's used in that query.
- Fixes a query planning bug where directives applied to `__typename` may be omitted in the subgraph query.
- Fixes a query planning inefficiency where some redundant subgraph queries were not removed.
- Fixes a query planning inefficiency where some redundant inline fragments in `@key`/`@requires` selection sets were not optimized away.
- Fixes a query planning inefficiency where unnecessary subgraph jumps were being added when using `@context`/`@fromContext`.

By [@sachindshinde](https://github.com/sachindshinde) in https://github.com/apollographql/router/pull/6161

# [1.56.0] - 2024-10-01

> [!IMPORTANT]
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ dependencies = [

[[package]]
name = "apollo-federation"
version = "1.57.0-rc.0"
version = "1.57.0"
dependencies = [
"apollo-compiler",
"derive_more",
Expand Down Expand Up @@ -229,7 +229,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.57.0-rc.0"
version = "1.57.0"
dependencies = [
"access-json",
"ahash",
Expand Down Expand Up @@ -397,7 +397,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.57.0-rc.0"
version = "1.57.0"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -413,7 +413,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.57.0-rc.0"
version = "1.57.0"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-federation"
version = "1.57.0-rc.0"
version = "1.57.0"
authors = ["The Apollo GraphQL Contributors"]
edition = "2021"
description = "Apollo Federation"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-benchmarks"
version = "1.57.0-rc.0"
version = "1.57.0"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
edition = "2021"
license = "Elastic-2.0"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-scaffold"
version = "1.57.0-rc.0"
version = "1.57.0"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
edition = "2021"
license = "Elastic-2.0"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/Cargo.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apollo-router = { path ="{{integration_test}}apollo-router" }
apollo-router = { git="https://github.com/apollographql/router.git", branch="{{branch}}" }
{{else}}
# Note if you update these dependencies then also update xtask/Cargo.toml
apollo-router = "1.57.0-rc.0"
apollo-router = "1.57.0"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apollo-router-scaffold = { path ="{{integration_test}}apollo-router-scaffold" }
{{#if branch}}
apollo-router-scaffold = { git="https://github.com/apollographql/router.git", branch="{{branch}}" }
{{else}}
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.57.0-rc.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.57.0" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.57.0-rc.0"
version = "1.57.0"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down Expand Up @@ -62,7 +62,7 @@ features = ["docs_rs"]
access-json = "0.1.0"
anyhow = "1.0.86"
apollo-compiler.workspace = true
apollo-federation = { path = "../apollo-federation", version = "=1.57.0-rc.0" }
apollo-federation = { path = "../apollo-federation", version = "=1.57.0" }
arc-swap = "1.6.0"
async-channel = "1.9.0"
async-compression = { version = "0.4.6", features = [
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tracing/docker-compose.datadog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:

apollo-router:
container_name: apollo-router
image: ghcr.io/apollographql/router:v1.57.0-rc.0
image: ghcr.io/apollographql/router:v1.57.0
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/datadog.router.yaml:/etc/config/configuration.yaml
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tracing/docker-compose.jaeger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
apollo-router:
container_name: apollo-router
#build: ./router
image: ghcr.io/apollographql/router:v1.57.0-rc.0
image: ghcr.io/apollographql/router:v1.57.0
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/jaeger.router.yaml:/etc/config/configuration.yaml
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tracing/docker-compose.zipkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
apollo-router:
container_name: apollo-router
build: ./router
image: ghcr.io/apollographql/router:v1.57.0-rc.0
image: ghcr.io/apollographql/router:v1.57.0
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/zipkin.router.yaml:/etc/config/configuration.yaml
Expand Down
Loading