Skip to content

Commit

Permalink
release: v1.13.2 (#2898)
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored Apr 3, 2023
2 parents f65ea72 + 53b0059 commit 6a750b2
Show file tree
Hide file tree
Showing 44 changed files with 492 additions and 343 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ 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.13.2] - 2023-04-03

## 🐛 Fixes

### Replace the old query planner with the incoming query planner on reload

We've fixed an important regression in v1.13.1 (introduced by [PR #2706](https://github.com/apollographql/router/pull/2706)) which resulted in Routers failing to update to newer supergraphs unless they were fully restarted; hot-reloads of the supergraph did not work properly. This affects all v1.13.1 versions, whether the supergraph was delivered from a local file or if delivered as part of Managed Federation through Apollo Uplink.

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

# [1.13.1] - 2023-03-28

## 🚀 Features
Expand Down
42 changes: 34 additions & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,25 @@ version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"

[[package]]
name = "apollo-ariadne"
version = "0.2.0-alpha.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d0599491753b640c75cdaefc2cb1c9b9ba5787a461cb7c821f37e9e6694f0a"
dependencies = [
"unicode-width",
"yansi",
]

[[package]]
name = "apollo-compiler"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e04b7fcd8b65c7c62d317bee4b83a53699033c1fed2ca2757d80b81f2295160d"
checksum = "fecbe4f00b1baeb4dfe40eb54e8e3831057086296e68217e4f7a246569abebac"
dependencies = [
"apollo-parser 0.4.1",
"apollo-ariadne",
"apollo-parser 0.5.0",
"indexmap",
"miette",
"ordered-float 2.10.0",
"rowan",
"salsa",
Expand Down Expand Up @@ -210,15 +220,25 @@ dependencies = [
"thiserror",
]

[[package]]
name = "apollo-parser"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bde1ede19cfd36f4ebdce836fd571a1791e08b634f6d63648203e885b8fba9f4"
dependencies = [
"rowan",
"thiserror",
]

[[package]]
name = "apollo-router"
version = "1.13.1"
version = "1.13.2"
dependencies = [
"access-json",
"ansi_term",
"anyhow",
"apollo-compiler",
"apollo-parser 0.4.1",
"apollo-parser 0.5.0",
"arc-swap",
"askama",
"async-compression",
Expand Down Expand Up @@ -345,7 +365,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.13.1"
version = "1.13.2"
dependencies = [
"apollo-parser 0.4.1",
"apollo-router",
Expand All @@ -361,7 +381,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.13.1"
version = "1.13.2"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down Expand Up @@ -6795,6 +6815,12 @@ dependencies = [
"linked-hash-map",
]

[[package]]
name = "yansi"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"

[[package]]
name = "zeroize"
version = "1.5.7"
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.13.1"
version = "1.13.2"
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.13.1"
version = "1.13.2"
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.13.1"
apollo-router = "1.13.2"
{{/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.13.1" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.13.2" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
6 changes: 3 additions & 3 deletions apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.13.1"
version = "1.13.2"
authors = ["Apollo Graph, Inc. <packages@apollographql.com>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down Expand Up @@ -41,8 +41,8 @@ askama = "0.11.1"
access-json = "0.1.0"
anyhow = "1.0.68"
ansi_term = "0.12"
apollo-compiler = "0.6.0"
apollo-parser = "0.4.1"
apollo-compiler = "0.7.0"
apollo-parser = "0.5.0"
arc-swap = "1.6.0"
async-compression = { version = "0.3.15", features = [
"tokio",
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/build/studio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub fn main() -> Result<(), Box<dyn Error>> {
let message = "\nmessage";
let msg_index = content.find(message).ok_or("cannot find message string")?;
content.insert_str(msg_index, "\npackage Reports;\n");
content = content.replace("[(js_use_toArray)=true]", "");
content = content.replace("[(js_preEncoded)=true]", "");
content = content.replace("[(js_use_toArray) = true]", "");
content = content.replace("[(js_preEncoded) = true]", "");
std::fs::write(&reports_out, &content)?;

println!("cargo:rerun-if-changed={}", reports_src.to_str().unwrap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ expression: aggregated_metrics
[
{
"client_name": "client_1",
"client_version": "version_1"
"client_version": "version_1",
"operation_type": "",
"operation_subtype": ""
},
{
"context": {
"client_name": "client_1",
"client_version": "version_1"
"client_version": "version_1",
"operation_type": "",
"operation_subtype": ""
},
"query_latency_stats": {
"request_latencies": {
Expand Down
2 changes: 2 additions & 0 deletions apollo-router/src/plugins/telemetry/metrics/apollo/studio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ mod test {
context: StatsContext {
client_name: client_name.to_string(),
client_version: client_version.to_string(),
operation_type: String::new(),
operation_subtype: String::new(),
},
query_latency_stats: SingleQueryLatencyStats {
latency: Duration::from_secs(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ expression: results
"stats_with_context": {
"context": {
"client_name": "test_client",
"client_version": "1.0-test"
"client_version": "1.0-test",
"operation_type": "",
"operation_subtype": ""
},
"query_latency_stats": {
"latency": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ expression: results
"stats_with_context": {
"context": {
"client_name": "test_client",
"client_version": "1.0-test"
"client_version": "1.0-test",
"operation_type": "",
"operation_subtype": ""
},
"query_latency_stats": {
"latency": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ expression: results
"stats_with_context": {
"context": {
"client_name": "test_client",
"client_version": "1.0-test"
"client_version": "1.0-test",
"operation_type": "",
"operation_subtype": ""
},
"query_latency_stats": {
"latency": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ expression: results
"stats_with_context": {
"context": {
"client_name": "test_client",
"client_version": "1.0-test"
"client_version": "1.0-test",
"operation_type": "",
"operation_subtype": ""
},
"query_latency_stats": {
"latency": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ expression: results
"stats_with_context": {
"context": {
"client_name": "test_client",
"client_version": "1.0-test"
"client_version": "1.0-test",
"operation_type": "",
"operation_subtype": ""
},
"query_latency_stats": {
"latency": {
Expand Down
3 changes: 3 additions & 0 deletions apollo-router/src/plugins/telemetry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,9 @@ impl Telemetry {
.get(CLIENT_VERSION)
.unwrap_or_default()
.unwrap_or_default(),
// FIXME
operation_type: String::new(),
operation_subtype: String::new(),
},
query_latency_stats: SingleQueryLatencyStats {
latency: duration,
Expand Down
34 changes: 25 additions & 9 deletions apollo-router/src/plugins/telemetry/proto/reports.proto
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ message Trace {
string client_name = 7;
string client_version = 8;

string operation_type = 35;
string operation_subtype = 36;

// optional: this is populated from the report header when storing trace data, and it is not
// expected to be specified in the report's version of a trace
string agent_version = 34;
Expand Down Expand Up @@ -284,7 +287,7 @@ message Trace {

// removed: Node parse = 12; Node validate = 13;
// Id128 server_id = 1; Id128 client_id = 2;
// String client_reference_id = 23; String client_address = 9;
// String client_reference_id = 23; String client_address = 9;
reserved 1, 2, 9, 12, 13, 23;
}

Expand Down Expand Up @@ -325,16 +328,16 @@ message PathErrorStats {
}

message QueryLatencyStats {
repeated sint64 latency_count = 13 [(js_use_toArray)=true];
repeated sint64 latency_count = 13 [(js_use_toArray) = true];
uint64 request_count = 2;
uint64 cache_hits = 3;
uint64 persisted_query_hits = 4;
uint64 persisted_query_misses = 5;
repeated sint64 cache_latency_count = 14 [(js_use_toArray)=true];
repeated sint64 cache_latency_count = 14 [(js_use_toArray) = true];
PathErrorStats root_error_stats = 7;
uint64 requests_with_errors_count = 8;
repeated sint64 public_cache_ttl_count = 15 [(js_use_toArray)=true];
repeated sint64 private_cache_ttl_count = 16 [(js_use_toArray)=true];
repeated sint64 public_cache_ttl_count = 15 [(js_use_toArray) = true];
repeated sint64 private_cache_ttl_count = 16 [(js_use_toArray) = true];
uint64 registered_operation_count = 11;
uint64 forbidden_operation_count = 12;
// The number of requests that were executed without field-level
Expand All @@ -350,6 +353,8 @@ message StatsContext {
reserved 1;
string client_name = 2;
string client_version = 3;
string operation_type = 4;
string operation_subtype = 5;
}

message ContextualizedQueryLatencyStats {
Expand Down Expand Up @@ -392,7 +397,7 @@ message FieldStat {
// the same way as estimated_execution_count so its "total count" might be
// greater than `observed_execution_count` and may not exactly equal
// `estimated_execution_count` due to rounding.
repeated sint64 latency_count = 9 [(js_use_toArray)=true];
repeated sint64 latency_count = 9 [(js_use_toArray) = true];
reserved 1, 2, 7, 8;
}

Expand Down Expand Up @@ -420,6 +425,12 @@ message ReferencedFieldsForType {
// size has been reached (say, 4MB) or 5-10 seconds has passed is appropriate.
// This message used to be know as FullTracesReport, but got renamed since it isn't just for traces anymore
message Report {
message OperationCountByType {
string type = 1;
string subtype = 2;
uint64 operation_count = 3;
}

ReportHeader header = 1;

// key is statsReportKey (# operationName\nsignature) Note that the nested
Expand All @@ -441,6 +452,11 @@ message Report {
// Total number of operations processed during this period.
uint64 operation_count = 6;

// Total number of operations broken up by operation type and operation subtype.
// Only either this or operation_count should be populated, but if both are present, the total across all types and
// subtypes should match the overall operation_count.
repeated OperationCountByType operation_count_by_type = 8;

// If this is set to true, the stats in TracesWithStats.stats_with_context
// represent all of the operations described from this report, and the
// traces in TracesWithStats.trace are a sampling of some of the same
Expand All @@ -464,8 +480,8 @@ message ContextualizedStats {
// is true, then all operations are described as stats and some are also
// described as traces.
message TracesAndStats {
repeated Trace trace = 1 [(js_preEncoded)=true];
repeated ContextualizedStats stats_with_context = 2 [(js_use_toArray)=true];
repeated Trace trace = 1 [(js_preEncoded) = true];
repeated ContextualizedStats stats_with_context = 2 [(js_use_toArray) = true];
// This describes the fields referenced in the operation. Note that this may
// include fields that don't show up in FieldStats (due to being interface fields,
// being nested under null fields or empty lists or non-matching fragments or
Expand All @@ -476,5 +492,5 @@ message TracesAndStats {
// This field is used to validate that the algorithm used to construct `stats_with_context`
// matches similar algorithms in Apollo's servers. It is otherwise ignored and should not
// be included in reports.
repeated Trace internal_traces_contributing_to_stats = 3 [(js_preEncoded)=true];
repeated Trace internal_traces_contributing_to_stats = 3 [(js_preEncoded) = true];
}
24 changes: 13 additions & 11 deletions apollo-router/src/query_planner/bridge_query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,22 @@ impl BridgeQueryPlanner {
}

pub(crate) async fn new_from_planner(
planner: Arc<Planner<QueryPlanResult>>,
old_planner: Arc<Planner<QueryPlanResult>>,
schema: String,
configuration: Arc<Configuration>,
) -> Result<Self, ServiceBuildError> {
planner
.update(
schema.clone(),
QueryPlannerConfig {
incremental_delivery: Some(IncrementalDeliverySupport {
enable_defer: Some(configuration.supergraph.defer_support),
}),
},
)
.await?;
let planner = Arc::new(
old_planner
.update(
schema.clone(),
QueryPlannerConfig {
incremental_delivery: Some(IncrementalDeliverySupport {
enable_defer: Some(configuration.supergraph.defer_support),
}),
},
)
.await?,
);

let api_schema = planner.api_schema().await?;
let api_schema = Schema::parse(&api_schema.schema, &configuration, None)?;
Expand Down
Loading

0 comments on commit 6a750b2

Please sign in to comment.