diff --git a/.changesets/config_generate_query_fragments.md b/.changesets/config_generate_query_fragments.md deleted file mode 100644 index 2125b3d4d0..0000000000 --- a/.changesets/config_generate_query_fragments.md +++ /dev/null @@ -1,12 +0,0 @@ -### Add `generate_query_fragments` configuration option ([PR #4885](https://github.com/apollographql/router/pull/4885)) - -Add a new `supergraph` configuration option `generate_query_fragments`. When set to `true`, the query planner will extract inline fragments into fragment definitions before sending queries to subgraphs. This can significantly reduce the size of the query sent to subgraphs, but may increase the time it takes to plan the query. Note that this option and `reuse_query_fragments` are mutually exclusive; if both are set to `true`, `generate_query_fragments` will take precedence. - -An example router configuration: - -```yaml title="router.yaml" -supergraph: - generate_query_fragments: true -``` - -By [@trevor-scheer](https://github.com/trevor-scheer) in https://github.com/apollographql/router/pull/4885 diff --git a/.changesets/feat_bnjjj_feat_4319.md b/.changesets/feat_bnjjj_feat_4319.md deleted file mode 100644 index e765d0095c..0000000000 --- a/.changesets/feat_bnjjj_feat_4319.md +++ /dev/null @@ -1,43 +0,0 @@ -### Add support of instruments in configuration for telemetry ([Issue #4319](https://github.com/apollographql/router/issues/4319)) - -Add support for custom and standard instruments through the configuration file. You'll be able to add your own custom metrics just using the configuration file. They may: -- be conditional -- get values from selectors, for instance headers, context or body -- have different types like `histogram` or `counter`. - -Example: - -```yaml title="router.yaml" -telemetry: - instrumentation: - instruments: - router: - http.server.active_requests: true - acme.request.duration: - value: duration - type: counter - unit: kb - description: "my description" - attributes: - http.response.status_code: true - "my_attribute": - response_header: "x-my-header" - - supergraph: - acme.graphql.requests: - value: unit - type: counter - unit: count - description: "supergraph requests" - - subgraph: - acme.graphql.subgraph.errors: - value: unit - type: counter - unit: count - description: "my description" -``` - -[Documentation](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/instruments) - -By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4771 \ No newline at end of file diff --git a/.changesets/feat_bryn_enable_otelp_http_metrics.md b/.changesets/feat_bryn_enable_otelp_http_metrics.md deleted file mode 100644 index 41561e9a23..0000000000 --- a/.changesets/feat_bryn_enable_otelp_http_metrics.md +++ /dev/null @@ -1,16 +0,0 @@ -### Add OTLP http metrics export ([Issue #4559](https://github.com/apollographql/router/issues/4559)) - -Users can now export metrics via OTLP Http in addition to the existing OTLP Grpc - -Activate this by setting the `protocol` to `http` in your your `router.yaml`: - -``` -telemetry: - exporters: - metrics: - otlp: - enabled: true - protocol: http -``` - -By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/4842 diff --git a/.changesets/feat_garypen_4899_error_service_details.md b/.changesets/feat_garypen_4899_error_service_details.md deleted file mode 100644 index fb9c37d635..0000000000 --- a/.changesets/feat_garypen_4899_error_service_details.md +++ /dev/null @@ -1,5 +0,0 @@ -### add error details to 'router service call failed' ([Issue #4899](https://github.com/apollographql/router/issues/4899)) - -It can be difficult to understand 'router service call failed' messages. Adding the error detail should make them more comprehensible. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4900 \ No newline at end of file diff --git a/.changesets/feat_geal_query_plan_cache_default_ttl.md b/.changesets/feat_geal_query_plan_cache_default_ttl.md deleted file mode 100644 index 59b95e2534..0000000000 --- a/.changesets/feat_geal_query_plan_cache_default_ttl.md +++ /dev/null @@ -1,5 +0,0 @@ -### set a default TTL for query plans ([Issue #4473](https://github.com/apollographql/router/issues/4473)) - -This sets a default TTL of 30 days for query plan caches, because the previous default was to store query plans indefinitely, which does not make sense because they change with schema updates. - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4588 \ No newline at end of file diff --git a/.changesets/feat_geal_schema_hash_requires.md b/.changesets/feat_geal_schema_hash_requires.md deleted file mode 100644 index 2c46a6da9b..0000000000 --- a/.changesets/feat_geal_schema_hash_requires.md +++ /dev/null @@ -1,14 +0,0 @@ -### reuse cached query plans across schema updates if possible ([Issue #4834](https://github.com/apollographql/router/issues/4834)) - -This extends the schema aware query hashing introduced in entity caching, to reduce the amount of work when reloading the router. That hash is designed to stay the same for a same query across schema updates if the update does not affect that query. If query planner cache warm up is configured, then it can reuse previous cache entries for which the hash does not change, which will reduce CPU usage and make reloads faster. - -This can be activated with the following option: - -```yaml title="router.yaml" -supergraph: - query_planning: - warmed_up_queries: 100 - experimental_reuse_query_plans: true -``` - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4883 \ No newline at end of file diff --git a/.changesets/fix_apq_cache_key_to_match_redis_convention.md b/.changesets/fix_apq_cache_key_to_match_redis_convention.md deleted file mode 100644 index b357a36619..0000000000 --- a/.changesets/fix_apq_cache_key_to_match_redis_convention.md +++ /dev/null @@ -1,7 +0,0 @@ -### Replaces null separator in apq cache key with : to match redis convention - -This PR conforms the apq cache key to follow redis convention. This helps when using redis clients to properly display keys in nested form. - -query plan cache key was fixed in a similar pr: #4583 - -By [@tapaderster](https://github.com/tapaderster) in https://github.com/apollographql/router/pull/4886 \ No newline at end of file diff --git a/.changesets/fix_garypen_revive_docker_heaptrack.md b/.changesets/fix_garypen_revive_docker_heaptrack.md deleted file mode 100644 index 53e897278a..0000000000 --- a/.changesets/fix_garypen_revive_docker_heaptrack.md +++ /dev/null @@ -1,7 +0,0 @@ -### Make 'router' user the owner of the docker image's /dist/data directory ([PR #4898](https://github.com/apollographql/router/pull/4898)) - -Since we made our images more secure, we run our router process as user 'router'. If we are running under 'heaptrack', e.g.: in a debug image, then we cannot write to /dist/data because it is owned by 'root'. - -This changes the ownership of /dist/data from 'root' to 'router' to allow writes to succeed. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4898 \ No newline at end of file diff --git a/.changesets/fix_geal_entity_cache_configuration_update.md b/.changesets/fix_geal_entity_cache_configuration_update.md deleted file mode 100644 index 122d54855b..0000000000 --- a/.changesets/fix_geal_entity_cache_configuration_update.md +++ /dev/null @@ -1,8 +0,0 @@ -### Entity cache: require the presence of a Cache-Control header ([Issue #4880](https://github.com/apollographql/router/issues/4880)) - -The entity cache plugin intended to require a `Cache-Control` header from the subgraph to decide whether or not a response should be cached. Unfortunately in the way tit was set up, all responses were stored. -The plugin now makes sure that the `Cache-Control` is there, and if a subgraph does not provide it, then the aggregated `Cache-Control` header sent to the client will contain `no-store`. - -Additionally, the Router will now check that a TTL is configured for all subgraphs, either in per subgraph configuration, or globally. - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4882 \ No newline at end of file diff --git a/.changesets/fix_glasser_pq_error_status_codes.md b/.changesets/fix_glasser_pq_error_status_codes.md deleted file mode 100644 index 704a9d7e55..0000000000 --- a/.changesets/fix_glasser_pq_error_status_codes.md +++ /dev/null @@ -1,15 +0,0 @@ -### Persisted Query errors are now 4xx errors ([PR #4887](https://github.com/apollographql/router/pull/4887) - -Previously, sending various kinds of invalid Persisted Query requests returned a 200 status code to the client. Now, these errors return 4xx status codes: - -- Sending a PQ ID that is unknown returns 404 (Not Found). -- Sending freeform GraphQL when no freeform GraphQL is allowed returns - 400 (Bad Request). -- Sending both a PQ ID and freeform GraphQL in the same request (if the - APQ feature is not also enabled) returns 400 (Bad Request). -- Sending freeform GraphQL that is not in the safelist when the safelist - is enabled returns (403 Forbidden). -- A particular internal error that shouldn't happen returns 500 (Internal - Server Error). - - By [@glasser](https://github.com/glasser) in https://github.com/apollographql/router/pull/4887 diff --git a/.changesets/fix_glasser_selector_labels.md b/.changesets/fix_glasser_selector_labels.md deleted file mode 100644 index 305f516622..0000000000 --- a/.changesets/fix_glasser_selector_labels.md +++ /dev/null @@ -1,6 +0,0 @@ -### Helm: include all standard labels in pod spec but complete sentence that stands on its own ([PR #4862](https://github.com/apollographql/router/pull/4862)) - -The `helm.sh/chart`, `app.kubernetes.io/version`, and `app.kubernetes.io/managed-by` labels are now included on pods just like they are in every other resource created by the Helm chart, because the pod spec template now uses the `router.labels` template function instead of the `router.selectorLabels` template function. This also means that you can remove a label from the selector without removing it from resource metadata by overriding the `router.selectorLabels` and `router.labels` functions and moving the label from the former to the latter. - - -By [@glasser](https://github.com/glasser) in https://github.com/apollographql/router/pull/4862 \ No newline at end of file diff --git a/.changesets/fix_simon_accept_request_extensions_is_null.md b/.changesets/fix_simon_accept_request_extensions_is_null.md deleted file mode 100644 index 1feaea4470..0000000000 --- a/.changesets/fix_simon_accept_request_extensions_is_null.md +++ /dev/null @@ -1,7 +0,0 @@ -### Accept `extensions: null` in a GraphQL request ([Issue #3388](https://github.com/apollographql/router/issues/3388)) - -In GraphQL requests, `extensions` is an optional map. -Passing an explicit `null` was incorrectly considered a parse error. -Now it is equivalent to omiting that field entirely, or to passing an empty map. - -By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/4911 diff --git a/.changesets/maint_garypen_fix_telemetry_integration_test_macos.md b/.changesets/maint_garypen_fix_telemetry_integration_test_macos.md deleted file mode 100644 index 1707ed8ecc..0000000000 --- a/.changesets/maint_garypen_fix_telemetry_integration_test_macos.md +++ /dev/null @@ -1,5 +0,0 @@ -### fix annoying integration test warning on macOS ([PR #4919](https://github.com/apollographql/router/pull/4919)) - -For a little while we have had a warning with integration tests on macOS. This fixes the warning. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4919 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf649f68b..ad0441a09b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,201 @@ 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.44.0] - 2024-04-12 + +## šŸš€ Features + +### Add details to `router service call failed` errors ([Issue #4899](https://github.com/apollographql/router/issues/4899)) + +The router now includes more details in `router service call failed` error messages to improve their understandability and debuggability. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4900 + +### Support exporting metrics via OTLP HTTP ([Issue #4559](https://github.com/apollographql/router/issues/4559)) + +In addition to exporting metrics via OTLP/gRPC, the router now supports exporting metrics via OTLP/HTTP. + +You can enable exporting via OTLP/HTTP by setting the `protocol` key to `http` in your `router.yaml`: + +``` +telemetry: + exporters: + metrics: + otlp: + enabled: true + protocol: http +``` + +By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/4842 + +### Add support of instruments in configuration for telemetry ([Issue #4319](https://github.com/apollographql/router/issues/4319)) + +Add support for custom and standard instruments through the configuration file. You'll be able to add your own custom metrics just using the configuration file. They may: +- be conditional +- get values from selectors, for instance headers, context or body +- have different types like `histogram` or `counter`. + +Example: + +```yaml title="router.yaml" +telemetry: + instrumentation: + instruments: + router: + http.server.active_requests: true + acme.request.duration: + value: duration + type: counter + unit: kb + description: "my description" + attributes: + http.response.status_code: true + "my_attribute": + response_header: "x-my-header" + + supergraph: + acme.graphql.requests: + value: unit + type: counter + unit: count + description: "supergraph requests" + + subgraph: + acme.graphql.subgraph.errors: + value: unit + type: counter + unit: count + description: "my description" +``` + +[Documentation](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/instruments) + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4771 + +### Reuse cached query plans across schema updates ([Issue #4834](https://github.com/apollographql/router/issues/4834)) + +The router now supports an experimental feature to reuse schema aware query hashingā€”introduced with the [entity caching](https://www.apollographql.com/docs/router/configuration/entity-caching/) featureā€”to cache query plans. It reduces the amount of work when reloading the router. The hash of the cache stays the same for a query across schema updates if the schema updates don't change the query. If query planner [cache warm-up](https://www.apollographql.com/docs/router/configuration/in-memory-caching/#cache-warm-up) is configured, the router can reuse previous cache entries for which the hash does not change, consequently reducing both CPU usage and reload duration. + +You can enable reuse of cached query plans by setting the `supergraph.query_planning.experimental_reuse_query_plans` option: + +```yaml title="router.yaml" +supergraph: + query_planning: + warmed_up_queries: 100 + experimental_reuse_query_plans: true +``` + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4883 + +### Set a default TTL for query plans ([Issue #4473](https://github.com/apollographql/router/issues/4473)) + +The router has updated the default TTL for query plan caches. The new default TTL is 30 days. With the previous default being an infinite duration, the new finite default better supports the fact that the router updates caches with schema updates. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4588 + +## šŸ› Fixes + +### Replace null separator in cache key with `:` to match Redis convention ([PR #4886](https://github.com/apollographql/router/pull/4886)) + +To conform with Redis convention, the router now uses `:` instead of null as the separator in cache keys. This conformance helps to properly display cache keys in nested form in Redis clients. + +This PR (#4886) updates the separator for APQ cache keys. Another PR (#4583) updates the separator for query plan cache keys. + +By [@tapaderster](https://github.com/tapaderster) in https://github.com/apollographql/router/pull/4886 + +### Make 'router' user the owner of the docker image's /dist/data directory ([PR #4898](https://github.com/apollographql/router/pull/4898)) + +Since we made our images more secure, we run our router process as user 'router'. If we are running under 'heaptrack', e.g.: in a debug image, then we cannot write to /dist/data because it is owned by 'root'. + +This changes the ownership of /dist/data from 'root' to 'router' to allow writes to succeed. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4898 + +### Accept `extensions: null` in a GraphQL request ([Issue #3388](https://github.com/apollographql/router/issues/3388)) + +In GraphQL requests, `extensions` is an optional map. +Passing an explicit `null` was incorrectly considered a parse error. +Now it is equivalent to omiting that field entirely, or to passing an empty map. + +By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/4911 + +### Require Cache-Control header for entity cache ([Issue #4880](https://github.com/apollographql/router/issues/4880)) + +Previously, the router's entity cache plugin didn't use a subgraph's `Cache-Control` header to decide whether to store a response. Instead, it cached all responses. + +Now, the router's entity cache plugin expects a `Cache-Control` header from a subgraph. If a subgraph does not provide it, the aggregated `Cache-Control` header sent to the client will contain `no-store`. + +Additionally, the router now verifies that a TTL is configured for all subgraphs, either globally or for each subgraph configuration. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4882 + +### Helm: include all standard labels in pod spec but complete sentence that stands on its own ([PR #4862](https://github.com/apollographql/router/pull/4862)) + +The templates for the router's Helm chart have been updated so that the `helm.sh/chart`, `app.kubernetes.io/version`, and `app.kubernetes.io/managed-by` labels are now included on pods, as they already were for all other resources created by the Helm chart. + +The specific change to the template is that the pod spec template now uses the `router.labels` template function instead of the `router.selectorLabels` template function. This allows you to remove a label from the selector without removing it from resource metadata by overriding the `router.selectorLabels` and `router.labels` functions and moving the label from the former to the latter. + +By [@glasser](https://github.com/glasser) in https://github.com/apollographql/router/pull/4862 + +### Persisted queries return 4xx errors ([PR #4887](https://github.com/apollographql/router/pull/4887) + +Previously, sending an invalid persisted query request could return a 200 status code to the client when they should have returned errors. These requests now return errors as 4xx status codes: + +- Sending a PQ ID that is unknown returns 404 (Not Found). +- Sending freeform GraphQL when no freeform GraphQL is allowed returns + 400 (Bad Request). +- Sending both a PQ ID and freeform GraphQL in the same request (if the + APQ feature is not also enabled) returns 400 (Bad Request). +- Sending freeform GraphQL that is not in the safelist when the safelist + is enabled returns (403 Forbidden). +- A particular internal error that shouldn't happen returns 500 (Internal + Server Error). + + By [@glasser](https://github.com/glasser) in https://github.com/apollographql/router/pull/4887 + +## šŸ“ƒ Configuration + +### Add `generate_query_fragments` configuration option ([PR #4885](https://github.com/apollographql/router/pull/4885)) + +Add a new `supergraph` configuration option `generate_query_fragments`. When set to `true`, the query planner will extract inline fragments into fragment definitions before sending queries to subgraphs. This can significantly reduce the size of the query sent to subgraphs, but may increase the time it takes to plan the query. Note that this option and `reuse_query_fragments` are mutually exclusive; if both are set to `true`, `generate_query_fragments` will take precedence. + +An example router configuration: + +```yaml title="router.yaml" +supergraph: + generate_query_fragments: true +``` + +By [@trevor-scheer](https://github.com/trevor-scheer) in https://github.com/apollographql/router/pull/4885 + +## šŸ›  Maintenance + +### Fix integration test warning on macOS ([PR #4919](https://github.com/apollographql/router/pull/4919)) + +Previously, integration tests of the router on macOS could produce the warning messages: + +``` +warning: unused import: `common::Telemetry` + --> apollo-router/tests/integration/mod.rs:4:16 + | +4 | pub(crate) use common::Telemetry; + | ^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +warning: unused import: `common::ValueExt` + --> apollo-router/tests/integration/mod.rs:5:16 + | +5 | pub(crate) use common::ValueExt; + | ^^^^^^^^^^^^^^^^ +``` + +That issue is now resolved. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4919 + + + # [1.43.2] - 2024-04-03 ## šŸ› Fixes diff --git a/Cargo.lock b/Cargo.lock index fba4a4f6f8..470b383139 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -250,7 +250,7 @@ dependencies = [ [[package]] name = "apollo-router" -version = "1.43.2" +version = "1.44.0" dependencies = [ "access-json", "anyhow", @@ -410,7 +410,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.43.2" +version = "1.44.0" dependencies = [ "apollo-parser", "apollo-router", @@ -426,7 +426,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.43.2" +version = "1.44.0" dependencies = [ "anyhow", "cargo-scaffold", diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index 63aa39063d..45cb1924d1 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "1.43.2" +version = "1.44.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/Cargo.toml b/apollo-router-scaffold/Cargo.toml index fcf25e2de5..ff6054dca0 100644 --- a/apollo-router-scaffold/Cargo.toml +++ b/apollo-router-scaffold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-scaffold" -version = "1.43.2" +version = "1.44.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/templates/base/Cargo.toml b/apollo-router-scaffold/templates/base/Cargo.toml index 2f66ce5737..56e237bfce 100644 --- a/apollo-router-scaffold/templates/base/Cargo.toml +++ b/apollo-router-scaffold/templates/base/Cargo.toml @@ -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.43.2" +apollo-router = "1.44.0" {{/if}} {{/if}} async-trait = "0.1.52" diff --git a/apollo-router-scaffold/templates/base/xtask/Cargo.toml b/apollo-router-scaffold/templates/base/xtask/Cargo.toml index febb964c3c..0f1d41f37b 100644 --- a/apollo-router-scaffold/templates/base/xtask/Cargo.toml +++ b/apollo-router-scaffold/templates/base/xtask/Cargo.toml @@ -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.43.2" } +apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.44.0" } {{/if}} {{/if}} anyhow = "1.0.58" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 2eb77333f8..cdd8c23bc0 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "1.43.2" +version = "1.44.0" authors = ["Apollo Graph, Inc. "] repository = "https://github.com/apollographql/router/" documentation = "https://docs.rs/apollo-router" @@ -176,7 +176,7 @@ prost = "0.12.3" prost-types = "0.12.3" proteus = "0.5.0" rand = "0.8.5" -rhai = { version = "1.17.1", features = ["sync", "serde", "internals"] } +rhai = { version = "=1.17.1", features = ["sync", "serde", "internals"] } regex = "1.10.3" reqwest = { version = "0.11.24", default-features = false, features = [ "rustls-tls", diff --git a/apollo-router/src/query_planner/caching_query_planner.rs b/apollo-router/src/query_planner/caching_query_planner.rs index 39e742c0e0..32190e7281 100644 --- a/apollo-router/src/query_planner/caching_query_planner.rs +++ b/apollo-router/src/query_planner/caching_query_planner.rs @@ -548,6 +548,10 @@ const FEDERATION_VERSION: &str = std::env!("FEDERATION_VERSION"); impl std::fmt::Display for CachingQueryKey { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let mut hasher = Sha256::new(); + hasher.update(self.operation.as_deref().unwrap_or("-")); + let operation = hex::encode(hasher.finalize()); + let mut hasher = Sha256::new(); hasher.update(&serde_json::to_vec(&self.metadata).expect("serialization should not fail")); hasher.update( @@ -555,13 +559,18 @@ impl std::fmt::Display for CachingQueryKey { ); let metadata = hex::encode(hasher.finalize()); - write!(f, "plan:{}:{}:{}", FEDERATION_VERSION, self.hash, metadata,) + write!( + f, + "plan:{}:{}:{}:{}", + FEDERATION_VERSION, self.hash, operation, metadata, + ) } } impl Hash for CachingQueryKey { fn hash(&self, state: &mut H) { self.hash.0.hash(state); + self.operation.hash(state); self.metadata.hash(state); self.plan_options.hash(state); } diff --git a/apollo-router/tests/integration/redis.rs b/apollo-router/tests/integration/redis.rs index 2c9b57159d..5a340fea03 100644 --- a/apollo-router/tests/integration/redis.rs +++ b/apollo-router/tests/integration/redis.rs @@ -8,6 +8,8 @@ mod test { use apollo_router::MockedSubgraphs; use fred::cmd; use fred::prelude::*; + use fred::types::ScanType; + use fred::types::Scanner; use futures::StreamExt; use http::header::CACHE_CONTROL; use http::HeaderValue; @@ -26,7 +28,7 @@ mod test { // 2. run `docker compose up -d` and connect to the redis container by running `docker exec -ti /bin/bash`. // 3. Run the `redis-cli` command from the shell and start the redis `monitor` command. // 4. Run this test and yank the updated cache key from the redis logs. - let known_cache_key = "plan:v2.7.2:af1ee357bc75cfbbcc6adda41089a56e7d1d52f6d44c049739dde2c259314f58:2bf7810d3a47b31d8a77ebb09cdc784a3f77306827dc55b06770030a858167c7"; + let known_cache_key = "plan:v2.7.2:af1ee357bc75cfbbcc6adda41089a56e7d1d52f6d44c049739dde2c259314f58:3973e022e93220f9212c18d0d0c543ae7c309e46640da93a4a0314de999f5112:2bf7810d3a47b31d8a77ebb09cdc784a3f77306827dc55b06770030a858167c7"; let config = RedisConfig::from_url("redis://127.0.0.1:6379")?; let client = RedisClient::new(config, None, None, None); @@ -63,7 +65,18 @@ mod test { let _ = supergraph.oneshot(request).await?.next_response().await; - let s: String = client.get(known_cache_key).await.unwrap(); + let s: String = match client.get(known_cache_key).await { + Ok(s) => s, + Err(e) => { + println!("keys in Redis server:"); + let mut scan = client.scan("plan:*", None, Some(ScanType::String)); + while let Some(key) = scan.next().await { + let key = key.as_ref().unwrap().results(); + println!("\t{key:?}"); + } + panic!("key {known_cache_key} not found: {e}"); + } + }; let exp: i64 = client .custom_raw(cmd!("EXPIRETIME"), vec![known_cache_key.to_string()]) .await diff --git a/dockerfiles/tracing/docker-compose.datadog.yml b/dockerfiles/tracing/docker-compose.datadog.yml index 26967fb052..0115029b0b 100644 --- a/dockerfiles/tracing/docker-compose.datadog.yml +++ b/dockerfiles/tracing/docker-compose.datadog.yml @@ -3,7 +3,7 @@ services: apollo-router: container_name: apollo-router - image: ghcr.io/apollographql/router:v1.43.2 + image: ghcr.io/apollographql/router:v1.44.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/datadog.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.jaeger.yml b/dockerfiles/tracing/docker-compose.jaeger.yml index 37ace950c4..04c0c57799 100644 --- a/dockerfiles/tracing/docker-compose.jaeger.yml +++ b/dockerfiles/tracing/docker-compose.jaeger.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router #build: ./router - image: ghcr.io/apollographql/router:v1.43.2 + image: ghcr.io/apollographql/router:v1.44.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/jaeger.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.zipkin.yml b/dockerfiles/tracing/docker-compose.zipkin.yml index a201f5f86d..f7a431ea72 100644 --- a/dockerfiles/tracing/docker-compose.zipkin.yml +++ b/dockerfiles/tracing/docker-compose.zipkin.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router build: ./router - image: ghcr.io/apollographql/router:v1.43.2 + image: ghcr.io/apollographql/router:v1.44.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/zipkin.router.yaml:/etc/config/configuration.yaml diff --git a/helm/chart/router/Chart.yaml b/helm/chart/router/Chart.yaml index 917c6ca099..bfbfc803cf 100644 --- a/helm/chart/router/Chart.yaml +++ b/helm/chart/router/Chart.yaml @@ -20,10 +20,10 @@ type: application # so it matches the shape of our release process and release automation. # By proxy of that decision, this version uses SemVer 2.0.0, though the prefix # of "v" is not included. -version: 1.43.2 +version: 1.44.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v1.43.2" +appVersion: "v1.44.0" diff --git a/helm/chart/router/README.md b/helm/chart/router/README.md index 48c19541d2..b997146903 100644 --- a/helm/chart/router/README.md +++ b/helm/chart/router/README.md @@ -2,7 +2,7 @@ [router](https://github.com/apollographql/router) Rust Graph Routing runtime for Apollo Federation -![Version: 1.43.2](https://img.shields.io/badge/Version-1.43.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.43.2](https://img.shields.io/badge/AppVersion-v1.43.2-informational?style=flat-square) +![Version: 1.44.0](https://img.shields.io/badge/Version-1.44.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.44.0](https://img.shields.io/badge/AppVersion-v1.44.0-informational?style=flat-square) ## Prerequisites @@ -11,7 +11,7 @@ ## Get Repo Info ```console -helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.43.2 +helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.44.0 ``` ## Install Chart @@ -19,7 +19,7 @@ helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.43.2 **Important:** only helm3 is supported ```console -helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.43.2 --values my-values.yaml +helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.44.0 --values my-values.yaml ``` _See [configuration](#configuration) below._ @@ -95,4 +95,4 @@ helm show values oci://ghcr.io/apollographql/helm-charts/router | virtualservice.enabled | bool | `false` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.11.2](https://github.com/norwoodj/helm-docs/releases/v1.11.2) diff --git a/licenses.html b/licenses.html index e5d3dab6ea..b5b968a876 100644 --- a/licenses.html +++ b/licenses.html @@ -11329,17 +11329,6 @@

