Skip to content

Commit

Permalink
prep release: v1.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal authored May 26, 2023
1 parent 239c745 commit 3c10406
Show file tree
Hide file tree
Showing 24 changed files with 159 additions and 131 deletions.
5 changes: 0 additions & 5 deletions .changesets/fix_bnjjj_fix_redact_error.md

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

85 changes: 79 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,83 @@ 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.19.1] - 2023-05-26

## 🐛 Fixes

### Fix router coprocessor deferred response buffering and change JSON body type from Object to String ([Issue #3015](https://github.com/apollographql/router/issues/3015))

The current implementation of the `RouterResponse` processing for coprocessors forces buffering of response data before passing the data to a coprocessor. This is a bug, because deferred responses should be processed progressively with a stream of calls to the coprocessor as each chunk of data becomes available.

Furthermore, the data type was assumed to be valid JSON for both `RouterRequest` and `RouterResponse` coprocessor processing. This is also a bug, because data at this stage of processing was never necessarily valid JSON. This is a particular issue when dealing with deferred (when using `@defer`) `RouterResponses`.

This change fixes both of these bugs by modifying the router so that coprocessors are invoked with a `body` payload which is a JSON `String`, not a JSON `Object`. Furthermore, the router now processes each chunk of response data separately so that a coprocessor will receive multiple calls (once for each chunk) for a deferred response.

