Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
70d28d4
fix(deps): update rust crate chrono to 0.4.23
renovate[bot] Dec 5, 2022
0ca1082
fix(deps): update rust crate tokio to 1.23.0
renovate[bot] Dec 6, 2022
3f073bd
Release 1.5.0 -> dev (#2217)
BrynCooke Dec 6, 2022
e35a2e3
it_rate_limit_subgraph_requests test changed to multi-threaded runtime
Dec 6, 2022
9b1efe3
it_rate_limit_subgraph_requests test changed to multi-threaded runtim…
BrynCooke Dec 6, 2022
066e608
filter nullified deferred responses (#2184)
Dec 6, 2022
fdb57cc
replace ctor with linkme (#2181)
Dec 6, 2022
802a181
Wait for current tracer provider to shutdown when dropping telemetry …
Dec 6, 2022
854d695
Unfeature Rust as a first impression of the router
Dec 7, 2022
141c0f4
Create yaml config design guidance (#2159)
BrynCooke Dec 7, 2022
df97233
chore(deps): update dependency typescript to v4.9.4
renovate[bot] Dec 8, 2022
bef4c52
fix(deps): update rust crate hyper-rustls to 0.23.2
renovate[bot] Dec 8, 2022
160116e
add support for appending to header map from rhai (#2219)
Dec 9, 2022
1d8a6ce
Fix expected content-type error (#2234)
mettolen Dec 9, 2022
f1b46b2
Update Rust MSRV to 1.65 (#2221)
BrynCooke Dec 9, 2022
33cea3a
Unfeature Rust as a first impression of the router (#2227)
BrynCooke Dec 9, 2022
9313771
Upgrade opentelemetry to 0.18.0 (#1970)
BrynCooke Dec 9, 2022
4c43144
set_meter_provider was being called twice which had the effect of com…
BrynCooke Dec 9, 2022
aa91c3a
Add protoc to diy router build (#2240)
BrynCooke Dec 9, 2022
69856a9
Maintenance: update reports.proto protobuf definition (#2247)
o0Ignition0o Dec 12, 2022
2521175
Redeploy router if mounted supergraph schema changes (#2223)
toneill818 Dec 12, 2022
865d1f7
reconstruct deferred queries with knowledge about fragments (#2109)
Dec 12, 2022
20cceda
Dispatch errors from the primary response to deferred responses (#2192)
Dec 12, 2022
a55b38a
fix(deps): update all non-major packages >= 1.0 (#2244)
renovate[bot] Dec 12, 2022
50e196d
fixes-typo (#2246)
jpvajda Dec 12, 2022
7ec8607
fix(deps): update dependency @apollo/federation to ^0.38.0 (#2091)
renovate[bot] Dec 13, 2022
dd390eb
fix: Return root when parts of a query with deferred fragment (#2253)
bnjjj Dec 13, 2022
832e4b7
fix(deps): update all non-major packages >= 1.0 (#2250)
renovate[bot] Dec 13, 2022
632c2c7
Use Elastic-2.0 in lieu of LicenseRef-ELv2 (#2054)
o0Ignition0o Dec 13, 2022
69b21f4
rhai hot-reload (#2198)
Dec 13, 2022
34a730f
Improve automated release (#2256)
BrynCooke Dec 13, 2022
17efe96
feat: add support for experimental tooling (#2242)
bnjjj Dec 13, 2022
0a225b9
Fix changelog (#2259)
BrynCooke Dec 13, 2022
e380758
rhai: add new values() fn for headers with multiple values (#2258)
Dec 13, 2022
ccdb1ac
release 1.6.0
Dec 13, 2022
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
37 changes: 37 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ parameters:
type: string
# update this as new versions of jaeger become available
default: "1.33.0"
protoc_version:
type: string
default: "21.8"

# These are common environment variables that we want to set on on all jobs.
# While these could conceivably be set on the CircleCI project settings'
Expand Down Expand Up @@ -85,6 +88,12 @@ commands:
curl -L https://github.com/jaegertracing/jaeger/releases/download/v<< pipeline.parameters.jaeger_version >>/jaeger-<< pipeline.parameters.jaeger_version >>-linux-amd64.tar.gz --output jaeger.tar.gz
tar -xf jaeger.tar.gz
mv jaeger-<< pipeline.parameters.jaeger_version >>-linux-amd64 jaeger
- run:
name: Install protoc
command: |
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v<< pipeline.parameters.protoc_version >>/protoc-<< pipeline.parameters.protoc_version >>-linux-x86_64.zip --output protoc.zip
unzip protoc.zip -d $HOME/.local
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
linux_arm_install_baseline:
steps:
- linux_install_baseline
Expand All @@ -94,6 +103,12 @@ commands:
curl -L https://github.com/jaegertracing/jaeger/releases/download/v<< pipeline.parameters.jaeger_version >>/jaeger-<< pipeline.parameters.jaeger_version >>-linux-arm64.tar.gz --output jaeger.tar.gz
tar -xf jaeger.tar.gz
mv jaeger-<< pipeline.parameters.jaeger_version >>-linux-arm64 jaeger
- run:
name: Install protoc
command: |
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v<< pipeline.parameters.protoc_version >>/protoc-<< pipeline.parameters.protoc_version >>-linux-aarch_64.zip --output protoc.zip
unzip protoc.zip -d $HOME/.local
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
macos_install_baseline:
steps:
- run:
Expand All @@ -103,6 +118,12 @@ commands:
tar -xf jaeger.tar.gz
mv jaeger-<< pipeline.parameters.jaeger_version >>-darwin-amd64 jaeger
- install_minimal_rust
- run:
name: Install protoc
command: |
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v<< pipeline.parameters.protoc_version >>/protoc-<< pipeline.parameters.protoc_version >>-osx-universal_binary.zip --output protoc.zip
unzip protoc.zip -d $HOME/.local
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
windows_install_baseline:
steps:
- run:
Expand All @@ -112,6 +133,13 @@ commands:
curl -L https://github.com/jaegertracing/jaeger/releases/download/v<< pipeline.parameters.jaeger_version >>/jaeger-<< pipeline.parameters.jaeger_version >>-windows-amd64.tar.gz --output jaeger.tar.gz
tar -xf jaeger.tar.gz
mv jaeger-<< pipeline.parameters.jaeger_version >>-windows-amd64 jaeger
- run:
name: Install protoc
shell: bash.exe
command: |
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v<< pipeline.parameters.protoc_version >>/protoc-<< pipeline.parameters.protoc_version >>-win64.zip --output protoc.zip
unzip protoc.zip -d $HOME/.local
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"

# This job makes sure everything is ready to run integration tests
macos_prepare_env:
Expand Down Expand Up @@ -145,6 +173,12 @@ commands:
[net]
git-fetch-with-cli = true
"@
- run:
name: Add protoc to env
command: |
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newpath = “$oldpath;$HOME/.local/bin”
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath

install_minimal_rust:
steps:
Expand Down Expand Up @@ -586,14 +620,17 @@ workflows:
only:
- dev
- prepare_release:
name: "Prepare major release"
release_type: "major"
requires:
- prepare_major_release_approval
- prepare_release:
name: "Prepare minor release"
release_type: "minor"
requires:
- prepare_minor_release_approval
- prepare_release:
name: "Prepare patch release"
release_type: "patch"
requires:
- prepare_patch_release_approval
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by Cargo
# will have compiled files and executables
/target/
**/target/

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
218 changes: 218 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,224 @@ 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.6.0] - 2022-12-13

## ❗ BREAKING ❗

### Protoc now required to build ([Issue #1970](https://github.com/apollographql/router/issues/1970))

Protoc is now required to build Apollo Router. Upgrading to Open Telemetry 0.18 has enabled us to upgrade tonic which in turn no longer bundles protoc.
Users must install it themselves https://grpc.io/docs/protoc-installation/.

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

### Jaeger scheduled_delay moved to batch_processor->scheduled_delay ([Issue #2232](https://github.com/apollographql/router/issues/2232))

Jager config previously allowed configuration of scheduled_delay for batch span processor. To bring it in line with all other exporters this is now set using a batch_processor section.

Before:
```yaml
telemetry:
tracing:
jaeger:
scheduled_delay: 100ms
```

After:
```yaml
telemetry:
tracing:
jaeger:
batch_processor:
scheduled_delay: 100ms
```

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

## 🚀 Features

### Add support for experimental tooling ([Issue #2136](https://github.com/apollographql/router/issues/2136))

Display a message at startup listing used `experimental_` configurations with related GitHub discussions.
It also adds a new cli command `router config experimental` to display all available experimental configurations.

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

### Re-deploy router pods if the SuperGraph configmap changes ([PR #2223](https://github.com/apollographql/router/pull/2223))
When setting the supergraph with the `supergraphFile` variable a `sha256` checksum is calculated and set as an annotation for the router pods. This will spin up new pods when the supergraph is mounted via config map and the schema has changed.

Note: It is preferable to not have `--hot-reload` enabled with this feature since re-configuring the router during a pod restart is duplicating the work and may cause confusion in log messaging.

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

### Tracing batch span processor is now configurable ([Issue #2232](https://github.com/apollographql/router/issues/2232))

Exporting traces often requires performance tuning based on the throughput of the router, sampling settings and ingestion capability of tracing ingress.

All exporters now support configuring the batch span processor in the router yaml.
```yaml
telemetry:
apollo:
batch_processor:
scheduled_delay: 100ms
max_concurrent_exports: 1000
max_export_batch_size: 10000
max_export_timeout: 100s
max_queue_size: 10000
tracing:
jaeger|zipkin|otlp|datadog:
batch_processor:
scheduled_delay: 100ms
max_concurrent_exports: 1000
max_export_batch_size: 10000
max_export_timeout: 100s
max_queue_size: 10000
```

See the Open Telemetry docs for more information.

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

### Add hot-reload support for Rhai scripts ([Issue #1071](https://github.com/apollographql/router/issues/1071))

The router will "watch" your "rhai.scripts" directory for changes and prompt an interpreter re-load if changes are detected. Changes are defined as:

* creating a new file with a ".rhai" suffix
* modifying or removing an existing file with a ".rhai" suffix

The watch is recursive, so files in sub-directories of the "rhai.scripts" directory are also watched.

The Router attempts to identify errors in scripts before applying the changes. If errors are detected, these will be logged and the changes will not be applied to the runtime. Not all classes of error can be reliably detected, so check the log output of your router to make sure that changes have been applied.

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

### Add support for working with multi-value header keys to Rhai ([Issue #2211](https://github.com/apollographql/router/issues/2211), [Issue #2255](https://github.com/apollographql/router/issues/2255))

Adds support for setting a header map key with an array. This causes the HeaderMap key/values to be appended() to the map, rather than inserted().

Adds support for a new `values()` fn which retrieves multiple values for a HeaderMap key as an array.

Example use from Rhai as:

```
response.headers["set-cookie"] = [
"foo=bar; Domain=localhost; Path=/; Expires=Wed, 04 Jan 2023 17:25:27 GMT; HttpOnly; Secure; SameSite=None",
"foo2=bar2; Domain=localhost; Path=/; Expires=Wed, 04 Jan 2023 17:25:27 GMT; HttpOnly; Secure; SameSite=None",
];
response.headers.values("set-cookie"); // Returns the array of values
```

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

## 🐛 Fixes

### Filter nullified deferred responses ([Issue #2213](https://github.com/apollographql/router/issues/2168))

[`@defer` spec updates](https://github.com/graphql/graphql-spec/compare/01d7b98f04810c9a9db4c0e53d3c4d54dbf10b82...f58632f496577642221c69809c32dd46b5398bd7#diff-0f02d73330245629f776bb875e5ca2b30978a716732abca136afdd028d5cd33cR448-R470) mandates that a deferred response should not be sent if its path points to an element of the response that was nullified in a previous payload.

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

### Return root `__typename` when parts of a query with deferred fragment ([Issue #1677](https://github.com/apollographql/router/issues/1677))

With this query:

```graphql
{
__typename
fast
...deferedFragment @defer
}

fragment deferedFragment on Query {
slow
}
```

You will receive the first response chunk:

```json
{"data":{"__typename": "Query", "fast":0},"hasNext":true}
```

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


### Wait for opentelemetry tracer provider to shutdown ([PR #2191](https://github.com/apollographql/router/pull/2191))

When we drop Telemetry we spawn a thread to perform the global opentelemetry trace provider shutdown. The documentation of this function indicates that "This will invoke the shutdown method on all span processors. span processors should export remaining spans before return". We should give that process some time to complete (5 seconds currently) before returning from the `drop`. This will provide more opportunity for spans to be exported.

By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2191
### Dispatch errors from the primary response to deferred responses ([Issue #1818](https://github.com/apollographql/router/issues/1818), [Issue #2185](https://github.com/apollographql/router/issues/2185))

When errors are generated during the primary execution, some may also be assigned to deferred responses.

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

### Reconstruct deferred queries with knowledge about fragments ([Issue #2105](https://github.com/apollographql/router/issues/2105))

When we are using `@defer`, response formatting must apply on a subset of the query (primary or deferred), that is reconstructed from information provided by the query planner: a path into the response and a subselection. Previously, that path did not include information on fragment application, which resulted in query reconstruction issues if `@defer` was used under a fragment application on an interface.

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

## 🛠 Maintenance

### Improve plugin registration predictability ([PR #2181](https://github.com/apollographql/router/pull/2181))

This replaces [ctor](https://crates.io/crates/ctor) with [linkme](https://crates.io/crates/linkme). `ctor` enables rust code to execute before `main`. This can be a source of undefined behaviour and we don't need our code to execute before `main`. `linkme` provides a registration mechanism that is perfect for this use case, so switching to use it makes the router more predictable, simpler to reason about and with a sound basis for future plugin enhancements.

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

### it_rate_limit_subgraph_requests fixed ([Issue #2213](https://github.com/apollographql/router/issues/2213))

This test was failing frequently due to it being a timing test being run in a single threaded tokio runtime.

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

### Update reports.proto protobuf definition ([PR #2247](https://github.com/apollographql/router/pull/2247))

Update the reports.proto file, and change the prompt to update the file with the correct new location.

By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/2247
### Upgrade OpenTelemetry to 0.18 ([Issue #1970](https://github.com/apollographql/router/issues/1970))

Update to OpenTelemetry 0.18.

By [@bryncooke](https://github.com/bryncooke) and [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/1970 and https://github.com/apollographql/router/pull/2236

### Remove spaceport ([Issue #2233](https://github.com/apollographql/router/issues/2233))

Removal significantly simplifies telemetry code and likely to increase performance and reliability.

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

### Update to Rust 1.65 ([Issue #2220](https://github.com/apollographql/router/issues/2220))

Rust MSRV incremented to 1.65.

By [@bryncooke](https://github.com/bryncooke) in https://github.com/apollographql/router/pull/2221 and https://github.com/apollographql/router/pull/2240

### Improve automated release ([Pull #2220](https://github.com/apollographql/router/pull/2256))

Improved the automated release to:
* Update the scaffold files
* Improve the names of prepare release steps in circle.

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

### Use Elastic-2.0 license spdx ([PR #2055](https://github.com/apollographql/router/issues/2055))

Now that the Elastic-2.0 spdx is a valid identifier in the rust ecosystem, we can update the router references.

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

## 📚 Documentation
### Create yaml config design guidance ([Issue #2158](https://github.com/apollographql/router/issues/2158))

Added some yaml design guidance to help us create consistent yaml config for new and existing features.

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


# [1.5.0] - 2022-12-06
## ❗ BREAKING ❗

Expand Down
Loading