Skip to content

Commit

Permalink
release: v1.56.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored Oct 1, 2024
2 parents 024f24e + ce58a25 commit 1b9899a
Show file tree
Hide file tree
Showing 116 changed files with 11,626 additions and 941 deletions.
8 changes: 0 additions & 8 deletions .changesets/chore_update_router_bridge.md

This file was deleted.

8 changes: 3 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version: 2.1

# TODO Remove this line.

# These "CircleCI Orbs" are reusable bits of configuration that can be shared
# across projects. See https://circleci.com/orbs/ for more information.
orbs:
Expand Down Expand Up @@ -358,9 +356,9 @@ commands:
equal: [ *arm_linux_test_executor, << parameters.platform >> ]
steps:
- run:
name: Install nightly Rust to build the fuzzers
name: Install nightly-2024-09-22 Rust to build the fuzzers
command: |
rustup install nightly
rustup install nightly-2024-09-22
install_extra_tools:
steps:
Expand Down Expand Up @@ -526,7 +524,7 @@ commands:
path: ./target/nextest/ci/junit.xml
fuzz_build:
steps:
- run: cargo +nightly fuzz build
- run: cargo +nightly-2024-09-22 fuzz build

jobs:
lint:
Expand Down
79 changes: 79 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,85 @@ 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.56.0] - 2024-10-01

> [!IMPORTANT]
> If you have enabled [Distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), this release changes the hashing algorithm used for the cache keys. On account of this, you should anticipate additional cache regeneration cost when updating between these versions while the new hashing algorithm comes into service.

## 🚀 Features

## Native query planner is now in public preview

The native query planner is now in public preview. You can configure the `experimental_query_planner_mode` option in the router configuration YAML to change the mode of the native query planner. The following modes are available:

- `new`: Enable _only_ the new Rust-native query planner in the hot-path of query execution.
- `legacy`: Enable _only_ the legacy JavaScript query planner in the hot-path of query execution.
- `both_best_effort`: Enables _both_ the new and legacy query planners. They are configured in a comparison-based mode of operation with the legacy planner in the hot-path and the and the new planner in the cold-path. Comparisons are made between the two plans on a sampled basis and metrics are available to analyze the differences in aggregate.

### Support loading Apollo key from file ([PR #5917](https://github.com/apollographql/router/pull/5917))

You can now specific the location to a file containing the Apollo key that's used by Apollo Uplink and usage reporting. The router now supports both the `--apollo-key-path` CLI argument and the `APOLLO_KEY_PATH` environment variable for passing the file containing your Apollo key.

Previously, the router supported only the `APOLLO_KEY` environment variable to provide the key. The new CLI argument and environment variable help users who prefer not to pass sensitive keys through environment variables.

Note: This feature is unavailable for Windows.

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


## 🐛 Fixes

### Prevent sending internal `apollo_private.*` attributes to Jaeger collector ([PR #6033](https://github.com/apollographql/router/pull/6033))

When using the router's Jaeger collector to send traces, you will no longer receive span attributes with the `apollo_private.` prefix. Those attributes were incorrectly sent, as that prefix is reserved for internal attributes.

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

### Fix displaying custom event attributes on subscription events ([PR #6033](https://github.com/apollographql/router/pull/6033))

The router now properly displays custom event attributes that are set with selectors at the supergraph level.

An example configuration:

```yaml title=router.yaml
telemetry:
instrumentation:
events:
supergraph:
supergraph.event:
message: supergraph event
on: event_response # on every supergraph event (like subscription event for example)
level: info
attributes:
test:
static: foo
response.data:
response_data: $ # Display all the response data payload
response.errors:
response_errors: $ # Display all the response errors payload
```

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

### Update to Federation v2.9.2 ([PR #6069](https://github.com/apollographql/router/pull/6069))

This release updates to Federation v2.9.2, with a small fix to the internal `__typename` optimization and a fix to prevent argument name collisions in the `@context`/`@fromContext` directives.

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

## 📃 Configuration

### Add metrics for Rust vs. Deno configuration values ([PR #6056](https://github.com/apollographql/router/pull/6056))

To help track the migration from JavaScript (Deno) to native Rust implementations, the router now reports the values of the following configuration options to Apollo:

- `apollo.router.config.experimental_query_planner_mode`
- `apollo.router.config.experimental_introspection_mode`

