Skip to content

Commit ff9f666

Browse files
authored
release: v1.45.1 (#5009)
1 parent eb02494 commit ff9f666

30 files changed

+388
-385
lines changed

.circleci/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ executors:
4848
# See https://circleci.com/docs/xcode-policy along with the support matrix
4949
# at https://circleci.com/docs/using-macos#supported-xcode-versions.
5050
# We use the major.minor notation to bring in compatible patches.
51-
xcode: 14.2
51+
xcode: "14.2.0"
5252
resource_class: macos.m1.medium.gen1
5353
macos_test: &macos_test_executor
5454
macos:
5555
# See https://circleci.com/docs/xcode-policy along with the support matrix
5656
# at https://circleci.com/docs/using-macos#supported-xcode-versions.
5757
# We use the major.minor notation to bring in compatible patches.
58-
xcode: 14.2
58+
xcode: "14.2.0"
5959
resource_class: macos.m1.medium.gen1
6060
windows_build: &windows_build_executor
6161
machine:
@@ -201,7 +201,7 @@ commands:
201201
find xtask/src -type f | while read name; do md5sum $name; done | sort -k 2 | md5sum > ~/.xtask_version
202202
# The closest common ancestor to the default branch, so that test jobs can take advantage previous compiles
203203
git remote set-head origin -a
204-
TARGET_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD)
204+
TARGET_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD)
205205
echo "Target branch is ${TARGET_BRANCH}"
206206
COMMON_ANCESTOR_REF=$(git merge-base HEAD "${TARGET_BRANCH}")
207207
echo "Common ancestor is ${COMMON_ANCESTOR_REF}"
@@ -715,8 +715,8 @@ jobs:
715715
# save containers for analysis
716716
mkdir built-containers
717717
docker save -o built-containers/router_${VERSION}-debug.tar ${ROUTER_TAG}:${VERSION}-debug
718-
docker save -o built-containers/router_${VERSION}.tar ${ROUTER_TAG}:${VERSION}
719-
718+
docker save -o built-containers/router_${VERSION}.tar ${ROUTER_TAG}:${VERSION}
719+
720720
- persist_to_workspace:
721721
root: .
722722
paths:
@@ -971,8 +971,8 @@ workflows:
971971
# Disables all PR comments from this job
972972
do-pr-comments: false
973973
# Scan job will return 1 if findings violating the Wiz policy are found.
974-
# Toggle off to prevent any CI failures OR
975-
# contact Apollo's Security team to adjust what violates the
974+
# Toggle off to prevent any CI failures OR
975+
# contact Apollo's Security team to adjust what violates the
976976
# Wiz policy used in this scan.
977977
fail-on-findings: true
978978
# Configure scan job to use a policy specific to apollo-router.
@@ -1069,7 +1069,7 @@ workflows:
10691069
ignore: /.*/
10701070
tags:
10711071
only: /v.*/
1072-
1072+
10731073
security-scans:
10741074
when:
10751075
not: << pipeline.parameters.nightly >>

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,37 @@ All notable changes to Router will be documented in this file.
44

55
This project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
66

