Skip to content

Commit

Permalink
release: v1.40.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored Feb 14, 2024
2 parents 1fb1b3c + c4f24c1 commit bfdf51e
Show file tree
Hide file tree
Showing 109 changed files with 3,735 additions and 1,800 deletions.
34 changes: 32 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,20 @@ jobs:
echo ${GITHUB_OCI_TOKEN} | docker login ghcr.io -u apollo-bot2 --password-stdin
# TODO: Can't figure out how to build multi-arch image from ARTIFACT_URL right now. Figure out later...
# Build and push debug image
docker buildx build --platform linux/amd64 --push --build-arg ARTIFACT_URL="${ARTIFACT_URL}" --build-arg DEBUG_IMAGE="true" --build-arg ROUTER_RELEASE=${VERSION} -f dockerfiles/Dockerfile.router -t ${ROUTER_TAG}:${VERSION}-debug .
docker buildx build --load --platform linux/amd64 --build-arg ARTIFACT_URL="${ARTIFACT_URL}" --build-arg DEBUG_IMAGE="true" --build-arg ROUTER_RELEASE=${VERSION} -f dockerfiles/Dockerfile.router -t ${ROUTER_TAG}:${VERSION}-debug .
docker push ${ROUTER_TAG}:${VERSION}-debug
# Build and push release image
docker buildx build --platform linux/amd64 --push --build-arg ARTIFACT_URL="${ARTIFACT_URL}" --build-arg ROUTER_RELEASE=${VERSION} -f dockerfiles/Dockerfile.router -t ${ROUTER_TAG}:${VERSION} .
docker buildx build --load --platform linux/amd64 --build-arg ARTIFACT_URL="${ARTIFACT_URL}" --build-arg ROUTER_RELEASE=${VERSION} -f dockerfiles/Dockerfile.router -t ${ROUTER_TAG}:${VERSION} .
docker push ${ROUTER_TAG}:${VERSION}
# 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}
- persist_to_workspace:
root: .
paths:
- "built-containers/*.tar"
- run:
name: Helm build
command: |
Expand Down Expand Up @@ -946,6 +957,25 @@ workflows:
parameters:
platform:
[ macos_build, windows_build, amd_linux_build, arm_linux_build ]
- secops/wiz-docker:
context:
- platform-docker-ro
- wiz
- github-orb
requires:
- build_release
container-dir: /tmp/workspace/built-containers
# 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
# Wiz policy used in this scan.
fail-on-findings: true
# Configure scan job to use a policy specific to apollo-router.
# This allows us to tailor the policy applied during the scans to router.
wiz-policies: Apollo-Router-Vulnerabilities-Policy


release:
when:
Expand Down
155 changes: 155 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,161 @@ 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.40.0] - 2024-02-14

## 🚀 Features

### GraphOS entity caching ([Issue #4478](https://github.com/apollographql/router/issues/4478))

