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

[Batching] Build upon the recent configuration changes to enable subgraph filtering #4780

Merged
merged 49 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2be46ed
empty commit to open staging PR for v1.41.0
abernix Feb 16, 2024
9c77f61
Merge remote-tracking branch 'dev' into 1.41.0
abernix Feb 21, 2024
5e6fd44
prep release: v1.41.0-rc.0
abernix Feb 21, 2024
b3bdc03
Merge remote-tracking branch 'dev' into 1.41.0
abernix Feb 22, 2024
ea00ded
prep release: v1.41.0-rc.1
abernix Feb 22, 2024
74293c8
reactivate the macos x86_64 builder (#4723)
Geal Feb 23, 2024
7a41f22
prep release: v1.41.0 rc.2 (#4727)
Geal Feb 23, 2024
6a0de6b
prep release: v1.41.0
Geal Mar 4, 2024
16568f4
changelog fixes
Geal Mar 4, 2024
78b1ec4
Update mio (#4744)
Geal Mar 5, 2024
3ab70b6
update our base linux image to avoid CI brown outs (#4735)
garypen Mar 4, 2024
4af3506
Update reports proto (#4734)
bonnici Mar 6, 2024
aaeb1d0
Update mio (#4744)
Geal Mar 5, 2024
e06cf5f
reactivate the macos x86_64 builder (#4723)
Geal Feb 23, 2024
9e9527c
streaming body decompression
Geal Mar 6, 2024
69a0d04
prep release: v1.40.2-rc.0
abernix Mar 6, 2024
f6196da
prep release: v1.40.2
abernix Mar 6, 2024
30ea106
Add CHANGELOG.md for v1.40.2.
abernix Mar 6, 2024
7dfeadb
Add PR number to Changelog
abernix Mar 6, 2024
0f35f28
release: v1.40.2: security: Apply `limits.http_max_request_bytes` on …
abernix Mar 6, 2024
59a21e7
Reconcile `dev` after merge to `main` for v1.40.2 (#4760)
abernix Mar 6, 2024
64c54f5
Revert "prep release: v1.41.0"
abernix Mar 6, 2024
4cd65ab
Merge remote-tracking branch 'dev' into 1.41.0
abernix Mar 6, 2024
4bd015e
prep release: v1.41.0-rc.3
abernix Mar 6, 2024
380873a
doc fixes (#4747)
Geal Mar 6, 2024
626ce5b
document the interaction of subscriptions with policy authorization (…
Geal Mar 7, 2024
86db707
Revert "use a non blocking stdout (#4625)" (#4762)
abernix Mar 7, 2024
b1767a2
prep release: v1.41.0-rc.4
abernix Mar 7, 2024
45976bf
Support loading JWT from other sources (#4711)
Geal Mar 7, 2024
a2ad99d
add headers to the JWKS download request (#4688)
Geal Mar 7, 2024
986d664
docs: example response of unauth fields for requiresScopes (#4742)
shorgi Mar 7, 2024
d5db9f8
Add integration tests for nested files (#4754)
nicholascioli Mar 7, 2024
fcec874
Add integration test for non-nullable files
nicholascioli Mar 7, 2024
031d3cf
Attach `dd.trace_id` to json formatted log messages (#4764)
BrynCooke Mar 7, 2024
fabf6d2
docs: fix authn-jwt table (#4765)
Meschreiber Mar 7, 2024
b0c32e8
Up timeout in integration tests (#4768)
nicholascioli Mar 8, 2024
cb8d28d
prep release: v1.41.0
abernix Mar 8, 2024
5d8c2f8
docs: add Redis TLS config (#4732)
shorgi Mar 8, 2024
68b8ca3
Apply CHANGELOG.md suggestions from code review
abernix Mar 8, 2024
b0758f0
Update CHANGELOG.md date
abernix Mar 8, 2024
21b0771
release: v1.41.0
abernix Mar 8, 2024
b7c9c2a
Reconcile `dev` after merge to `main` for v1.41.0 (#4772)
abernix Mar 8, 2024
b4c27e6
Make integration test router bind to random port (#4722)
nicholascioli Mar 8, 2024
bf55d8b
prep release: v1.41.1
abernix Mar 8, 2024
c0d98f2
release: v1.41.1 (#4773)
abernix Mar 8, 2024
fc4e760
Reconcile `dev` after merge to `main` for v1.41.1 (#4774)
abernix Mar 8, 2024
109c4c9
Merge branch 'dev' into garypen/use-subgraph-config
garypen Mar 11, 2024
984d2c6
Build upon the recent configuration changes to enable subgraph filtering
garypen Mar 11, 2024
f0e91db
fix debug trace formatting
garypen Mar 12, 2024
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
5 changes: 0 additions & 5 deletions .changesets/feat_geal_entity_cache_span.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changesets/feat_geal_jwks_headers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Add headers to the JWKS download request ([Issue #4651](https://github.com/apollographql/router/issues/4651))

This adds the ability to set static headers on HTTP requests to download a JWKS from an identity provider

By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4688
5 changes: 5 additions & 0 deletions .changesets/feat_geal_jwt_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Support loading JWT from other sources ([PR #4711](https://github.com/apollographql/router/pull/4711))

The token can be stored in different headers, but it can also be carried by a cookie. This adds cookies as an alternative source of tokens, and allows multiple alternative sources

By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4711
7 changes: 0 additions & 7 deletions .changesets/feat_geal_redis_fail_open.md

This file was deleted.

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

This file was deleted.

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

This file was deleted.

17 changes: 17 additions & 0 deletions .changesets/fix_bryn_datadog_trace_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Attach `dd.trace_id` to JSON formatted log messages ([PR #4764](https://github.com/apollographql/router/pull/4764))

To enable correlation between DataDog tracing and logs, `dd.trace_id` must appear as a span attribute on the root of each JSON formatted log message.
Once you configure the `dd.trace_id` attribute in router.yaml, it will automatically be extracted from the root span and attached to the logs:

```yaml title="router.yaml"
telemetry:
instrumentation:
spans:
mode: spec_compliant
router:
attributes:
dd.trace_id: true
```


By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/4764
9 changes: 0 additions & 9 deletions .changesets/fix_geal_non_blocking_stdout.md

This file was deleted.

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

This file was deleted.

67 changes: 34 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,20 @@ executors:
environment:
CARGO_BUILD_JOBS: 8
RUST_TEST_THREADS: 8
macos_build: &macos_build_executor
arm_macos_build: &arm_macos_build_executor
macos:
# See https://circleci.com/docs/xcode-policy along with the support matrix
# at https://circleci.com/docs/using-macos#supported-xcode-versions.
# We use the major.minor notation to bring in compatible patches.
xcode: 14.2
resource_class: macos.m1.medium.gen1
intel_macos_build: &intel_macos_build_executor
macos:
# See https://circleci.com/docs/xcode-policy along with the support matrix
# at https://circleci.com/docs/using-macos#supported-xcode-versions.
# We use the major.minor notation to bring in compatible patches.
xcode: 14.2
resource_class: macos.x86.medium.gen2
macos_test: &macos_test_executor
macos:
# See https://circleci.com/docs/xcode-policy along with the support matrix
Expand Down Expand Up @@ -159,7 +166,7 @@ commands:
- when:
condition:
or:
- equal: [ *macos_build_executor, << parameters.platform >> ]
- equal: [ *arm_macos_build_executor, << parameters.platform >> ]
- equal: [ *macos_test_executor, << parameters.platform >> ]
steps:
- run:
Expand All @@ -170,7 +177,20 @@ commands:
- run:
name: Write arch
command: |
echo 'osx' >> ~/.arch
echo 'osx-aarch64' >> ~/.arch
- when:
condition:
equal: [ *intel_macos_build_executor, << parameters.platform >> ]
steps:
- run:
name: Make link to md5
command: |
mkdir -p ~/.local/aliases
ln -s /sbin/md5 ~/.local/aliases/md5sum
- run:
name: Write arch
command: |
echo 'osx-x86' >> ~/.arch
- when:
condition:
or:
Expand Down Expand Up @@ -243,7 +263,8 @@ commands:
- when:
condition:
or:
- equal: [ *macos_build_executor, << parameters.platform >> ]
- equal: [ *intel_macos_build_executor, << parameters.platform >> ]
- equal: [ *arm_macos_build_executor, << parameters.platform >> ]
- equal: [ *macos_test_executor, << parameters.platform >> ]
steps:
- run:
Expand Down Expand Up @@ -284,7 +305,8 @@ commands:
- when:
condition:
or:
- equal: [ *macos_build_executor, << parameters.platform >> ]
- equal: [ *intel_macos_build_executor, << parameters.platform >> ]
- equal: [ *arm_macos_build_executor, << parameters.platform >> ]
- equal: [ *macos_test_executor, << parameters.platform >> ]
steps:
- run:
Expand Down Expand Up @@ -333,15 +355,6 @@ commands:
name: Special case for Windows because of ssh-agent
command: |
printf "[net]\ngit-fetch-with-cli = true" >> ~/.cargo/Cargo.toml
- when:
condition:
or:
- equal: [ *macos_build_executor, << parameters.platform >> ]
steps:
- run:
name: Special case for OSX x86_64 builds
command: |
rustup target add x86_64-apple-darwin

install_extra_tools:
steps:
Expand Down Expand Up @@ -593,7 +606,10 @@ jobs:
platform: << parameters.platform >>
- when:
condition:
equal: [ *macos_build_executor, << parameters.platform >> ]
or:
- equal: [ *intel_macos_build_executor, << parameters.platform >> ]
- equal: [ *arm_macos_build_executor, << parameters.platform >> ]

steps:
- when:
condition:
Expand All @@ -602,28 +618,13 @@ jobs:
- run: cargo xtask release prepare nightly
- run:
command: >
cargo xtask dist --target aarch64-apple-darwin
- run:
command: >
cargo xtask dist --target x86_64-apple-darwin
cargo xtask dist
- run:
command: >
mkdir -p artifacts
- run:
command: >
cargo xtask package
--target aarch64-apple-darwin
--apple-team-id ${APPLE_TEAM_ID}
--apple-username ${APPLE_USERNAME}
--cert-bundle-base64 ${MACOS_CERT_BUNDLE_BASE64}
--cert-bundle-password ${MACOS_CERT_BUNDLE_PASSWORD}
--keychain-password ${MACOS_KEYCHAIN_PASSWORD}
--notarization-password ${MACOS_NOTARIZATION_PASSWORD}
--output artifacts/
- run:
command: >
cargo xtask package
--target x86_64-apple-darwin
--apple-team-id ${APPLE_TEAM_ID}
--apple-username ${APPLE_USERNAME}
--cert-bundle-base64 ${MACOS_CERT_BUNDLE_BASE64}
Expand Down Expand Up @@ -956,7 +957,7 @@ workflows:
matrix:
parameters:
platform:
[ macos_build, windows_build, amd_linux_build, arm_linux_build ]
[ intel_macos_build, arm_macos_build, windows_build, amd_linux_build, arm_linux_build ]
- secops/wiz-docker:
context:
- platform-docker-ro
Expand Down Expand Up @@ -1053,7 +1054,7 @@ workflows:
matrix:
parameters:
platform:
[ macos_build, windows_build, amd_linux_build, arm_linux_build ]
[ intel_macos_build, arm_macos_build, windows_build, amd_linux_build, arm_linux_build ]
filters:
branches:
ignore: /.*/
Expand Down
1 change: 1 addition & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

paths = [
'''^apollo-router\/src\/.+\/testdata\/.+''',
'''^apollo-router/src/plugins/authentication/tests.rs$'''
]

[[ rules ]]
Expand Down
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,75 @@ 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.41.1] - 2024-03-08

> [!NOTE]
>
> v1.41.1 replaces a failed publish of v1.41.0. The version number had to be moved from v1.41.0 to v1.41.1, but the release is otherwise the same. Apologies for the confusion!

## 🚀 Features

### Entity caching: Add tracing spans around Redis interactions ([PR #4667](https://github.com/apollographql/router/pull/4667))

This adds `cache_lookup` and `cache_store` spans to traces which show Redis calls related to our recently announced [entity caching](https://www.apollographql.com/docs/router/configuration/entity-caching/) feature. This also changes the behavior slightly so that storing in Redis does not stop the execution of the rest of the query.

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

### Use Gzip compression when downloading Persisted Query manifests ([PR #4622](https://github.com/apollographql/router/pull/4622))

Router will now request Gzip compression when downloading Persisted Query manifests for improved network efficiency.

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

### Redis: add a fail open option ([Issue #4334](https://github.com/apollographql/router/issues/4334))

This option configures the Router's behavior in case it cannot connect to Redis:
- By default, the router will start and all requests will be handled in a degraded state.
- Alternatively, this option can be configured to prevent the router from starting if it can't connect to Redis.

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

## 🐛 Fixes

### Default header now correctly set when `experimental_response_trace_id` is enabled ([Issue #4699](https://github.com/apollographql/router/issues/4699))

When configuring the `experimental_response_trace_id` without an explicit header it now correctly takes the default one `apollo-trace-id`.

Example of configuration:

```yaml
telemetry:
exporters:
tracing:
experimental_response_trace_id:
enabled: true
```

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

# [1.41.0] - 2024-03-08

> [!NOTE]
>
> The release of v1.41.0 failed unexpectedly late in the deployment process due to a preventable publishing failure. The release has been yanked from Crates.io on account of not being published successfully across all deployment targets. This release is fully replaced by v1.41.1. Apologies for the confusion!

# [1.40.2] - 2024-03-06

## 🔒 Security

### Apply `limits.http_max_request_bytes` on streaming request body decompression ([PR #4759](https://github.com/apollographql/router/pull/4759))

This release fixes a Denial-of-Service (DoS) type vulnerability which exists in affected versions of the Router according to our [published security advistory](https://github.com/apollographql/router/security/advisories/GHSA-cgqf-3cq5-wvcj). The fix changes the evaluation of the `limits.http_max_request_bytes` configuration to take place on a stream of bytes, allowing it to be applied to compressed HTTP payloads, prior to decompression. Previously, the limit was only being applied after the entirety of the compressed payload was decompressed, which could result in significant memory consumption which exceeded configured expectations while compressed payloads were expanded.

## 🐛 Fixes

### Re-activate the macOS Intel builder ([PR #4723](https://github.com/apollographql/router/pull/4723))

We have re-activated macOS Intel (x86) builds in CircleCI, despite their upcoming deprecation, while we take a different approach to solving this and maintaining Intel support for the time-being. This became necessary since cross-compiling the router from ARM to x86 resulted in issues with V8 snapshots and runtime issues on the macOS Intel binaries produced by those Apple Silicon build machines.

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

# [1.40.1] - 2024-02-16

## 🐛 Fixes
Expand Down
17 changes: 14 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.40.1"
version = "1.41.1"
dependencies = [
"access-json",
"anyhow",
Expand All @@ -278,6 +278,7 @@ dependencies = [
"clap",
"console",
"console-subscriber",
"cookie",
"dashmap",
"derivative",
"derive_more",
Expand Down Expand Up @@ -408,7 +409,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.40.1"
version = "1.41.1"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -424,7 +425,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.40.1"
version = "1.41.1"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down Expand Up @@ -1668,6 +1669,16 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"

[[package]]
name = "cookie"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8"
dependencies = [
"time",
"version_check",
]

[[package]]
name = "cookie-factory"
version = "0.3.2"
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.40.1"
version = "1.41.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/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-scaffold"
version = "1.40.1"
version = "1.41.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.40.1"
apollo-router = "1.41.1"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
Loading