Skip to content

Commit

Permalink
prep release: v1.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
o0Ignition0o authored Jun 20, 2023
1 parent 7b2c784 commit 0eb5596
Show file tree
Hide file tree
Showing 27 changed files with 587 additions and 180 deletions.
5 changes: 0 additions & 5 deletions .changesets/docs_simplify_jwt_rhai_examples.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changesets/exp_igni_supergraph_service_compiler.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changesets/feat_bugfix_empty_auth_prefix.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changesets/feat_geal_query_planner_plugins.md

This file was deleted.

21 changes: 0 additions & 21 deletions .changesets/feat_limit_request_size.md

This file was deleted.

19 changes: 0 additions & 19 deletions .changesets/fix_garypen_3090_intro_is_400.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changesets/fix_garypen_3249_docker_heaptrack.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changesets/fix_side_piece_structure_downtown.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changesets/maint_avery_refactor_router_events.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changesets/maint_garypen_3213_subgraph_cache.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changesets/maint_geal_simplify_router_service_tests.md

This file was deleted.

136 changes: 136 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,142 @@ 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.21.0] - 2023-06-20

## 🚀 Features

### Query planner plugins ([Issue #3150](https://github.com/apollographql/router/issues/3150))

We may need to modify a query between query plan caching and the query planner. This leads to the requirement to provide a query planner plugin capability. This capability is private to the router for now.

The plugins need an ApolloCompiler instance to perform useful work on the query, so the caching layer, in case of cache miss, will generate a compiler instance and transmit it as part of the request going through query planner plugins. At the end of the chain, the query planner extracts the modified query from the compiler, uses it to generate a query plan, and generates the selections of both the original and filtered query for response formatting. This is done to ensure that the response does not leak data removed in the filtered query, but still keeps a shape expected by the original query, using the null propagation.

A new visitor trait helps modifying the query.

By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3177 and https://github.com/apollographql/router/pull/3252

### Restore HTTP payload size limit, make it configurable ([Issue #2000](https://github.com/apollographql/router/issues/2000))

Early versions of Apollo Router used to rely on a part of the Axum web framework
that imposed a 2 MB limit on the size of the HTTP request body.
Version 1.7 changed to read the body directly, unintentionally removing this limit.

The limit is now restored to help protect against unbounded memory usage, but is now configurable:

```yaml
preview_operation_limits:
experimental_http_max_request_bytes: 2000000 # Default value: 2 MB
```
This limit is checked while reading from the network, before JSON parsing.
Both the GraphQL document and associated variables count toward it.
Before increasing this limit significantly consider testing performance
in an environment similar to your production, especially if some clients are untrusted.
Many concurrent large requests could cause the Router to run out of memory.
By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/3130
### Add support for empty auth prefixes ([Issue #2909](https://github.com/apollographql/router/issues/2909))
This updates the `authentication.jwt` plugin to support empty prefixes for the JWT header. Some companies use prefix-less headers; previously, the authentication plugin would reject requests even with an empty header explicitly set, such as:

```yml
authentication:
jwt:
header_value_prefix: ""
```

This change enables the plugin to support this.

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

## 🐛 Fixes

### GraphQL introspection errors are now 400 errors ([Issue #3090](https://github.com/apollographql/router/issues/3090))

If we get an Introspection error during SupergraphService::plan_query(), then it is reported to the client as an HTTP 500 error. This change modifies the handling of errors to generate a valid GraphQL error for Introspection errors whilst also modifying the HTTP status to be 400.

The result of this change is that the client response

StatusCode:500
```json
{"errors":[{"message":"value retrieval failed: introspection error: introspection error : Field "__schema" of type "__Schema!" must have a selection of subfields. Did you mean "__schema { ... }"?","extensions":{"code":"INTERNAL_SERVER_ERROR"}}]}
```

becomes:

StatusCode:400
```json
{"errors":[{"message":"introspection error : Field "__schema" of type "__Schema!" must have a selection of subfields. Did you mean "__schema { ... }"?","extensions":{"code":"INTROSPECTION_ERROR"}}]}
```

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

### Restore missing debug tools in "debug" Docker images ([Issue #3249](https://github.com/apollographql/router/issues/3249))

Debug Docker images were designed to make use of `heaptrack` for debugging memory issues. However, this functionality was inadvertently removed when we changed to multi-architecture Docker image builds.

