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

Reconcile dev after merge to main for v1.36.0 #4429

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
433bf2b
fix the changelog for the 1.35.0 release (#4322)
garypen Dec 4, 2023
c75319f
docs: fix Rhai relative links (#4298)
Meschreiber Dec 5, 2023
67b7008
Update v1.35.0 CHANGELOG.md with additional details around #4228 (#4329)
abernix Dec 5, 2023
5d15ccd
docs: cherry-pick telemetry updates from dev (#4345)
shorgi Dec 8, 2023
a0ad5a3
prep release: v1.36.0-rc.0
abernix Dec 11, 2023
e4497f1
Merge branch 'dev' into 1.36.0
lennyburdette Dec 12, 2023
b111bc4
prep release: v1.36.0-rc.1
lennyburdette Dec 12, 2023
09be55d
docs: update policy use case example (#4361)
shorgi Dec 12, 2023
5ea218b
[docs] Update rhai docs to include Router service (#4325)
smyrick Dec 12, 2023
26af909
Move comparative validation metric into `apollo.router.operations` na…
goto-bus-stop Dec 13, 2023
19ab8b2
prep release: v1.36.0-rc.2
abernix Dec 13, 2023
5b6eb7a
Merge remote-tracking branch 'origin/main' into 1.36.0
abernix Dec 13, 2023
9e7e6f2
Apply suggestions from code review
abernix Dec 13, 2023
48dd43c
prep release: v1.36.0
lennyburdette Dec 14, 2023
6d2986f
fix panic in subquery hash (#4387)
Geal Dec 14, 2023
68d2092
Fix subgraph query hashing with fragment reuse (#4388)
Geal Dec 14, 2023
fff3cef
test fragment reuse (#4392)
Geal Dec 15, 2023
c255f26
use __typename as current type if present in requires selection (#4400)
Geal Dec 18, 2023
0ba48aa
chore: Update zerocopy dependency (#4403)
o0Ignition0o Dec 18, 2023
bad6da5
Re-restore -rc.3 readiness for this branch, pre-release
abernix Dec 18, 2023
409d301
Add CHANGESET for https://github.com/apollographql/router/issues/3551
abernix Dec 18, 2023
5007a86
CHANGELOG for https://github.com/apollographql/router/issues/3855
abernix Dec 18, 2023
5d41256
prep release: v1.36.0-rc.3
abernix Dec 18, 2023
d8dc49e
Update standard-instruments.mdx
abernix Dec 19, 2023
ca4ff40
Update overview.mdx
abernix Dec 19, 2023
eb5afe9
prep release: v1.36.0
abernix Jan 2, 2024
77059f6
release: v1.36.0
abernix Jan 2, 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
6 changes: 0 additions & 6 deletions .changesets/feat_lrlna_graphql_validation_both.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changesets/fix_bryn_span_mode.md

This file was deleted.

63 changes: 61 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,59 @@ 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.36.0] - 2024-01-02

## 🚀 Features

### Run new (non-load-bearing) Rust validation out-of-band to help identify deltas ([Issue#4159](https://github.com/apollographql/router/issues/4159))

As part of the process to replace JavaScript validation with a more performant Rust validation in the router, we are enabling the router to run both validations as a default. This allows us to definitively assess reliability and stability of Rust validation before completely removing JavaScript validation. As before, it's possible to toggle between implementations using the `experimental_graphql_validation_mode` config key. Possible values are: `new` (runs only Rust-based validation), `legacy` (runs only JS-based validation), `both` (runs both in comparison, logging errors if a difference arises).

The `both` mode is now the default, which will result in **no client-facing impact** but will output errors to the Router's logs if a discrepancy is recorded. If you discover discrepancies in your logs, please open an issue.

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

## 🐛 Fixes

### Fix fragment usage with `@interfaceObject` ([Issue #3855](https://github.com/apollographql/router/issues/3855))

When requesting `__typename` under a fragment under an interface, from a subgraph adding fields to that interface with the `@interfaceObject` directive, the router was returning the interface name instead of the concrete type name. This is now fixed at the query planner level.

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

### TLS client configuration override for Redis ([Issue #3551](https://github.com/apollographql/router/issues/3551))

It is now possible to set up a client certificate or override the root certificate authority list for Redis connections, through the `tls` section under Redis configuration. Options follow the same format as [subgraph TLS configuration](https://www.apollographql.com/docs/router/configuration/overview/#tls):

```yaml
apq:
router:
cache:
redis:
urls: [ "redis://localhost:6379" ]
tls:
certificate_authorities: ""
client_authentication:
certificate_chain:
key:
```

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

### `span_mode: spec_compliant` not applied correctly ([Issue #4335](https://github.com/apollographql/router/issues/4335))

Previously, `telemetry.instrumentation.spans.span_mode.spec_compliant` was not being correctly applied. This resulted in extra request spans that should not have been present in spec compliant mode, where `router.supergraph.subgraph` was incorrectly output as `request.router.supergraph.subgraph`. This has been fixed in this release.

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

## 🛠 Maintenance

### chore: Update zerocopy dependency ([PR #4403](https://github.com/apollographql/router/pull/4403))

This changeset updates zerocopy to 0.7.31, which has a fix for https://rustsec.org/advisories/RUSTSEC-2023-0074.

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

# [1.35.0] - 2023-12-01

## 🚀 Features
Expand Down Expand Up @@ -57,6 +110,12 @@ By [@bnjjj](https://github.com/bnjjj), [@bryncooke](https://github.com/bryncooke

## 🐛 Fixes

### Remove doubled slash (`//`) in logs for health check URL ([Issue #4270](https://github.com/apollographql/router/issues/4270))

Adding the ability to specify the path of the health endpoint introduced an error in the logging. An extra `/` was added before the specified path resulting in an unintended double-slash (`//`) in the rendered URL. It did not affect the actual health check endpoint. This is now fixed.

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

### Improved query deduplication with extracted authorization information from subgraph queries ([PR #4208](https://github.com/apollographql/router/pull/4208))

Query deduplication has been improved with authorization information extracted from subgraph queries.
Expand Down Expand Up @@ -155,9 +214,9 @@ To better comply with OpenTelemetry naming conventions, for `apollo.router.telem

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

### Rhai scripts no longer preventing traces from appearing in Apollo Studio ([PR #4228](https://github.com/apollographql/router/pull/4228))
### Rhai scripts or coprocessors no longer prevent traces from appearing in Apollo Studio ([PR #4228](https://github.com/apollographql/router/pull/4228))

Previously, the trace report for the Apollo Router when configured with a Rhai script may have been incomplete. That issue has been resolved in this release.
Previously, trace reports were not appearing in Apollo Studio's Operations view when the Router was configured with either coprocessors or Rhai script. That issue has been resolved in this release.

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

Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.35.0"
version = "1.36.0"
dependencies = [
"access-json",
"anyhow",
Expand Down Expand Up @@ -411,7 +411,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.35.0"
version = "1.36.0"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -427,7 +427,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.35.0"
version = "1.36.0"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down Expand Up @@ -8224,18 +8224,18 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"

[[package]]
name = "zerocopy"
version = "0.7.26"
version = "0.7.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0"
checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d"
dependencies = [
"zerocopy-derive",
]

[[package]]
name = "zerocopy-derive"
version = "0.7.26"
version = "0.7.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f"
checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a"
dependencies = [
"proc-macro2 1.0.66",
"quote 1.0.33",
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.35.0"
version = "1.36.0"
authors = ["Apollo Graph, Inc. <[email protected]>"]
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.35.0"
version = "1.36.0"
authors = ["Apollo Graph, Inc. <[email protected]>"]
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.35.0"
apollo-router = "1.36.0"
{{/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.35.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.36.0" }
{{/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.35.0"
version = "1.36.0"
authors = ["Apollo Graph, Inc. <[email protected]>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down
12 changes: 6 additions & 6 deletions apollo-router/src/query_planner/bridge_query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl BridgeQueryPlanner {

if has_validation_errors && !schema.has_errors() {
tracing::warn!(
monotonic_counter.apollo.router.validation = 1u64,
monotonic_counter.apollo.router.operations.validation = 1u64,
validation.source = VALIDATION_SOURCE_SCHEMA,
validation.result = VALIDATION_FALSE_NEGATIVE,
"validation mismatch: JS query planner reported a schema validation error, but apollo-rs did not"
Expand All @@ -107,15 +107,15 @@ impl BridgeQueryPlanner {
if configuration.experimental_graphql_validation_mode == GraphQLValidationMode::Both {
if schema.has_errors() {
tracing::warn!(
monotonic_counter.apollo.router.validation = 1u64,
monotonic_counter.apollo.router.operations.validation = 1u64,
validation.source = VALIDATION_SOURCE_SCHEMA,
validation.result = VALIDATION_FALSE_POSITIVE,
"validation mismatch: apollo-rs reported a schema validation error, but JS query planner did not"
);
} else {
// false_negative was an early return so we know it was correct here
tracing::info!(
monotonic_counter.apollo.router.validation = 1u64,
monotonic_counter.apollo.router.operations.validation = 1u64,
validation.source = VALIDATION_SOURCE_SCHEMA,
validation.result = VALIDATION_MATCH
);
Expand Down Expand Up @@ -341,7 +341,7 @@ impl BridgeQueryPlanner {
) {
(false, Some(validation_error)) => {
tracing::warn!(
monotonic_counter.apollo.router.validation = 1u64,
monotonic_counter.apollo.router.operations.validation = 1u64,
validation.source = VALIDATION_SOURCE_OPERATION,
validation.result = VALIDATION_FALSE_POSITIVE,
"validation mismatch: JS query planner did not report query validation error, but apollo-rs did"
Expand All @@ -352,7 +352,7 @@ impl BridgeQueryPlanner {
}
(true, None) => {
tracing::warn!(
monotonic_counter.apollo.router.validation = 1u64,
monotonic_counter.apollo.router.operations.validation = 1u64,
validation.source = VALIDATION_SOURCE_OPERATION,
validation.result = VALIDATION_FALSE_NEGATIVE,
"validation mismatch: apollo-rs did not report query validation error, but JS query planner did"
Expand All @@ -365,7 +365,7 @@ impl BridgeQueryPlanner {
}
// if JS and Rust implementations agree, we return the JS result for now.
_ => tracing::info!(
monotonic_counter.apollo.router.validation = 1u64,
monotonic_counter.apollo.router.operations.validation = 1u64,
validation.source = VALIDATION_SOURCE_OPERATION,
validation.result = VALIDATION_MATCH,
),
Expand Down
6 changes: 3 additions & 3 deletions apollo-router/src/query_planner/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ impl FetchNode {

let mut visitor = QueryHashVisitor::new(schema, &doc);
visitor.subgraph_query = !self.requires.is_empty();
traverse::document(&mut visitor, &doc).unwrap();

self.schema_aware_hash = Arc::new(QueryHash(visitor.finish()));
if traverse::document(&mut visitor, &doc).is_ok() {
self.schema_aware_hash = Arc::new(QueryHash(visitor.finish()));
}
}

pub(crate) fn extract_authorization_metadata(
Expand Down
8 changes: 6 additions & 2 deletions apollo-router/src/query_planner/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::json_ext::Object;
use crate::json_ext::Value;
use crate::json_ext::ValueExt;
use crate::spec::Schema;
use crate::spec::TYPENAME;

/// A selection that is part of a fetch.
/// Selections are used to propagate data to subgraph fetches.
Expand Down Expand Up @@ -59,7 +60,10 @@ pub(crate) fn execute_selection_set<'a>(
None => return Value::Null,
};

current_type = current_type.or_else(|| content.get("__typename").and_then(|v| v.as_str()));
current_type = content
.get(TYPENAME)
.and_then(|v| v.as_str())
.or(current_type);

let mut output = Object::with_capacity(selections.len());
for selection in selections {
Expand All @@ -84,7 +88,7 @@ pub(crate) fn execute_selection_set<'a>(

match content.get_key_value(selection_name) {
None => {
if name == "__typename" {
if name == TYPENAME {
// if the __typename field was missing but we can infer it, fill it
if let Some(ty) = current_type {
output.insert(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: apollo-router/src/query_planner/tests.rs
expression: "serde_json::to_value(&response).unwrap()"
---
{
"data": {
"stuff": {
"id": "1",
"isEnabled": true
}
}
}
Loading
Loading