Skip to content

Commit

Permalink
release: v1.46.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BrynCooke committed May 7, 2024
2 parents fc8bba0 + 7718a08 commit 63e9fa2
Show file tree
Hide file tree
Showing 233 changed files with 94,219 additions and 10,169 deletions.
40 changes: 36 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ executors:
resource_class: macos.m1.medium.gen1
windows_build: &windows_build_executor
machine:
image: "windows-server-2019-vs2019:2022.08.1"
image: "windows-server-2019-vs2019:2024.02.21"
resource_class: windows.xlarge
shell: bash.exe --login -eo pipefail
windows_test: &windows_test_executor
machine:
image: "windows-server-2019-vs2019:2022.08.1"
image: "windows-server-2019-vs2019:2024.02.21"
resource_class: windows.xlarge
shell: bash.exe --login -eo pipefail

Expand Down Expand Up @@ -320,7 +320,8 @@ commands:
if [[ ! -d "$HOME/.cargo" ]]; then
curl https://sh.rustup.rs -sSf -o rustup.sh
chmod 755 ./rustup.sh
./rustup.sh -y --profile minimal --component clippy --component rustfmt
./rustup.sh -y --profile minimal --component clippy --component rustfmt --default-toolchain none
$HOME/.cargo/bin/rustc -V
fi
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> "$BASH_ENV"
Expand All @@ -344,13 +345,29 @@ commands:
command: |
rustup target add x86_64-apple-darwin
- when:
condition:
equal: [ *arm_linux_test_executor, << parameters.platform >> ]
steps:
- run:
name: Install nightly Rust to build the fuzzers
command: |
rustup install nightly
install_extra_tools:
steps:
- run:
name: Install cargo deny, about, edit
command: |
if [[ ! -f "$HOME/.cargo/bin/cargo-deny$EXECUTABLE_SUFFIX" ]]; then
cargo install --locked cargo-deny cargo-about cargo-edit
cargo install --locked --version 0.14.21 cargo-deny
cargo install --locked --version 0.6.1 cargo-about
cargo install --locked --version 0.12.2 cargo-edit
cargo install --locked --version 0.12.0 cargo-fuzz
fi
if [[ ! -f "$HOME/.cargo/bin/cargo-nextest$EXECUTABLE_SUFFIX" ]]; then
cargo install --locked --version 0.9.70 cargo-nextest
fi
fetch_dependencies:
Expand Down Expand Up @@ -475,6 +492,9 @@ commands:
- "<< pipeline.parameters.merge_version >>-test-<< parameters.variant >>"
- run:
name: Run tests
environment:
# Use the settings from the "ci" profile in nextest configuration.
NEXTEST_PROFILE: ci
command: xtask test --workspace --locked
- run:
name: Delete large files from cache
Expand All @@ -489,6 +509,13 @@ commands:
key: "<< pipeline.parameters.merge_version >>-test-<< parameters.variant >>"
paths:
- target
- store_test_results:
# The results from nextest that power the CircleCI Insights.
path: ./target/nextest/ci/junit.xml
fuzz_build:
steps:
- run: cargo +nightly fuzz build

jobs:
lint:
environment:
Expand Down Expand Up @@ -543,6 +570,11 @@ jobs:
- setup_environment:
platform: << parameters.platform >>
- xtask_test
- when:
condition:
equal: [ *arm_linux_test_executor, << parameters.platform >> ]
steps:
- fuzz_build

test_updated:
environment:
Expand Down
11 changes: 11 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[profile.ci]
# Print out output for failing tests as soon as they fail, and also at the end
# of the run (for easy scrollability).
failure-output = "immediate-final"

# Do not cancel the test run on the first failure.
fail-fast = false

# Write to output for persistence to CircleCI
[profile.ci.junit]
path = "junit.xml"
31 changes: 31 additions & 0 deletions .github/workflows/update_apollo_protobuf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update Apollo Protobuf
run-name: ${{ github.actor }} is updating the Apollo Protobuf 馃殌
on:
workflow_dispatch:
schedule:
# On the 5 of every hour
- cron: '5 * * * *'
jobs:
Update-Protobuf-Schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Make changes to pull request
run: |
curl -f https://usage-reporting.api.apollographql.com/proto/reports.proto > ./apollo-router/src/plugins/telemetry/proto/reports.proto
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update Apollo Protobuf schema
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: create-pull-request/apollo-proto-updates
team-reviewers: |
router
add-paths: |
apollo-router/src/plugins/telemetry/proto/reports.proto
delete-branch: true
title: 'chore: Update Apollo Protobuf'
body: |
This updates the copy of `reports.proto` which this repository relies on with the latest copy fetched via our public endpoint.
182 changes: 182 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,188 @@ 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.46.0] - 2024-05-07

## 馃殌 Features

### Entity cache preview: support queries with private scope ([PR #4855](https://github.com/apollographql/router/pull/4855))