This restores the heaptrack functionality to our debug docker images.

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

### Federation v2.4.8 ([Issue #3217](https://github.com/apollographql/router/issues/3217), [Issue #3227](https://github.com/apollographql/router/issues/3227))

This release bumps the Router's Federation support from v2.4.7 to v2.4.8, which brings in notable query planner fixes from [v2.4.8](https://github.com/apollographql/federation/releases/tag/@apollo/query-planner@2.4.8). Of note from those releases, this brings query planner fixes that (per that dependency's changelog):

- Fix bug in the handling of dependencies of subgraph fetches. This bug was manifesting itself as an assertion error ([apollographql/federation#2622](https://github.com/apollographql/federation/pull/2622))
thrown during query planning with a message of the form `Root groups X should have no remaining groups unhandled (...)`.

- Fix issues in code to reuse named fragments. One of the fixed issue would manifest as an assertion error with a message ([apollographql/federation#2619](https://github.com/apollographql/federation/pull/2619))
looking like `Cannot add fragment of condition X (...) to parent type Y (...)`. Another would manifest itself by
generating an invalid subgraph fetch where a field conflicts with another version of that field that is in a reused
named fragment.

These manifested as Router issues https://github.com/apollographql/router/issues/3217 and https://github.com/apollographql/router/issues/3227.

By [@renovate](https://github.com/renovate) and [o0ignition0o](https://github.com/o0ignition0o) in https://github.com/apollographql/router/pull/3202

## 🛠 Maintenance

### chore: split out router events into its own module ([PR #3235](https://github.com/apollographql/router/pull/3235))

Breaks down `./apollo-router/src/router.rs` into its own module `./apollo-router/src/router/mod.rs` with a sub-module `./apollo-router/src/router/event/mod.rs` that contains all of the streams that we combine to start a router (entitlement, schema, reload, configuration, shutdown, more streams to be added). This change makes adding new events/modifying existing events a bit easier since it's not in one huge giant file to rule them all.

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

### Simplify router service tests ([PR #3259](https://github.com/apollographql/router/pull/3259))

Parts of the router service creation were generic, to allow mocking, but the `TestHarness` API allows us to reuse the same code in all cases. We can remove some generic types and simplify the API

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

### update Rhai to 1.15.0 to fix issue with hanging example test ([Issue #3213](https://github.com/apollographql/router/issues/3213))

One of our Rhai examples' tests have been regularly hanging in the CI builds for the last couple of months. Investigation uncovered a race condition within Rhai itself. This update brings in the fixed version of Rhai and should eliminate the hanging problem and improve build stability.

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

## 📚 Documentation

### Improve example Rhai scripts for JWT Authentication ([PR #3184](https://github.com/apollographql/router/pull/3184))

Simplify the example Rhai scripts in the [JWT Authentication](https://www.apollographql.com/docs/router/configuration/authn-jwt) docs and includes a sample `main.rhai` file to make it more clear how to use all scripts together.

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

## 🧪 Experimental

### Expose the apollo compiler at the supergraph service level ([PR #3200](https://github.com/apollographql/router/pull/3200))

This adds a query analysis phase inside the router service, before sending the query through the supergraph plugins. It makes a compiler available to supergraph plugins, to perform deeper analysis of the query. That compiler is then used in the query planner to create the `Query` object containing selections for response formatting.

This is for internal use only for now, until we are sure we can expose the right public API.

By [@o0Ignition0o](https://github.com/o0Ignition0o) and [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3200



# [1.20.0] - 2023-05-31

## 🚀 Features
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.20.0"
version = "1.21.0"
dependencies = [
"access-json",
"anyhow",
Expand Down Expand Up @@ -420,7 +420,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.20.0"
version = "1.21.0"
dependencies = [
"apollo-parser 0.4.1",
"apollo-router",
Expand All @@ -436,7 +436,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.20.0"
version = "1.21.0"
dependencies = [
"anyhow",
"cargo-scaffold",
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.20.0"
version = "1.21.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.20.0"
version = "1.21.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.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.20.0"
apollo-router = "1.21.0"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/xtask/Cargo.toml
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.20.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.21.0" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.20.0"
version = "1.21.0"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
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.20.0
image: ghcr.io/apollographql/router:v1.21.0
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/datadog.router.yaml:/etc/config/configuration.yaml
Expand Down
Loading

0 comments on commit 0eb5596

Please sign in to comment.