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

Update rust toolchain to 1.72.0 #3707

Merged
merged 7 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changesets/maint_igni_rust_1_72_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Update rust toolchain to 1.72.0 ([PR #3707](https://github.com/apollographql/router/pull/3707))

The router-bridge update now allows us to use the latest rust version.

By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/3707
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
default-members = ["apollo-router"]
members = [
"apollo-router",
Expand Down Expand Up @@ -40,4 +41,3 @@ incremental = false
[profile.release-dhat]
inherits = "release"
debug = 1

2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use the rust build image from docker as our base
# renovate-automation: rustc version
FROM rust:1.71.1 as build
FROM rust:1.72.0 as build

# Set our working directory for the build
WORKDIR /usr/src/router
Expand Down
2 changes: 1 addition & 1 deletion apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "A configurable, high-performance routing runtime for Apollo Feder
license = "Elastic-2.0"

# renovate-automation: rustc version
rust-version = "1.71.1"
rust-version = "1.72.0"
edition = "2021"
build = "build/main.rs"

Expand Down
2 changes: 1 addition & 1 deletion apollo-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Most Apollo Router features can be defined using our [YAML configuration](https:
If you prefer to write customizations in Rust or need more advanced customizations, see our section on [native customizations](https://www.apollographql.com/docs/router/customizations/native) for information on how to use `apollo-router` as a Rust library. We also publish Rust-specific documentation on our [`apollo-router` crate docs](https://docs.rs/crate/apollo-router).

<!-- renovate-automation: rustc version -->
The minimum supported Rust version (MSRV) for this version of `apollo-router` is **1.71.1**.
The minimum supported Rust version (MSRV) for this version of `apollo-router` is **1.72.0**.
2 changes: 1 addition & 1 deletion apollo-router/src/json_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl ValueExt for Value {
a_value.deep_merge(b_value);
}

a.extend(b.into_iter());
a.extend(b);
}
(_, Value::Null) => {}
(Value::Object(_), Value::Array(_)) => {
Expand Down
6 changes: 3 additions & 3 deletions apollo-router/src/plugins/authorization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl AuthorizationPlugin {
let compiler = match filter_res {
None => compiler,
Some((query, paths)) => {
unauthorized_paths.extend(paths.into_iter());
unauthorized_paths.extend(paths);

if query.is_empty() {
return Err(QueryPlannerError::Unauthorized(unauthorized_paths));
Expand All @@ -272,7 +272,7 @@ impl AuthorizationPlugin {
let compiler = match filter_res {
None => compiler,
Some((query, paths)) => {
unauthorized_paths.extend(paths.into_iter());
unauthorized_paths.extend(paths);

if query.is_empty() {
return Err(QueryPlannerError::Unauthorized(unauthorized_paths));
Expand All @@ -292,7 +292,7 @@ impl AuthorizationPlugin {
let compiler = match filter_res {
None => compiler,
Some((query, paths)) => {
unauthorized_paths.extend(paths.into_iter());
unauthorized_paths.extend(paths);

if query.is_empty() {
return Err(QueryPlannerError::Unauthorized(unauthorized_paths));
Expand Down
16 changes: 8 additions & 8 deletions apollo-router/src/plugins/coprocessor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ mod tests {
Box::pin(async {
Ok(hyper::Response::builder()
.body(Body::from(
r##"{
r#"{
"version": 1,
"stage": "SubgraphRequest",
"control": {
Expand All @@ -299,7 +299,7 @@ mod tests {
"body": "Errors need a message, this will fail to deserialize"
}]
}
}"##,
}"#,
))
.unwrap())
})
Expand Down Expand Up @@ -386,7 +386,7 @@ mod tests {
Box::pin(async {
Ok(hyper::Response::builder()
.body(Body::from(
r##"{
r#"{
"version": 1,
"stage": "SubgraphRequest",
"control": "continue",
Expand Down Expand Up @@ -429,7 +429,7 @@ mod tests {
},
"serviceName": "service name shouldn't change",
"uri": "http://thisurihaschanged"
}"##,
}"#,
))
.unwrap())
})
Expand Down Expand Up @@ -478,7 +478,7 @@ mod tests {
Box::pin(async {
Ok(hyper::Response::builder()
.body(Body::from(
r##"{
r#"{
"version": 1,
"stage": "SubgraphRequest",
"control": {
Expand All @@ -495,7 +495,7 @@ mod tests {
"headers": {
"aheader": ["a value"]
}
}"##,
}"#,
))
.unwrap())
})
Expand Down Expand Up @@ -556,7 +556,7 @@ mod tests {
Box::pin(async {
Ok(hyper::Response::builder()
.body(Body::from(
r##"{
r#"{
"version": 1,
"stage": "SubgraphResponse",
"headers": {
Expand Down Expand Up @@ -598,7 +598,7 @@ mod tests {
"this-is-a-test-context": 42
}
}
}"##,
}"#,
))
.unwrap())
})
Expand Down
6 changes: 3 additions & 3 deletions apollo-router/src/query_planner/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl DeferredNode {
let (primary_value, primary_errors) =
primary_receiver.recv().await.unwrap_or_default();
value.deep_merge(primary_value);
errors.extend(primary_errors.into_iter())
errors.extend(primary_errors)
} else {
while let Some((v, _remaining)) = stream.next().await {
// a Err(RecvError) means either that the fetch was not performed and the
Expand Down Expand Up @@ -486,7 +486,7 @@ impl DeferredNode {
let (primary_value, primary_errors) =
primary_receiver.recv().await.unwrap_or_default();
v.deep_merge(primary_value);
errors.extend(primary_errors.into_iter())
errors.extend(primary_errors)
}

if let Err(e) = tx
Expand All @@ -511,7 +511,7 @@ impl DeferredNode {
let (primary_value, primary_errors) =
primary_receiver.recv().await.unwrap_or_default();
value.deep_merge(primary_value);
errors.extend(primary_errors.into_iter());
errors.extend(primary_errors);

if let Err(e) = tx
.send(
Expand Down
5 changes: 3 additions & 2 deletions apollo-router/src/query_planner/labeler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ impl<'a> Visitor for Labeler<'a> {
) -> Result<Option<apollo_encoder::InlineFragment>, BoxError> {
let parent_type = hir.type_condition().unwrap_or(parent_type);

let Some(selection_set) = selection_set(self, hir.selection_set(), parent_type)?
else { return Ok(None) };
let Some(selection_set) = selection_set(self, hir.selection_set(), parent_type)? else {
return Ok(None);
};

let mut encoder_node = apollo_encoder::InlineFragment::new(selection_set);

Expand Down
2 changes: 1 addition & 1 deletion apollo-router/src/query_planner/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl PlanNode {
Self::Subscription { primary, rest } => match rest {
Some(rest) => Box::new(
rest.service_usage()
.chain(Some(primary.service_name.as_str()).into_iter()),
.chain(Some(primary.service_name.as_str())),
) as Box<dyn Iterator<Item = &'a str> + 'a>,
None => Box::new(Some(primary.service_name.as_str()).into_iter()),
},
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/services/execution_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ impl ExecutionService {
schema.api_schema(),
variables_set,
)
.into_iter(),
,
);
nullified_paths.extend(paths.into_iter());
nullified_paths.extend(paths);
});

match (response.path.as_ref(), response.data.as_ref()) {
Expand Down
5 changes: 2 additions & 3 deletions apollo-router/src/spec/operation_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ pub(crate) fn check(
debug_assert_eq!(ids.len(), 1);
let query_id = ids[0];

let Some(operation) = compiler.db.find_operation(query_id, operation_name.clone())
else {
let Some(operation) = compiler.db.find_operation(query_id, operation_name.clone()) else {
// Undefined or ambiguous operation name.
// The request is invalid and will be rejected by some other part of the router,
// if it wasn’t already before we got to this code path.
return Ok(())
return Ok(());
};

let mut fragment_cache = HashMap::new();
Expand Down
15 changes: 9 additions & 6 deletions apollo-router/src/spec/query/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ pub(crate) fn operation(
.ok_or("ObjectTypeDefMissing")?;
let type_name = object_type.name();

let Some(selection_set) = selection_set(visitor, def.selection_set(), type_name)?
else { return Ok(None) };
let Some(selection_set) = selection_set(visitor, def.selection_set(), type_name)? else {
return Ok(None);
};

let mut encoder_node =
apollo_encoder::OperationDefinition::new(operation_type(def.operation_ty()), selection_set);
Expand Down Expand Up @@ -151,8 +152,9 @@ pub(crate) fn fragment_definition(
let name = hir.name();
let type_condition = hir.type_condition();

let Some(selection_set) = selection_set(visitor, hir.selection_set(), type_condition)?
else { return Ok(None) };
let Some(selection_set) = selection_set(visitor, hir.selection_set(), type_condition)? else {
return Ok(None);
};

let type_condition = apollo_encoder::TypeCondition::new(type_condition.into());
let mut encoder_node =
Expand Down Expand Up @@ -237,8 +239,9 @@ pub(crate) fn inline_fragment(
) -> Result<Option<apollo_encoder::InlineFragment>, BoxError> {
let parent_type = hir.type_condition().unwrap_or(parent_type);

let Some(selection_set) = selection_set(visitor, hir.selection_set(), parent_type)?
else { return Ok(None) };
let Some(selection_set) = selection_set(visitor, hir.selection_set(), parent_type)? else {
return Ok(None);
};

let mut encoder_node = apollo_encoder::InlineFragment::new(selection_set);

Expand Down
2 changes: 1 addition & 1 deletion apollo-router/src/uplink/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub enum Endpoints {
impl Default for Endpoints {
fn default() -> Self {
Self::fallback(
vec![GCP_URL, AWS_URL]
[GCP_URL, AWS_URL]
.iter()
.map(|url| Url::parse(url).expect("default urls must be valid"))
.collect(),
Expand Down
2 changes: 1 addition & 1 deletion docs/source/customizations/custom-binary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ElasticNotice from '../../shared/elastic-notice.mdx';
To compile the Apollo Router, you need to have the following installed:

<!-- renovate-automation: rustc version -->
* [Rust 1.71.1 or later](https://www.rust-lang.org/tools/install)
* [Rust 1.72.0 or later](https://www.rust-lang.org/tools/install)
* [Node.js 16.9.1 or later](https://nodejs.org/en/download/)
* [CMake 3.5.1 or later](https://cmake.org/download/)

Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
# renovate-automation: rustc version
channel = "1.71.1"
components = [ "rustfmt", "clippy" ]
channel = "1.72.0"
components = ["rustfmt", "clippy"]