Skip to content

Commit

Permalink
release: v1.45.1 (#5009)
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix committed Apr 26, 2024
1 parent eb02494 commit ff9f666
Show file tree
Hide file tree
Showing 30 changed files with 388 additions and 385 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Expand Up @@ -48,14 +48,14 @@ executors:
# 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
xcode: "14.2.0"
resource_class: macos.m1.medium.gen1
macos_test: &macos_test_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
xcode: "14.2.0"
resource_class: macos.m1.medium.gen1
windows_build: &windows_build_executor
machine:
Expand Down Expand Up @@ -201,7 +201,7 @@ commands:
find xtask/src -type f | while read name; do md5sum $name; done | sort -k 2 | md5sum > ~/.xtask_version
# The closest common ancestor to the default branch, so that test jobs can take advantage previous compiles
git remote set-head origin -a
TARGET_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD)
TARGET_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD)
echo "Target branch is ${TARGET_BRANCH}"
COMMON_ANCESTOR_REF=$(git merge-base HEAD "${TARGET_BRANCH}")
echo "Common ancestor is ${COMMON_ANCESTOR_REF}"
Expand Down Expand Up @@ -715,8 +715,8 @@ jobs:
# save containers for analysis
mkdir built-containers
docker save -o built-containers/router_${VERSION}-debug.tar ${ROUTER_TAG}:${VERSION}-debug
docker save -o built-containers/router_${VERSION}.tar ${ROUTER_TAG}:${VERSION}
docker save -o built-containers/router_${VERSION}.tar ${ROUTER_TAG}:${VERSION}
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -971,8 +971,8 @@ workflows:
# Disables all PR comments from this job
do-pr-comments: false
# Scan job will return 1 if findings violating the Wiz policy are found.
# Toggle off to prevent any CI failures OR
# contact Apollo's Security team to adjust what violates the
# Toggle off to prevent any CI failures OR
# contact Apollo's Security team to adjust what violates the
# Wiz policy used in this scan.
fail-on-findings: true
# Configure scan job to use a policy specific to apollo-router.
Expand Down Expand Up @@ -1069,7 +1069,7 @@ workflows:
ignore: /.*/
tags:
only: /v.*/

security-scans:
when:
not: << pipeline.parameters.nightly >>
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,8 +4,37 @@ 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.45.1] - 2024-04-26

## 馃悰 Fixes

### Correct v1.44.0 regression in query plan cache ([PR #5028](https://github.com/apollographql/router/pull/5028))

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.

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

### Use entire schema when hashing an introspection query ([Issue #5006](https://github.com/apollographql/router/issues/5006))

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.

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.

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

### Fix subgraph name mapping of Datadog exporter ([PR #5012](https://github.com/apollographql/router/pull/5012))

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.

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


# [1.45.0] - 2024-04-22

> **Warning**
>
> **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.**

## 馃殌 Features

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

# [1.44.0] - 2024-04-12

> **Warning**
>
> **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.**


## 馃殌 Features

### Add details to `router service call failed` errors ([Issue #4899](https://github.com/apollographql/router/issues/4899))
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock
Expand Up @@ -250,7 +250,7 @@ dependencies = [

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

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

[[package]]
name = "apollo-router-scaffold"
version = "1.45.0"
version = "1.45.1"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-benchmarks/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-benchmarks"
version = "1.45.0"
version = "1.45.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
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-scaffold"
version = "1.45.0"
version = "1.45.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
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.45.0"
apollo-router = "1.45.1"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/xtask/Cargo.toml
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.45.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.45.1" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.45.0"
version = "1.45.1"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down
Expand Up @@ -18,7 +18,7 @@ expression: query_plan
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "9358047754b11522aac502a3c6a668cd4286c07d489680834e63d6e033db4eb5",
"schemaAwareHash": "12dda6193654ae4fe6e38bc09d4f81cc73d0c9e098692096f72d2158eef4776f",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Expand Up @@ -23,7 +23,7 @@ expression: query_plan
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "8f445761c0bcdda90b8da35ccd13fd98e474514f3efc071bd2c39495b5af94e5",
"schemaAwareHash": "00ad582ea45fc1bce436b36b21512f3d2c47b74fdbdc61e4b349289722c9ecf2",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -61,7 +61,7 @@ expression: query_plan
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "9a1feab7ee8c57c8a4ab4db29712412a9cfe94009bfcb40dc0d22ea54c410865",
"schemaAwareHash": "a8ebdc2151a2e5207882e43c6906c0c64167fd9a8e0c7c4becc47736a5105096",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Expand Up @@ -68,7 +68,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "34be619a78867ab9d0670048f4c93574e38cd9253e9cc032f567078355b25086",
"schemaAwareHash": "7245d488e97c3b2ac9f5fa4dd4660940b94ad81af070013305b2c0f76337b2f9",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -107,7 +107,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "f1582d942020b23347d84f6ae46c018492ae7c59c9b1472e0b442121ddf16368",
"schemaAwareHash": "6e0b4156706ea0cf924500cfdc99dd44b9f0ed07e2d3f888d4aff156e6a33238",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -153,7 +153,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
"schemaAwareHash": "ff649f3d70241d5a8cd5f5d03ff4c41ecff72b0e4129a480207b05ac92318042",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -196,7 +196,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
"schemaAwareHash": "bf9f3beda78a7a565e47c862157bad4ec871d724d752218da1168455dddca074",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
Expand Up @@ -68,7 +68,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "34be619a78867ab9d0670048f4c93574e38cd9253e9cc032f567078355b25086",
"schemaAwareHash": "7245d488e97c3b2ac9f5fa4dd4660940b94ad81af070013305b2c0f76337b2f9",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -107,7 +107,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "f1582d942020b23347d84f6ae46c018492ae7c59c9b1472e0b442121ddf16368",
"schemaAwareHash": "6e0b4156706ea0cf924500cfdc99dd44b9f0ed07e2d3f888d4aff156e6a33238",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -153,7 +153,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
"schemaAwareHash": "ff649f3d70241d5a8cd5f5d03ff4c41ecff72b0e4129a480207b05ac92318042",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down Expand Up @@ -196,7 +196,7 @@ expression: "serde_json::to_value(response).unwrap()"
"id": null,
"inputRewrites": null,
"outputRewrites": null,
"schemaAwareHash": "6fa5a74c5af2b18f343e9e69bbcbc9335e9faaa46c3d8964d199002dfeb0026f",
"schemaAwareHash": "bf9f3beda78a7a565e47c862157bad4ec871d724d752218da1168455dddca074",
"authorization": {
"is_authenticated": false,
"scopes": [],
Expand Down
14 changes: 0 additions & 14 deletions apollo-router/src/plugins/telemetry/apollo_exporter.rs
Expand Up @@ -442,17 +442,3 @@ where
None => serializer.serialize_none(),
}
}

