diff --git a/.circleci/config.yml b/.circleci/config.yml index 376554a0cc..87dc5199fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ parameters: cache_version: type: string # increment that one to invalidate all the caches - default: v5 + default: v6 commands: initialize_submodules: diff --git a/.tool-versions b/.tool-versions index 3c3d695c68..df4dadaeb0 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -rust 1.58.1 +rust 1.59.0 nodejs 16.9.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index fc468425ea..b47070b0d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,38 +16,38 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - **Headline** via [#PR_NUMBER](https://github.com/apollographql/router/pull/PR_NUMBER) - Description! And a link to a [reference] - - [reference]: http://link + Description! And a link to a [reference](http://url) --> -# Upcoming - -> Not yet in a release! +# [v0.1.0-alpha.7] 2022-02-25 ## :sparkles: Features -- **Apollo Studio Explorer landing page** ([PR #526](https://github.com/apollographql/router/pull/526) +- **Apollo Studio Explorer landing page** ([PR #526](https://github.com/apollographql/router/pull/526)) We've replaced the _redirect_ to Apollo Studio with a statically rendered landing page. This supersedes the previous redirect approach was merely introduced as a short-cut. The experience now duplicates the user-experience which exists in Apollo Gateway today. + It is also possible to _save_ the redirect preference and make the behavior sticky for future visits. As a bonus, this also resolves the failure to preserve the correct HTTP scheme (e.g., `https://`) in the event that the Apollo Router was operating behind a TLS-terminating proxy, since the redirect is now handled client-side. + + Overall, this should be a more durable and more transparent experience for the user. + - **Display Apollo Router version on startup** ([PR #543](https://github.com/apollographql/router/pull/543)) The Apollo Router displays its version on startup from now on, which will come in handy when debugging/observing how your application behaves. ## :bug: Fixes - It is also possible to _save_ the redirect preference and make the behavior sticky for future visits. As a bonus, this also resolves the failure to preserve the correct HTTP scheme (e.g., `https://`) in the event that the Apollo Router was operating behind a TLS-terminating proxy, since the redirect is now handled client-side. +- **Passing a `--supergraph` file supersedes Managed Federation** ([PR #535](https://github.com/apollographql/router/pull/535)) - Overall, this should be a more durable and more transparent experience for the user. + The `--supergraph` flag will no longer be silently ignored when the Supergraph is already being provided through [Managed Federation](https://www.apollographql.com/docs/federation/managed-federation/overview) (i.e., when the `APOLLO_KEY` and `APOLLO_GRAPH_REF` environment variables are set). This allows temporarily overriding the Supergraph schema that is fetched from Apollo Studio's Uplink endpoint, while still reporting metrics to Apollo Studio reporting ingress. -- **Anonymous operation names are now empty in tracing** ([PR #525](https://github.com/apollograpqhl/router/pull/525)) +- **Anonymous operation names are now empty in tracing** ([PR #525](https://github.com/apollographql/router/pull/525)) - When GraphQL operation names are not nececessary to execute an operation (i.e., when there is only a single operation in a GraphQL document) and the GraphQL operation is _not_ named (i.e., it is anonymous), the `operation_name` attribute on the trace spans that are associated with the request will no longer contain a single hyphen character (`-`) but will instead be an empty string. This matches the way that these operations are represented during the GraphQL operation's life-cycle as well. + When GraphQL operation names are not necessary to execute an operation (i.e., when there is only a single operation in a GraphQL document) and the GraphQL operation is _not_ named (i.e., it is anonymous), the `operation_name` attribute on the trace spans that are associated with the request will no longer contain a single hyphen character (`-`) but will instead be an empty string. This matches the way that these operations are represented during the GraphQL operation's life-cycle as well. -- **Resolved case of missing documentation in Apollo Studio Explorer** ([PR #540](https://github.com/apollographql/router/pull/540)) +- **Resolved missing documentation in Apollo Explorer** ([PR #540](https://github.com/apollographql/router/pull/540)) - We've resolved a scenario that prevented Apollo Studio Explorer from displaying documentation by adding support for a new introspection query which also queries for deprecation (i.e., `includeDeprecated`) on `input` arguments. + We've resolved a scenario that prevented Apollo Explorer from displaying documentation by adding support for a new introspection query which also queries for deprecation (i.e., `includeDeprecated`) on `input` arguments. # [v0.1.0-alpha.6] 2022-02-18 @@ -55,11 +55,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - **Apollo Studio Managed Federation support** ([PR #498](https://github.com/apollographql/router/pull/498)) + [Managed Federation]: https://www.apollographql.com/docs/federation/managed-federation/overview/ + The Router can now automatically download and check for updates on its schema from Studio (via [Uplink])'s free, [Managed Federation] service. This is configured in the same way as Apollo Gateway via the `APOLLO_KEY` and `APOLLO_GRAPH_REF` environment variables, in the same way as was true in Apollo Gateway ([seen here](https://www.apollographql.com/docs/federation/managed-federation/setup/#4-connect-the-gateway-to-studio)). This will also enable operation usage reporting. > **Note:** It is not yet possible to configure the Router with [`APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT`]. If you need this behavior, please open a feature request with your use case. - [Managed Federation]: https://www.apollographql.com/docs/federation/managed-federation/overview/ [`APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT`]: https://www.apollographql.com/docs/federation/managed-federation/uplink/#environment-variable [Uplink]: https://www.apollographql.com/docs/federation/managed-federation/uplink/ [operation usage reporting]: https://www.apollographql.com/docs/studio/metrics/usage-reporting/#pushing-metrics-from-apollo-server diff --git a/Cargo.lock b/Cargo.lock index 2eb2d56a8d..54b302fe25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,7 +86,7 @@ dependencies = [ [[package]] name = "apollo-router" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" dependencies = [ "anyhow", "apollo-parser 0.2.2", @@ -147,7 +147,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" dependencies = [ "apollo-router", "apollo-router-core", @@ -163,7 +163,7 @@ dependencies = [ [[package]] name = "apollo-router-core" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" dependencies = [ "apollo-parser 0.2.3", "async-trait", @@ -207,7 +207,7 @@ dependencies = [ [[package]] name = "apollo-spaceport" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" dependencies = [ "bytes", "clap 3.1.2", @@ -4804,7 +4804,7 @@ dependencies = [ [[package]] name = "xtask" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" dependencies = [ "ansi_term", "anyhow", diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index fc5f8e7046..ea35b3bcca 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "LicenseRef-ELv2" diff --git a/apollo-router-core/Cargo.toml b/apollo-router-core/Cargo.toml index 85aacd2068..ffaf8b06c2 100644 --- a/apollo-router-core/Cargo.toml +++ b/apollo-router-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-core" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" authors = ["Apollo Graph, Inc. "] edition = "2021" license-file = "./LICENSE" diff --git a/apollo-router-core/src/layers/headers.rs b/apollo-router-core/src/layers/headers.rs index 6877a9f62a..2ca64fd00c 100644 --- a/apollo-router-core/src/layers/headers.rs +++ b/apollo-router-core/src/layers/headers.rs @@ -266,7 +266,7 @@ where let headers = req.http_request.headers_mut(); if let Some(name) = &self.name { let value = req.context.request.headers().get(name); - if let Some(value) = value.or_else(|| self.default_value.as_ref()) { + if let Some(value) = value.or(self.default_value.as_ref()) { headers.insert(self.rename.as_ref().unwrap_or(name), value.clone()); } } else if let Some(regex) = &self.regex { diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 6a82977790..4cb5f782d6 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" authors = ["Apollo Graph, Inc. "] edition = "2021" license-file = "./LICENSE" diff --git a/apollo-router/src/configuration/otlp/grpc.rs b/apollo-router/src/configuration/otlp/grpc.rs index 310d86ec7d..ce08d8ef7b 100644 --- a/apollo-router/src/configuration/otlp/grpc.rs +++ b/apollo-router/src/configuration/otlp/grpc.rs @@ -57,7 +57,7 @@ mod header_map_serde { let mut serializable_format = Vec::with_capacity(map.as_ref().map(|x| x.len()).unwrap_or(0)); - serializable_format.extend(map.iter().map(|x| x.iter()).flatten().map(|key_and_value| { + serializable_format.extend(map.iter().flat_map(|x| x.iter()).map(|key_and_value| { match key_and_value { KeyAndValueRef::Ascii(key, value) => { let mut map = HashMap::with_capacity(1); diff --git a/apollo-router/src/files.rs b/apollo-router/src/files.rs index 8191ebf0c3..b5512787fb 100644 --- a/apollo-router/src/files.rs +++ b/apollo-router/src/files.rs @@ -82,7 +82,7 @@ pub(crate) mod tests { #[cfg(test)] pub(crate) fn create_temp_file() -> (PathBuf, File) { let path = temp_dir().join(format!("{}", uuid::Uuid::new_v4())); - let file = std::fs::File::create(path.to_owned()).unwrap(); + let file = std::fs::File::create(&path).unwrap(); (path, file) } diff --git a/apollo-router/src/router_factory.rs b/apollo-router/src/router_factory.rs index 5bc9f7b505..9878b41433 100644 --- a/apollo-router/src/router_factory.rs +++ b/apollo-router/src/router_factory.rs @@ -400,7 +400,7 @@ mod test { ) .unwrap(); let service = create_service(config).await; - assert!(!service.is_ok()) + assert!(service.is_err()) } #[tokio::test] @@ -428,7 +428,7 @@ mod test { ) .unwrap(); let service = create_service(config).await; - assert!(!service.is_ok()) + assert!(service.is_err()) } async fn create_service(config: Configuration) -> Result<(), BoxError> { diff --git a/apollo-spaceport/Cargo.toml b/apollo-spaceport/Cargo.toml index 8c8814c454..5d42a6a116 100644 --- a/apollo-spaceport/Cargo.toml +++ b/apollo-spaceport/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-spaceport" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" authors = ["Apollo Graph, Inc. "] edition = "2021" license-file = "./LICENSE" diff --git a/deny.toml b/deny.toml index 318bdb7c65..ed9a934981 100644 --- a/deny.toml +++ b/deny.toml @@ -63,13 +63,13 @@ license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] [[licenses.clarify]] name = "apollo-router" expression = "LicenseRef-ELv2" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" license-files = [{ path = "LICENSE", hash = 0xaceadac9 }] [[licenses.clarify]] name = "apollo-router-core" expression = "LicenseRef-ELv2" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" license-files = [{ path = "LICENSE", hash = 0xaceadac9 }] [[licenses.clarify]] @@ -80,7 +80,7 @@ license-files = [{ path = "router-bridge/LICENSE", hash = 0xaceadac9 }] [[licenses.clarify]] name = "apollo-spaceport" expression = "LicenseRef-ELv2" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" license-files = [{ path = "LICENSE", hash = 0xaceadac9 }] [[licenses.clarify]] diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 102f8b314c..ccc5f3bd74 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "LicenseRef-ELv2"