Used by:

additional terms or conditions. -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    ../../LICENSE-APACHE
    -
  • Apache License 2.0

    Used by:

    @@ -11987,6 +11976,11 @@

    Used by:

    Apache License 2.0

    Used by:

      +
    • allocator-api2
    • +
    • apollo-compiler
    • +
    • apollo-encoder
    • +
    • apollo-parser
    • +
    • apollo-smith
    • curve25519-dalek-derive
    • deadpool-runtime
    • deno-proc-macro-rules
    • @@ -12091,26 +12085,6 @@

      Used by:

      See the License for the specific language governing permissions and limitations under the License. - -
    • -

      Apache License 2.0

      -

      Used by:

      - -
      Copyright 2023 The allocator-api2 project developers
      -
      -Licensed under the Apache License, Version 2.0 (the "License");
      -you may not use this file except in compliance with the License.
      -You may obtain a copy of the License at
      -
      -	http://www.apache.org/licenses/LICENSE-2.0
      -
      -Unless required by applicable law or agreed to in writing, software
      -distributed under the License is distributed on an "AS IS" BASIS,
      -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      -See the License for the specific language governing permissions and
      -limitations under the License.
    • Apache License 2.0

      @@ -12960,12 +12934,11 @@

      Used by:

      Elastic License 2.0

      Used by:

      -
      Elastic License 2.0
      +                
      Copyright 2021 Apollo Graph, Inc.
       
      -URL: https://www.elastic.co/licensing/elastic-license
      +Elastic License 2.0
       
       ## Acceptance
       
      @@ -13056,7 +13029,115 @@ 

      Used by:

      **use** means anything you do with the software requiring one of your licenses. **trademark** means trademarks, service marks, and similar rights. + +--------------------------------------------------------------------------------
      +
    • +
    • +

      Elastic License 2.0

      +

      Used by:

      + +
      Copyright 2021 Apollo Graph, Inc.
      +
      +Source code in this repository is covered by (i) the Elastic License 2.0 or (ii) an MIT compatible license, in each case, as designated by a licensing file in a subdirectory or file header. The default throughout the repository is a license under the Elastic License 2.0, unless a file header or a licensing file in a subdirectory specifies another license.
      +
      +--------------------------------------------------------------------------------
      +
      +Elastic License 2.0
      +
      +## Acceptance
      +
      +By using the software, you agree to all of the terms and conditions below.
      +
      +## Copyright License
      +
      +The licensor grants you a non-exclusive, royalty-free, worldwide,
      +non-sublicensable, non-transferable license to use, copy, distribute, make
      +available, and prepare derivative works of the software, in each case subject to
      +the limitations and conditions below.
      +
      +## Limitations
      +
      +You may not provide the software to third parties as a hosted or managed
      +service, where the service provides users with access to any substantial set of
      +the features or functionality of the software.
      +
      +You may not move, change, disable, or circumvent the license key functionality
      +in the software, and you may not remove or obscure any functionality in the
      +software that is protected by the license key.
      +
      +You may not alter, remove, or obscure any licensing, copyright, or other notices
      +of the licensor in the software. Any use of the licensorā€™s trademarks is subject
      +to applicable law.
      +
      +## Patents
      +
      +The licensor grants you a license, under any patent claims the licensor can
      +license, or becomes able to license, to make, have made, use, sell, offer for
      +sale, import and have imported the software, in each case subject to the
      +limitations and conditions in this license. This license does not cover any
      +patent claims that you cause to be infringed by modifications or additions to
      +the software. If you or your company make any written claim that the software
      +infringes or contributes to infringement of any patent, your patent license for
      +the software granted under these terms ends immediately. If your company makes
      +such a claim, your patent license ends immediately for work on behalf of your
      +company.
      +
      +## Notices
      +
      +You must ensure that anyone who gets a copy of any part of the software from you
      +also gets a copy of these terms.
      +
      +If you modify the software, you must include in any modified copies of the
      +software prominent notices stating that you have modified the software.
      +
      +## No Other Rights
      +
      +These terms do not imply any licenses other than those expressly granted in
      +these terms.
      +
      +## Termination
      +
      +If you use the software in violation of these terms, such use is not licensed,
      +and your licenses will automatically terminate. If the licensor provides you
      +with a notice of your violation, and you cease all violation of this license no
      +later than 30 days after you receive that notice, your licenses will be
      +reinstated retroactively. However, if you violate these terms after such
      +reinstatement, any additional violation of these terms will cause your licenses
      +to terminate automatically and permanently.
      +
      +## No Liability
      +
      +*As far as the law allows, the software comes as is, without any warranty or
      +condition, and the licensor will not be liable to you for any damages arising
      +out of these terms or the use or nature of the software, under any kind of
      +legal claim.*
      +
      +## Definitions
      +
      +The **licensor** is the entity offering these terms, and the **software** is the
      +software the licensor makes available under these terms, including any portion
      +of it.
      +
      +**you** refers to the individual or entity agreeing to these terms.
      +
      +**your company** is any legal entity, sole proprietorship, or other kind of
      +organization that you work for, plus all organizations that have control over,
      +are under the control of, or are under common control with that
      +organization. **control** means ownership of substantially all the assets of an
      +entity, or the power to direct its management and policies by vote, contract, or
      +otherwise. Control can be direct or indirect.
      +
      +**your licenses** are all the licenses granted to you for the software under
      +these terms.
      +
      +**use** means anything you do with the software requiring one of your licenses.
      +
      +**trademark** means trademarks, service marks, and similar rights.
      +
      +--------------------------------------------------------------------------------
    • ISC License

      diff --git a/scripts/install.sh b/scripts/install.sh index b3697de80a..64afab308c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -11,7 +11,7 @@ BINARY_DOWNLOAD_PREFIX="https://github.com/apollographql/router/releases/downloa # Router version defined in apollo-router's Cargo.toml # Note: Change this line manually during the release steps. -PACKAGE_VERSION="v1.43.2" +PACKAGE_VERSION="v1.44.0" download_binary() { downloader --check