**This feature is part of the work on [subgraph entity caching](https://www.apollographql.com/docs/router/configuration/entity-caching/), currently in preview.**

The router now supports caching responses marked with `private` scope. This caching currently works only on subgraph responses without any schema-level information.

For details about the caching behavior, see [PR #4855](https://github.com/apollographql/router/pull/4855)


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

### Add support of custom events defined by YAML for telemetry ([Issue #4320](https://github.com/apollographql/router/issues/4320))

Users can now [configure telemetry events via YAML](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/events/)
to log that something has happened (e.g. a request had errors of a particular type) without reaching for Rhai or a custom plugin.

Events may be triggered on conditions and can include information in the request/response pipeline as attributes.

Here is an example of configuration:

```yaml
telemetry:
instrumentation:
events:
router:
# Standard events
request: info
response: info
error: info

# Custom events
my.event:
message: "my event message"
level: info
on: request
attributes:
http.response.body.size: false
# Only log when the x-log-request header is `log`
condition:
eq:
- "log"
- request_header: "x-log-request"

supergraph:
# Custom event configuration for supergraph service ...
subgraph:
# Custom event configuration for subgraph service .
```

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

### Ability to ignore auth prefixes in the JWT plugin

The router now supports a configuration to ignore header prefixes with the JWT plugin. Given that many application headers use the format of `Authorization: <scheme> <token>`, this option enables the router to process requests for specific schemes within the `Authorization` header while ignoring others.

For example, you can configure the router to process requests with `Authorization: Bearer <token>` defined while ignoring others such as `Authorization: Basic <token>`:

```yaml title="router.yaml"
authentication:
router:
jwt:
header_name: authorization
header_value_prefix: "Bearer"
ignore_mismatched_prefix: true
```

If the header prefix is an empty string, this option is ignored.

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

### Support conditions on custom attributes for spans and a new selector for GraphQL errors ([Issue #4336](https://github.com/apollographql/router/issues/4336))

The router now supports conditionally adding attributes on a span and the new `on_graphql_error` selector that is set to true if the response body contains GraphQL errors.

An example configuration using `condition` in `attributes` and `on_graphql_error`:

```yaml
telemetry:
instrumentation:
spans:
router:
attributes:
otel.status_description:
static: "there was an error"
condition:
any:
- not:
eq:
- response_status: code
- 200
- eq:
- on_graphql_error
- true
```

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

## 馃悰 Fixes

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

This brings in a query planner fix released in v2.7.5 of Apollo Federation. Notably, from [its changelog](https://github.com/apollographql/federation/releases/tag/%40apollo%2Fquery-planner%402.7.5):

- Fix issue with missing fragment definitions due to `generateQueryFragments`. ([#2993](https://github.com/apollographql/federation/pull/2993))

An incorrect implementation detail in `generateQueryFragments` caused certain queries to be missing fragment definitions, causing the operation to be invalid and fail early in the request life-cycle (before execution). Specifically, subsequent fragment "candidates" with the same type condition and the same length of selections as a previous fragment weren't correctly added to the list of fragments. An example of an affected query is:

```graphql
query {
t {
... on A {
x
y
}
}
t2 {
... on A {
y
z
}
}
}
```

In this case, the second selection set would be converted to an inline fragment spread to subgraph fetches, but the fragment definition would be missing
By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/5064

### Use supergraph schema to extract authorization info ([PR #5047](https://github.com/apollographql/router/pull/5047))

The router now uses the supergraph schema to extract authorization info, as authorization information may not be available on the query planner's subgraph schemas. This reverts the authorization changes made in [PR #4975](https://github.com/apollographql/router/pull/4975).

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

### Filter fetches added to batch during batch creation ([PR #5034](https://github.com/apollographql/router/pull/5034))

Previously, the router didn't filter query hashes when creating batches. This could result in failed queries because the additional hashes could incorrectly make a query appear to be committed when it wasn't actually registered in a batch.

This release fixes this issue by filtering query hashes during batch creation.

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

### Use `subgraph.name` attribute instead of `apollo.subgraph.name` ([PR #5012](https://github.com/apollographql/router/pull/5012))

In the router v1.45.0, subgraph name mapping didn't work correctly in the Datadog exporter.

The Datadog exporter does some explicit mapping of attributes and was using a value `apollo.subgraph.name` that the latest versions of the router don't use. The correct choice is `subgraph.name`.

This release updates the mapping to reflect the change and fixes subgraph name mapping for Datadog.

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

## 馃摎 Documentation

### Document traffic shaping default configuration ([PR #4953](https://github.com/apollographql/router/pull/4953))

The documentation for [configuring traffic shaping](https://www.apollographql.com/docs/router/configuration/traffic-shaping#configuration) has been updated to clarify that it's enabled by default with preset values. This setting has been the default since PR [#3330](https://github.com/apollographql/router/pull/3330), which landed in [v1.23.0](https://github.com/apollographql/router/releases/tag/v1.23.0).

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

## 馃И Experimental

### Experimental type conditioned fetching ([PR #4748](https://github.com/apollographql/router/pull/4748))

This release introduces an experimental configuration to enable type-conditioned fetching.

Previously, when querying a field that was in a path of two or more unions, the query planner wasn't able to handle different selections and would aggressively collapse selections in fetches. This resulted in incorrect plans.

Enabling the `experimental_type_conditioned_fetching` option can fix this issue by configuring the query planner to fetch with type conditions.


```yaml
experimental_type_conditioned_fetching: true # false by default
```

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



# [1.45.1] - 2024-04-26

## 馃悰 Fixes
Expand Down

0 comments on commit 63e9fa2

Please sign in to comment.