7+
# [1.45.1] - 2024-04-26
8+
9+
## 🐛 Fixes
10+
11+
### Correct v1.44.0 regression in query plan cache ([PR #5028](https://github.com/apollographql/router/pull/5028))
12+
13+
Correct a critical regression that was introduced in [v1.44.0](https://github.com/apollographql/router/pull/4883) which could lead to execution of an incorrect query plan.
14+
15+
By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/5028
16+
17+
### Use entire schema when hashing an introspection query ([Issue #5006](https://github.com/apollographql/router/issues/5006))
18+
19+
Correct a _different_ hashing bug which impacted introspection queries which was also introduced in [v1.44.0](https://github.com/apollographql/router/pull/4883). This other hashing bug failed to account for introspection queries, resulting in introspection results being misaligned to the current schema.
20+
21+
This release fixes the hashing mechanism by adding the schema string to hashed data if an introspection field is encountered. As a result, the entire schema is taken into account and the correct introspection result is returned.
22+
23+
By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/5007
24+
25+
### Fix subgraph name mapping of Datadog exporter ([PR #5012](https://github.com/apollographql/router/pull/5012))
26+
27+
Previously in the router v1.45.0, subgraph name mapping didn't work correctly in the router's Datadog exporter. The exporter used the incorrect value `apollo.subgraph.name` for mapping attributes when it should have used the value `subgraph.name`. This issue has been fixed in this release.
28+
29+
By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/5012
30+
31+
732
# [1.45.0] - 2024-04-22
833

34+
> **Warning**
35+
>
36+
> **This version has a critical bug impacting all users. See the _Fixes_ in [v1.45.1](https://github.com/apollographql/router/releases/tag/v1.45.1) for details. We highly recommend using v1.45.1 or v1.43.2 over v1.45.0.**
37+
938
## 🚀 Features
1039

1140
### Query validation process with Rust ([PR #4551](https://github.com/apollographql/router/pull/4551))
@@ -154,6 +183,11 @@ By [@bonnici](https://github.com/bonnici) in https://github.com/apollographql/ro
154183

155184
# [1.44.0] - 2024-04-12
156185

186+
> **Warning**
187+
>
188+
> **This version has a critical bug impacting all users. See the _Fixes_ in [v1.45.1](https://github.com/apollographql/router/releases/tag/v1.45.1) for details. We highly recommend using v1.45.1 or v1.43.2 over v1.44.0.**
189+
190+
157191
## 🚀 Features
158192

159193
### Add details to `router service call failed` errors ([Issue #4899](https://github.com/apollographql/router/issues/4899))

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ dependencies = [
250250

251251
[[package]]
252252
name = "apollo-router"
253-
version = "1.45.0"
253+
version = "1.45.1"
254254
dependencies = [
255255
"access-json",
256256
"anyhow",
@@ -411,7 +411,7 @@ dependencies = [
411411

412412
[[package]]
413413
name = "apollo-router-benchmarks"
414-
version = "1.45.0"
414+
version = "1.45.1"
415415
dependencies = [
416416
"apollo-parser",
417417
"apollo-router",
@@ -427,7 +427,7 @@ dependencies = [
427427

428428
[[package]]
429429
name = "apollo-router-scaffold"
430-
version = "1.45.0"
430+
version = "1.45.1"
431431
dependencies = [
432432
"anyhow",
433433
"cargo-scaffold",

apollo-router-benchmarks/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "apollo-router-benchmarks"
3-
version = "1.45.0"
3+
version = "1.45.1"
44
authors = ["Apollo Graph, Inc. <[email protected]>"]
55
edition = "2021"
66
license = "Elastic-2.0"

apollo-router-scaffold/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "apollo-router-scaffold"
3-
version = "1.45.0"
3+
version = "1.45.1"
44
authors = ["Apollo Graph, Inc. <[email protected]>"]
55
edition = "2021"
66
license = "Elastic-2.0"

apollo-router-scaffold/templates/base/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ apollo-router = { path ="{{integration_test}}apollo-router" }
2222
apollo-router = { git="https://github.com/apollographql/router.git", branch="{{branch}}" }
2323
{{else}}
2424
# Note if you update these dependencies then also update xtask/Cargo.toml
25-
apollo-router = "1.45.0"
25+
apollo-router = "1.45.1"
2626
{{/if}}
2727
{{/if}}
2828
async-trait = "0.1.52"

apollo-router-scaffold/templates/base/xtask/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ apollo-router-scaffold = { path ="{{integration_test}}apollo-router-scaffold" }
1313
{{#if branch}}
1414
apollo-router-scaffold = { git="https://github.com/apollographql/router.git", branch="{{branch}}" }
1515
{{else}}
16-
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.45.0" }
16+
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.45.1" }
1717
{{/if}}
1818
{{/if}}
1919
anyhow = "1.0.58"

apollo-router/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "apollo-router"
3-
version = "1.45.0"
3+
version = "1.45.1"
44
authors = ["Apollo Graph, Inc. <[email protected]>"]
55
repository = "https://github.com/apollographql/router/"
66
documentation = "https://docs.rs/apollo-router"

apollo-router/src/plugins/progressive_override/snapshots/apollo_router__plugins__progressive_override__tests__non_overridden_field_yields_expected_query_plan.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ expression: query_plan
1818
"id": null,
1919
"inputRewrites": null,
2020
"outputRewrites": null,
21-
"schemaAwareHash": "9358047754b11522aac502a3c6a668cd4286c07d489680834e63d6e033db4eb5",
21+
"schemaAwareHash": "12dda6193654ae4fe6e38bc09d4f81cc73d0c9e098692096f72d2158eef4776f",
2222
"authorization": {
2323
"is_authenticated": false,
2424
"scopes": [],

apollo-router/src/plugins/progressive_override/snapshots/apollo_router__plugins__progressive_override__tests__overridden_field_yields_expected_query_plan.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ expression: query_plan
2323
"id": null,
2424
"inputRewrites": null,
2525
"outputRewrites": null,
26-
"schemaAwareHash": "8f445761c0bcdda90b8da35ccd13fd98e474514f3efc071bd2c39495b5af94e5",
26+
"schemaAwareHash": "00ad582ea45fc1bce436b36b21512f3d2c47b74fdbdc61e4b349289722c9ecf2",
2727
"authorization": {
2828
"is_authenticated": false,
2929
"scopes": [],
@@ -61,7 +61,7 @@ expression: query_plan
6161
"id": null,
6262
"inputRewrites": null,
6363
"outputRewrites": null,
64-
"schemaAwareHash": "9a1feab7ee8c57c8a4ab4db29712412a9cfe94009bfcb40dc0d22ea54c410865",
64+
"schemaAwareHash": "a8ebdc2151a2e5207882e43c6906c0c64167fd9a8e0c7c4becc47736a5105096",
6565
"authorization": {
6666
"is_authenticated": false,
6767
"scopes": [],

apollo-router/src/plugins/snapshots/apollo_router__plugins__expose_query_plan__tests__it_expose_query_plan-2.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ expression: "serde_json::to_value(response).unwrap()"
6868
"id": null,
6969
"inputRewrites": null,
7070
"outputRewrites": null,
71-
"schemaAwareHash": "34be619a78867ab9d0670048f4c93574e38cd9253e9cc032f567078355b25086",
71+
"schemaAwareHash": "7245d488e97c3b2ac9f5fa4dd4660940b94ad81af070013305b2c0f76337b2f9",
7272
"authorization": {
7373
"is_authenticated": false,
7474
"scopes": [],
@@ -107,7 +107,7 @@ expression: "serde_json::to_value(response).unwrap()"
107107
"id": null,
108108
"inputRewrites": null,
109109
"outputRewrites": null,
110-
"schemaAwareHash": "f1582d942020b23347d84f6ae46c018492ae7c59c9b1472e0b442121ddf16368",
110+
"schemaAwareHash": "6e0b4156706ea0cf924500cfdc99dd44b9f0ed07e2d3f888d4aff156e6a33238",
111111
"authorization": {
112112
"is_authenticated": false,
113113
"scopes": [],
@@ -153,7 +153,7 @@ expression: "serde_json::to_value(response).unwrap()"
153153
"id": null,
154154
"inputRewrites": null,
155155
"outputRewrites": null,
156-
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
156+
"schemaAwareHash": "ff649f3d70241d5a8cd5f5d03ff4c41ecff72b0e4129a480207b05ac92318042",
157157
"authorization": {
158158
"is_authenticated": false,
159159
"scopes": [],
@@ -196,7 +196,7 @@ expression: "serde_json::to_value(response).unwrap()"
196196
"id": null,
197197
"inputRewrites": null,
198198
"outputRewrites": null,
199-
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
199+
"schemaAwareHash": "bf9f3beda78a7a565e47c862157bad4ec871d724d752218da1168455dddca074",
200200
"authorization": {
201201
"is_authenticated": false,
202202
"scopes": [],

apollo-router/src/plugins/snapshots/apollo_router__plugins__expose_query_plan__tests__it_expose_query_plan.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ expression: "serde_json::to_value(response).unwrap()"
6868
"id": null,
6969
"inputRewrites": null,
7070
"outputRewrites": null,
71-
"schemaAwareHash": "34be619a78867ab9d0670048f4c93574e38cd9253e9cc032f567078355b25086",
71+
"schemaAwareHash": "7245d488e97c3b2ac9f5fa4dd4660940b94ad81af070013305b2c0f76337b2f9",
7272
"authorization": {
7373
"is_authenticated": false,
7474
"scopes": [],
@@ -107,7 +107,7 @@ expression: "serde_json::to_value(response).unwrap()"
107107
"id": null,
108108
"inputRewrites": null,
109109
"outputRewrites": null,
110-
"schemaAwareHash": "f1582d942020b23347d84f6ae46c018492ae7c59c9b1472e0b442121ddf16368",
110+
"schemaAwareHash": "6e0b4156706ea0cf924500cfdc99dd44b9f0ed07e2d3f888d4aff156e6a33238",
111111
"authorization": {
112112
"is_authenticated": false,
113113
"scopes": [],
@@ -153,7 +153,7 @@ expression: "serde_json::to_value(response).unwrap()"
153153
"id": null,
154154
"inputRewrites": null,
155155
"outputRewrites": null,
156-
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
156+
"schemaAwareHash": "ff649f3d70241d5a8cd5f5d03ff4c41ecff72b0e4129a480207b05ac92318042",
157157
"authorization": {
158158
"is_authenticated": false,
159159
"scopes": [],
@@ -196,7 +196,7 @@ expression: "serde_json::to_value(response).unwrap()"
196196
"id": null,
197197
"inputRewrites": null,
198198
"outputRewrites": null,
199-
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
199+
"schemaAwareHash": "bf9f3beda78a7a565e47c862157bad4ec871d724d752218da1168455dddca074",
200200
"authorization": {
201201
"is_authenticated": false,
202202
"scopes": [],

apollo-router/src/plugins/telemetry/apollo_exporter.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -442,17 +442,3 @@ where
442442
None => serializer.serialize_none(),
443443
}
444444
}
445-
446-
#[cfg(not(windows))] // git checkout converts \n to \r\n, making == below fail
447-
#[test]
448-
fn check_reports_proto_is_up_to_date() {
449-
let proto_url = "https://usage-reporting.api.apollographql.com/proto/reports.proto";
450-
let response = reqwest::blocking::get(proto_url).unwrap();
451-
let content = response.text().unwrap();
452-
// Not using assert_eq! as printing the entire file would be too verbose
453-
assert!(
454-
content == include_str!("proto/reports.proto"),
455-
"Protobuf file is out of date. Run this command to update it:\n\n \
456-
curl -f {proto_url} > apollo-router/src/plugins/telemetry/proto/reports.proto\n\n"
457-
);
458-
}

apollo-router/src/plugins/telemetry/tracing/datadog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ lazy_static! {
2929
map.insert("request", "http.route");
3030
map.insert("supergraph", "graphql.operation.name");
3131
map.insert("query_planning", "graphql.operation.name");
32-
map.insert("subgraph", "apollo.subgraph.name");
32+
map.insert("subgraph", "subgraph.name");
3333
map.insert("subgraph_request", "graphql.operation.name");
3434
map
3535
};

apollo-router/src/query_planner/bridge_query_planner.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ impl BridgeQueryPlanner {
379379
.into_result()
380380
{
381381
Ok(mut plan) => {
382-
plan.data.query_plan.hash_subqueries(&self.subgraph_schemas);
382+
plan.data
383+
.query_plan
384+
.hash_subqueries(&self.subgraph_schemas, &self.schema.raw_sdl);
383385
plan.data
384386
.query_plan
385387
.extract_authorization_metadata(&self.schema.definitions, &key);
@@ -583,19 +585,22 @@ impl Service<QueryPlannerRequest> for BridgeQueryPlanner {
583585
Some(d) => d,
584586
};
585587

586-
let schema = &this.schema.api_schema().definitions;
587-
match add_defer_labels(schema, &doc.ast) {
588+
let api_schema = this.schema.api_schema();
589+
let api_schema_definitions = &api_schema.definitions;
590+
match add_defer_labels(api_schema_definitions, &doc.ast) {
588591
Err(e) => {
589592
return Err(QueryPlannerError::SpecError(SpecError::TransformError(
590593
e.to_string(),
591594
)))
592595
}
593596
Ok(modified_query) => {
594597
let executable_document = modified_query
595-
.to_executable_validate(schema)
598+
.to_executable_validate(api_schema_definitions)
599+
// Assume transformation creates a valid document: ignore conversion errors
596600
.map_err(|e| SpecError::ValidationError(e.into()))?;
597601
let hash = QueryHashVisitor::hash_query(
598-
schema,
602+
api_schema_definitions,
603+
&api_schema.raw_sdl,
599604
&executable_document,
600605
operation_name.as_deref(),
601606
)
@@ -715,6 +720,7 @@ impl BridgeQueryPlanner {
715720
.map_err(|e| SpecError::ValidationError(e.into()))?;
716721
let hash = QueryHashVisitor::hash_query(
717722
&self.schema.definitions,
723+
&self.schema.raw_sdl,
718724
&executable_document,
719725
key.operation_name.as_deref(),
720726
)
@@ -807,9 +813,13 @@ struct QueryPlan {
807813
}
808814

809815
impl QueryPlan {
810-
fn hash_subqueries(&mut self, schemas: &HashMap<String, Arc<Valid<apollo_compiler::Schema>>>) {
816+
fn hash_subqueries(
817+
&mut self,
818+
schemas: &HashMap<String, Arc<Valid<apollo_compiler::Schema>>>,
819+
supergraph_schema_hash: &str,
820+
) {
811821
if let Some(node) = self.node.as_mut() {
812-
node.hash_subqueries(schemas);
822+
node.hash_subqueries(schemas, supergraph_schema_hash);
813823
}
814824
}
815825

0 commit comments

Comments
 (0)