#[cfg(not(windows))] // git checkout converts \n to \r\n, making == below fail
#[test]
fn check_reports_proto_is_up_to_date() {
let proto_url = "https://usage-reporting.api.apollographql.com/proto/reports.proto";
let response = reqwest::blocking::get(proto_url).unwrap();
let content = response.text().unwrap();
// Not using assert_eq! as printing the entire file would be too verbose
assert!(
content == include_str!("proto/reports.proto"),
"Protobuf file is out of date. Run this command to update it:\n\n \
curl -f {proto_url} > apollo-router/src/plugins/telemetry/proto/reports.proto\n\n"
);
}
2 changes: 1 addition & 1 deletion apollo-router/src/plugins/telemetry/tracing/datadog.rs
Expand Up @@ -29,7 +29,7 @@ lazy_static! {
map.insert("request", "http.route");
map.insert("supergraph", "graphql.operation.name");
map.insert("query_planning", "graphql.operation.name");
map.insert("subgraph", "apollo.subgraph.name");
map.insert("subgraph", "subgraph.name");
map.insert("subgraph_request", "graphql.operation.name");
map
};
Expand Down
24 changes: 17 additions & 7 deletions apollo-router/src/query_planner/bridge_query_planner.rs
Expand Up @@ -379,7 +379,9 @@ impl BridgeQueryPlanner {
.into_result()
{
Ok(mut plan) => {
plan.data.query_plan.hash_subqueries(&self.subgraph_schemas);
plan.data
.query_plan
.hash_subqueries(&self.subgraph_schemas, &self.schema.raw_sdl);
plan.data
.query_plan
.extract_authorization_metadata(&self.schema.definitions, &key);
Expand Down Expand Up @@ -583,19 +585,22 @@ impl Service<QueryPlannerRequest> for BridgeQueryPlanner {
Some(d) => d,
};

let schema = &this.schema.api_schema().definitions;
match add_defer_labels(schema, &doc.ast) {
let api_schema = this.schema.api_schema();
let api_schema_definitions = &api_schema.definitions;
match add_defer_labels(api_schema_definitions, &doc.ast) {
Err(e) => {
return Err(QueryPlannerError::SpecError(SpecError::TransformError(
e.to_string(),
)))
}
Ok(modified_query) => {
let executable_document = modified_query
.to_executable_validate(schema)
.to_executable_validate(api_schema_definitions)
// Assume transformation creates a valid document: ignore conversion errors
.map_err(|e| SpecError::ValidationError(e.into()))?;
let hash = QueryHashVisitor::hash_query(
schema,
api_schema_definitions,
&api_schema.raw_sdl,
&executable_document,
operation_name.as_deref(),
)
Expand Down Expand Up @@ -715,6 +720,7 @@ impl BridgeQueryPlanner {
.map_err(|e| SpecError::ValidationError(e.into()))?;
let hash = QueryHashVisitor::hash_query(
&self.schema.definitions,
&self.schema.raw_sdl,
&executable_document,
key.operation_name.as_deref(),
)
Expand Down Expand Up @@ -807,9 +813,13 @@ struct QueryPlan {
}

impl QueryPlan {
fn hash_subqueries(&mut self, schemas: &HashMap<String, Arc<Valid<apollo_compiler::Schema>>>) {
fn hash_subqueries(
&mut self,
schemas: &HashMap<String, Arc<Valid<apollo_compiler::Schema>>>,
supergraph_schema_hash: &str,
) {
if let Some(node) = self.node.as_mut() {
node.hash_subqueries(schemas);
node.hash_subqueries(schemas, supergraph_schema_hash);
}
}

Expand Down

0 comments on commit ff9f666

Please sign in to comment.