> ⚠️ This is a preview for an [Enterprise feature](https://www.apollographql.com/blog/platform/evaluating-apollo-router-understanding-free-and-open-vs-commercial-features/) of the Apollo Router. It requires an organization with a [GraphOS Enterprise plan](https://www.apollographql.com/pricing/).
>
> If your organization doesn't currently have an Enterprise plan, you can test out this functionality by signing up for a free Enterprise trial.

The Apollo Router can now cache fine-grained subgraph responses at the entity level, which are reusable between requests.

Caching federated GraphQL responses can be done at the HTTP level, but it's inefficient because a lot of data can be shared between different requests. The Apollo Router now contains an entity cache that works at the subgraph level: it caches subgraph responses, splits them by entities, and reuses entities across subgraph requests.
Along with reducing the cache size, the router's entity cache brings more flexibility in how and what to cache. It allows the router to store different parts of a response with different expiration dates, and link the cache with the authorization context to avoid serving stale, unauthorized data.

As a preview feature, it's subject to our [Preview launch stage](https://www.apollographql.com/docs/resources/product-launch-stages/#preview) expectations. It doesn't support cache invalidation. We're making it available to test and gather feedback.

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


### Graduate distributed query plan caching from experimental ([Issue #4575](https://github.com/apollographql/router/issues/4575))

[Distributed query plan caching] (https://www.apollographql.com/docs/router/configuration/distributed-caching#distributed-query-plan-caching) has been validated in production deployments and is now a fully supported, non-experimental Enterprise feature of the Apollo Router.

To migrate your router configuration, replace `supergraph.query_planning.experimental_cache` with `supergraph.query_planning.cache`.

This release also adds improvements to the distributed cache:
1. The `.` separator is replaced with `:` in the Redis cache key to align with conventions.
2. The cache key length is reduced.
3. A federation version is added to the cache key to prevent confusion when routers with different federation versions (and potentially different ways to generate a query plan) target the same cache.
4. Cache insertion is moved to a parallel task. Once the query plan is created, this allows a request to be processed immediately instead of waiting for cache insertion to finish. This improvement has also been applied to the APQ cache.

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

### Replace selector to extract body elements from subgraph responses via JSONPath ([Issue #4443](https://github.com/apollographql/router/issues/4443))

The `subgraph_response_body` [selector](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/selectors/) has been deprecated and replaced with selectors for a response body's constituent elements: `subgraph_response_data` and `subgraph_response_errors`.

When configuring `subgraph_response_data` and `subgraph_response_errors`, both use a JSONPath expression to fetch data or errors from a subgraph response.

An example configuration:

```yaml
telemetry:
instrumentation:
spans:
subgraph:
attributes:
"my_attribute":
subgraph_response_data: "$.productName"
subgraph_response_errors: "$.[0].message"
```

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

### Add a `.remove` method for headers in Rhai

The router supports a new `.remove` method that enables users to remove headers in a Rhai script.

For example:

``` rust
fn supergraph_service(service) {
print("registering callbacks for operation timing");

const request_callback = Fn("process_request");
service.map_request(request_callback);

const response_callback = Fn("process_response");
service.map_response(response_callback);
}

fn process_request(request) {
request.context["request_start"] = Router.APOLLO_START.elapsed;
}

fn process_response(response) {
response.headers.remove("x-custom-header")
}
```

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

### Helm update to allow a list of gateways to `VirtualService` ([Issue #4464](https://github.com/apollographql/router/issues/4464))

Configuration of the router's Helm chart has been updated to allow multiple gateways. This enables configuration of multiple gateways in an Istio `VirtualService`.

The previous configuration for a single `virtualservice.gatewayName` has been deprecated in favor of a configuration for an array of `virtualservice.gatewayNames`.

By [@marcantoine-bibeau](https://github.com/marcantoine-bibeau) in https://github.com/apollographql/router/pull/4520

### Configure logging format automatically based on terminal ([Issue #4369](https://github.com/apollographql/router/issues/4369))

You can configure the logging output format when running with an interactive shell.

If both `format` and `tty_format` are configured, then the format used depends on how the router is run:

* If running with an interactive shell, then `tty_format` takes precedence.
* If running with a non-interactive shell, then `format` takes precedence.

You can explicitly set the format in `router.yaml` with `telemetry.exporters.logging.stdout.tty_format`:

```yaml title="router.yaml"
telemetry:
exporters:
logging:
stdout:
enabled: true
format: json
tty_format: text
```

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

### Add configurable histogram buckets per metric ([Issue #4543](https://github.com/apollographql/router/issues/4543))

The router supports overriding instrument settings for metrics with [OpenTelemetry views](https://opentelemetry.io/docs/concepts/signals/metrics/#views). You can use views to override default histogram buckets.

Configure views with the `views` option. For example:

```yaml
telemetry:
exporters:
metrics:
common:
service_name: apollo-router
views:
- name: apollo_router_http_request_duration_seconds # Instrument name you want to edit. You can use wildcard in names. If you want to target all instruments just use '*'
unit: "ms" # (Optional) override the unit
description: "my new description of this metric" # (Optional) override the description
aggregation: # (Optional)
histogram:
buckets: # Override default buckets configured for this histogram
- 1
- 2
- 3
- 4
- 5
allowed_attribute_keys: # (Optional) Keep only listed attributes on the metric
- status
```

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

## 🐛 Fixes

### Fix `active_session_count` when future is dropped ([Issue #4601](https://github.com/apollographql/router/issues/4601))

Fixes [an issue](https://github.com/apollographql/router/issues/4601) where `apollo_router_session_count_active` would increase indefinitely due
to the request future getting dropped before a counter could be decremented.

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



# [1.39.1] - 2024-02-08

## 🐛 Fixes
Expand Down
Loading

0 comments on commit bfdf51e

Please sign in to comment.