For more details about how this works see the [coprocessor documentation](https://www.apollographql.com/docs/router/customizations/coprocessor/).

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

### Experimental: Query plan cache keys now include a hash of the query and operation name ([Issue #2998](https://github.com/apollographql/router/issues/2998))

> **Note**
> This feature is still _experimental_ and not recommended under normal use nor is it validated that caching query plans in a distributed fashion will result in improved performance.
The experimental feature for caching query plans in a distributed store (e.g., Redis) will now create a SHA-256 hash of the query and operation name and include that hash in the cache key, rather than using the operation document as it was previously.

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

### Federation v2.4.6 ([Issue #3133](https://github.com/apollographql/router/issues/3133))

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

- Fix assertion error in some overlapping fragment cases. In some cases, when fragments overlaps on some sub-selections ([apollographql/federation#2594](https://github.com/apollographql/federation/pull/2594)) and some interface field implementation relied on sub-typing, an assertion error could be raised with a message of the form `Cannot add selection of field X to selection set of parent type Y` and this fixes this problem.

- Fix possible fragment-related assertion error during query planning. This prevents a rare case where an assertion with a ([apollographql/federation#2596](https://github.com/apollographql/federation/pull/2596)) message of the form `Cannot add fragment of condition X (runtimes: ...) to parent type Y (runtimes: ...)` could fail during query planning.

In addition, the packaging includes dependency updates for `bytes`, `regex`, `once_cell`, `tokio`, and `uuid`.

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

### Error redaction for subgraphs now respects _disabling_ it

This follows-up on the new ability to selectively disable Studio-bound error redaction which was released in https://github.com/apollographql/router/pull/3011 by fixing a bug which was preventing users from _disabling_ that behavior on subgraphs. Redaction continues to be on by default and both the default behavior and the explicit `redact: true` option were behaving correctly.

With this fix, the `tracing.apollo.errors.subgraph.all.redact` option set to `false` will now transmit the un-redacted error message to Studio.

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

### Evaluate multiple keys matching a JWT criteria ([Issue #3017](https://github.com/apollographql/router/issues/3017))

In some cases, multiple keys could match what a JWT asks for (both the algorithm, `alg`, and optional key identifier, `kid`). Previously, we scored each possible match and only took the one with the highest score. But even then, we could have multiple keys with the same score (e.g., colliding `kid` between multiple JWKS in tests).

The improved behavior will:

- Return a list of those matching `key` instead of the one with the highest score.
- Try them one by one until the JWT is validated, or return an error.
- If some keys were found with the highest possible score (matching `alg`, with `kid` present and matching, too), then we only test those keys.

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

## 🛠 Maintenance

### chore(deps): `xtask/` dependency updates ([PR #3149](https://github.com/apollographql/router/pull/3149))

This is effectively running `cargo update` in the `xtask/` directory (our directory of tooling; not runtime components) to bring things more up to date.

This changeset takes extra care to update `chrono`'s features to remove the `time` dependency which is impacted by [CVE-2020-26235](https://nvd.nist.gov/vuln/detail/CVE-2020-26235), resolving a moderate severity which was appearing in scans. Again, this is not a runtime dependency and there was no actual/known impact to any users.

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

### Improve testability of the `state_machine` in integration tests

We have introduced a `TestRouterHttpServer` for writing more fine-grained integration tests in the Router core for the behaviors of the state machine.

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

# [1.19.0] - 2023-05-19

> **Note**
> This release focused a notable amount of effort on improving both CPU usage and memory utilization/fragmentization. Our testing and pre-release feedback has been overwhelmingly positive. 🙌
> This release focused a notable amount of effort on improving both CPU usage and memory utilization/fragmentization. Our testing and pre-release feedback has been overwhelmingly positive. 🙌
## 🚀 Features

Expand All @@ -29,9 +102,9 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p

## 🐛 Fixes

### Prevent span attributes from being formatted to write logs
### Prevent span attributes from being formatted to write logs

We do not show span attributes in our logs, but the log formatter still spends time formatting them to a string, even when there will be no logs written for the trace. This adds the `NullFieldFormatter` that entirely avoids formatting the attributes to improve performance.
We do not show span attributes in our logs, but the log formatter still spends time formatting them to a string, even when there will be no logs written for the trace. This adds the `NullFieldFormatter` that entirely avoids formatting the attributes to improve performance.

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

Expand All @@ -41,7 +114,7 @@ This release bumps the Router's Federation support from v2.4.2 to v2.4.5, which

- Improves the heuristics used to try to reuse the query named fragments in subgraph fetches. Said fragment will be reused ([apollographql/federation#2541](https://github.com/apollographql/federation/pull/2541)) more often, which can lead to smaller subgraph queries (and hence overall faster processing).
- Fix potential assertion error during query planning in some multi-field `@requires` case. This error could be triggered ([#2575](https://github.com/apollographql/federation/pull/2575)) when a field in a `@requires` depended on another field that was also part of that same requires (for instance, if a field has a `@requires(fields: "id otherField")` and that `id` is also a key necessary to reach the subgraph providing `otherField`).

The assertion error thrown in that case contained the message `Root groups (...) should have no remaining groups unhandled (...)`

By [@abernix](https://github.com/abernix) in https://github.com/apollographql/router/pull/3107
Expand All @@ -65,7 +138,7 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p
If you were using local schema or config then previously the Router was performing blocking IO in an async thread. This could have caused stalls to serving requests.
The Router now uses async IO for all config and schema reloads.

Fixing the above surfaced an issue with the experimental `force_hot_reload` feature introduced for testing. This has also been fixed and renamed to `force_reload`.
Fixing the above surfaced an issue with the experimental `force_hot_reload` feature introduced for testing. This has also been fixed and renamed to `force_reload`.

```diff
experimental_chaos:
Expand Down Expand Up @@ -99,7 +172,7 @@ Adds an integration test that iterates over `./examples` looking for `.yaml` fil

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

### Improve memory fragmentation and resource consumption by switching to `jemalloc` as the memory allocator on Linux ([PR #2882](https://github.com/apollographql/router/pull/2882))
### Improve memory fragmentation and resource consumption by switching to `jemalloc` as the memory allocator on Linux ([PR #2882](https://github.com/apollographql/router/pull/2882))

Detailed memory investigation revealed significant memory fragmentation when using the default allocator, `glibc`, on Linux. Performance testing and flame-graph analysis suggested that using `jemalloc` on Linux would yield notable performance improvements. In our tests, this figure shows performance to be about 35% faster than the default allocator, on account of spending less time managing memory fragmentation.

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.19.0"
version = "1.19.1"
dependencies = [
"access-json",
"anyhow",
Expand Down Expand Up @@ -419,7 +419,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.19.0"
version = "1.19.1"
dependencies = [
"apollo-parser 0.4.1",
"apollo-router",
Expand All @@ -435,7 +435,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.19.0"
version = "1.19.1"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down
4 changes: 2 additions & 2 deletions 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.19.0"
version = "1.19.1"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
edition = "2021"
license = "Elastic-2.0"
Expand Down Expand Up @@ -28,4 +28,4 @@ harness = false

[[bench]]
name = "memory_use"
harness = false
harness = false
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.19.0"
version = "1.19.1"
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.19.0"
apollo-router = "1.19.1"
{{/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.19.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.19.1" }
{{/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.19.0"
version = "1.19.1"
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.19.0
image: ghcr.io/apollographql/router:v1.19.1
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.19.0
image: ghcr.io/apollographql/router:v1.19.1
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.19.0
image: ghcr.io/apollographql/router:v1.19.1
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/zipkin.router.yaml:/etc/config/configuration.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/source/containerization/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The default behaviour of the router images is suitable for a quickstart or devel
Note: The [docker documentation](https://docs.docker.com/engine/reference/run/) for the run command may be helpful when reading through the examples.

Note: The exact image version to use is your choice depending on which release you wish to use. In the following examples, replace `<image version>` with your chosen version. e.g.: `v1.19.0`
Note: The exact image version to use is your choice depending on which release you wish to use. In the following examples, replace `<image version>` with your chosen version. e.g.: `v1.19.1`

## Override the configuration

Expand Down
Loading

0 comments on commit 3c10406

Please sign in to comment.