By [@goto-bus-stop](https://github.com/goto-bus-stop) in https://github.com/apollographql/router/pull/6056



# [1.55.0] - 2024-09-24

> [!IMPORTANT]
Expand Down
30 changes: 10 additions & 20 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"

[[package]]
name = "apollo-compiler"
version = "1.0.0-beta.23"
version = "1.0.0-beta.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "875f39060728ac3e775fc3fe5421225d6df92c4d5155a9524cdb198f05006d36"
checksum = "71153ad85c85f7aa63f0e0a5868912c220bb48e4c764556f5841d37fc17b0103"
dependencies = [
"ahash",
"apollo-parser",
Expand All @@ -178,7 +178,7 @@ dependencies = [

[[package]]
name = "apollo-federation"
version = "1.55.0"
version = "1.56.0"
dependencies = [
"apollo-compiler",
"derive_more",
Expand Down Expand Up @@ -229,7 +229,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.55.0"
version = "1.56.0"
dependencies = [
"access-json",
"ahash",
Expand Down Expand Up @@ -268,7 +268,6 @@ dependencies = [
"derive_more",
"dhat",
"diff",
"directories",
"displaydoc",
"ecdsa",
"flate2",
Expand Down Expand Up @@ -400,7 +399,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.55.0"
version = "1.56.0"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -416,7 +415,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.55.0"
version = "1.56.0"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down Expand Up @@ -448,9 +447,9 @@ dependencies = [

[[package]]
name = "apollo-smith"
version = "0.13.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40cff1a5989a471714cfdf53f24d0948b7f77631ab3dbd25b2f6eacbf58e5261"
checksum = "d89479524886fdbe62b124d3825879778680e0147304d1a6d32164418f8089a2"
dependencies = [
"apollo-compiler",
"apollo-parser",
Expand Down Expand Up @@ -2303,15 +2302,6 @@ dependencies = [
"walkdir",
]

[[package]]
name = "directories"
version = "5.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35"
dependencies = [
"dirs-sys",
]

[[package]]
name = "dirs"
version = "5.0.1"
Expand Down Expand Up @@ -5609,9 +5599,9 @@ dependencies = [

[[package]]
name = "router-bridge"
version = "0.6.2+v2.9.1"
version = "0.6.3+v2.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a82c217157e756750386a5371da31590c89c315d953ae6d299d73949138e332f"
checksum = "2f183e217b4010e7d37d581b7919ca5e0136a46b6d6b1ff297c52e702bce1089"
dependencies = [
"anyhow",
"async-channel 1.9.0",
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ debug = 1
# Dependencies used in more than one place are specified here in order to keep versions in sync:
# https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
[workspace.dependencies]
apollo-compiler = "=1.0.0-beta.23"
apollo-compiler = "=1.0.0-beta.24"
apollo-parser = "0.8.0"
apollo-smith = "0.13.0"
apollo-smith = "0.14.0"
async-trait = "0.1.77"
hex = { version = "0.4.3", features = ["serde"] }
http = "0.2.11"
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-federation"
version = "1.55.0"
version = "1.56.0"
authors = ["The Apollo GraphQL Contributors"]
edition = "2021"
description = "Apollo Federation"
Expand Down
10 changes: 6 additions & 4 deletions apollo-federation/src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ use apollo_compiler::Schema;
fn is_semantic_directive_application(directive: &Directive) -> bool {
match directive.name.as_str() {
"specifiedBy" => true,
// For @deprecated, explicitly writing `reason: null` disables the directive,
// as `null` overrides the default string value.
// graphql-js’ intropection returns `isDeprecated: false` for `@deprecated(reason: null)`,
// which is arguably a bug. Do the same here for now.
// TODO: remove this and allow `isDeprecated: true`, `deprecatedReason: null`
// after we fully move to Rust introspection?
"deprecated"
if directive
.argument_by_name("reason")
.specified_argument_by_name("reason")
.is_some_and(|value| value.is_null()) =>
{
false
Expand All @@ -42,7 +44,7 @@ fn is_semantic_directive_application(directive: &Directive) -> bool {
fn standardize_deprecated(directive: &mut Directive) {
if directive.name == "deprecated"
&& directive
.argument_by_name("reason")
.specified_argument_by_name("reason")
.and_then(|value| value.as_str())
.is_some_and(|reason| reason == "No longer supported")
{
Expand Down
8 changes: 4 additions & 4 deletions apollo-federation/src/link/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) fn directive_optional_enum_argument(
application: &Node<Directive>,
name: &Name,
) -> Result<Option<Name>, FederationError> {
match application.argument_by_name(name) {
match application.specified_argument_by_name(name) {
Some(value) => match value.deref() {
Value::Enum(name) => Ok(Some(name.clone())),
Value::Null => Ok(None),
Expand Down Expand Up @@ -48,7 +48,7 @@ pub(crate) fn directive_optional_string_argument<'doc>(
application: &'doc Node<Directive>,
name: &Name,
) -> Result<Option<&'doc str>, FederationError> {
match application.argument_by_name(name) {
match application.specified_argument_by_name(name) {
Some(value) => match value.deref() {
Value::String(name) => Ok(Some(name)),
Value::Null => Ok(None),
Expand Down Expand Up @@ -83,7 +83,7 @@ pub(crate) fn directive_optional_boolean_argument(
application: &Node<Directive>,
name: &Name,
) -> Result<Option<bool>, FederationError> {
match application.argument_by_name(name) {
match application.specified_argument_by_name(name) {
Some(value) => match value.deref() {
Value::Boolean(value) => Ok(Some(*value)),
Value::Null => Ok(None),
Expand Down Expand Up @@ -119,7 +119,7 @@ pub(crate) fn directive_optional_variable_boolean_argument(
application: &Node<Directive>,
name: &Name,
) -> Result<Option<BooleanOrVariable>, FederationError> {
match application.argument_by_name(name) {
match application.specified_argument_by_name(name) {
Some(value) => match value.deref() {
Value::Variable(name) => Ok(Some(BooleanOrVariable::Variable(name.clone()))),
Value::Boolean(value) => Ok(Some(BooleanOrVariable::Boolean(*value))),
Expand Down
12 changes: 6 additions & 6 deletions apollo-federation/src/link/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ pub fn links_metadata(schema: &Schema) -> Result<Option<LinksMetadata>, LinkErro
return Err(LinkError::BootstrapError(format!(
"the @link specification itself (\"{}\") is applied multiple times",
extraneous_directive
.argument_by_name("url")
.specified_argument_by_name("url")
// XXX(@goto-bus-stop): @core compatibility is primarily to support old tests in other projects,
// and should be removed when those are updated.
.or(extraneous_directive.argument_by_name("feature"))
.or(extraneous_directive.specified_argument_by_name("feature"))
.and_then(|value| value.as_str().map(Cow::Borrowed))
.unwrap_or_else(|| Cow::Owned(Identity::link_identity().to_string()))
)));
Expand Down Expand Up @@ -184,13 +184,13 @@ fn is_bootstrap_directive(schema: &Schema, directive: &Directive) -> bool {
};
if is_link_directive_definition(definition) {
if let Some(url) = directive
.argument_by_name("url")
.specified_argument_by_name("url")
.and_then(|value| value.as_str())
{
let url = url.parse::<Url>();
let default_link_name = DEFAULT_LINK_NAME;
let expected_name = directive
.argument_by_name("as")
.specified_argument_by_name("as")
.and_then(|value| value.as_str())
.unwrap_or(default_link_name.as_str());
return url.map_or(false, |url| {
Expand All @@ -201,12 +201,12 @@ fn is_bootstrap_directive(schema: &Schema, directive: &Directive) -> bool {
// XXX(@goto-bus-stop): @core compatibility is primarily to support old tests--should be
// removed when those are updated.
if let Some(url) = directive
.argument_by_name("feature")
.specified_argument_by_name("feature")
.and_then(|value| value.as_str())
{
let url = url.parse::<Url>();
let expected_name = directive
.argument_by_name("as")
.specified_argument_by_name("as")
.and_then(|value| value.as_str())
.unwrap_or("core");
return url.map_or(false, |url| {
Expand Down
10 changes: 5 additions & 5 deletions apollo-federation/src/link/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ impl Link {
}

pub fn from_directive_application(directive: &Node<Directive>) -> Result<Link, LinkError> {
let (url, is_link) = if let Some(value) = directive.argument_by_name("url") {
let (url, is_link) = if let Some(value) = directive.specified_argument_by_name("url") {
(value, true)
} else if let Some(value) = directive.argument_by_name("feature") {
} else if let Some(value) = directive.specified_argument_by_name("feature") {
// XXX(@goto-bus-stop): @core compatibility is primarily to support old tests--should be
// removed when those are updated.
(value, false)
Expand All @@ -303,19 +303,19 @@ impl Link {
})?;

let spec_alias = directive
.argument_by_name("as")
.specified_argument_by_name("as")
.and_then(|arg| arg.as_str())
.map(Name::new)
.transpose()?;
let purpose = if let Some(value) = directive.argument_by_name("for") {
let purpose = if let Some(value) = directive.specified_argument_by_name("for") {
Some(Purpose::from_value(value)?)
} else {
None
};

let imports = if is_link {
directive
.argument_by_name("import")
.specified_argument_by_name("import")
.and_then(|arg| arg.as_list())
.unwrap_or(&[])
.iter()
Expand Down
Loading

0 comments on commit 1b9899a

Please sign in to comment.