-
Notifications
You must be signed in to change notification settings - Fork 273
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
release: v1.0.0-rc.0 #1775
Merged
Merged
release: v1.0.0-rc.0 #1775
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This will allow me to get moving on the prep.
abernix
requested review from
o0Ignition0o,
garypen,
bnjjj,
BrynCooke and
SimonSapin
September 14, 2022 15:01
bnjjj
approved these changes
Sep 14, 2022
garypen
approved these changes
Sep 14, 2022
o0Ignition0o
approved these changes
Sep 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
❗ BREAKING ❗
Adjusted socket ("listener") addresses for more secure default behaviors
0.0.0.0
). You may specify a specific socket by specifying theinterface:port
combination. If you desire behavior which binds to all interfaces, your configuration can specify a socket of0.0.0.0:4000
(for port4000
on all interfaces).Safer out-of-the box defaults with
sandbox
andintrospection
disabled (PR #1748)To reflect the fact that it is not recomended to have introspection on in production (and since Sandbox uses introspection to power its development features) the
sandbox
andintrospection
configuration are now disabled unless you are running the Router with--dev
.If you would like to force them on even when outside of
--dev
mode, you can set them totrue
explicitly in your YAML configuration:By @bnjjj in #1748
Landing page ("home page") replaces Sandbox in default "production" mode (PR #1768)
As an extension of Sandbox and Introspection being disabled by default (see above), the Router now displays a simple landing page when running in its default mode. When you run the Apollo Router with the new
--dev
flag (see "Features" section below) you will still see the existing "Apollo Studio Sandbox" experience.We will offer additional options to customize the landing page in the future but for now you can disable the homepage entirely (leaving a very generic page with a GraphQL message) by disabling the homepage entirely in your configuration:
By @o0Ignition0o in #1768
Listeners, paths and paths can be configured individually (Issue #1500)
It is now possible to individually configure the following features' socket/listener addresses (i.e., the IP address and port) in addition to the URL path:
http://127.0.0.1:4000/
)--dev
:http://127.0.0.1:4000/
)http://127.0.0.1:9090/metrics
)Examples of how to configure these can be seen in the YAML configuration overhaul section of this changelog (just below) as well as in our documentation.
By @o0Ignition0o in #1718
Overhaul/reorganization of YAML configuration (#1500)
To facilitate the changes in the previous bullet-points, we have moved configuration parameters which previously lived in the
server
section to new homes in the configuration, includinglisten
,graphql_path
,landing_page
, andintrospection
. Additionally,preview_defer_support
has moved, but is on by default and no longer necessary to be set explicitly unless you wish to disable it.As another section (below) notes, we have removed the health check and instead recommend users to configure their health checks (in, e.g, Kubernetes, Docker, etc.) to use a simple GraphQL query:
/?query={__typename}
. Read more about that in the other section, however this is reflected by its removal in the configuration.To exemplify the changes, this previous configuration will turn into the configuration that follows it:
Before
After
By @o0Ignition0o in #1718
Environment variable expansion adjustments (#1759)
Environment expansions must be prefixed with
env.
.File expansions must be prefixed with
file.
.The "default" designator token changes from
:
to:-
. For example:${env.USER_NAME:Nandor}
=>${env.USER_NAME:-Nandor}
Failed expansions now result in an error
Previously expansions that failed due to missing environment variables were silently skipped. Now they result in a configuration error. Add a default value using the above syntax if optional expansion is needed.
By @BrynCooke in #1763
Dedicated health check endpoint removed with new recommendation to use
/query={__typename}
query (Issue #1765)We have removed the dedicated health check endpoint and now recommend users to configure their health checks (in, e.g, Kubernetes, Docker) to use a simple GraphQL query instead.
Use the following query with a
content-type: application/json
header as a health check instead of/.well-known/apollo/server-health
:The Kubernetes documentation and related Helm charts have been updated to reflect this change.
Using this query has the added benefit of actually testing GraphQL. If this query returns with an HTTP 200 OK, it is just as reliable (and even more meaningful) than the previous
/.well-known/apollo/server-health
endpoint. It's important to include thecontent-type: application/json
header to satisfy the Router's secure requirements that offer CSRF protections.In the future, we will likely reintroduce a dedicated health check "liveliness" endpoint along with a meaningful "readiness" health check at the same time. In the meantime, the query above is technically more durable than the health check we offered previously.
By @abernix in https://github.com/apollographql/router/pull/TODO
Promote
include_subgraph_errors
out of "experimental" status (Issue #1773)The
include_subraph_errors
plugin has been promoted out of "experimental" and will require a small configuration changes. For example:By @garypen in #1776
apollo-spaceport
anduplink
are now part ofapollo-router
(Issue #491)Instead of being dependencies, they are now part of the
apollo-router
crate. They were not meant to be used independently.By @SimonSapin in #1751
Remove over-exposed functions from the public API (PR #1746)
The following functions are only required for router implementation, so removing from external API:
By @garypen in #1746
Span
client_name
andclient_version
attributes renamed (#1514)OpenTelemetry attributes should be grouped by
.
rather than_
, therefore the following attributes have changed:client_name
=>client.name
client_version
=>client.version
By @BrynCooke in #1514
Otel configuration updated to use expansion (#1772)
File and env access in configuration now use the generic expansion mechanism introduced in #1759.
Becomes:
or
By @BrynCooke in #1774
🚀 Features
Adds a development mode that can be enabled with the
--dev
flag (#1474)By default, the Apollo Router is configured with production best-practices. When developing, it is often desired to have some of those features relaxed to make it easier to iterate. A
--dev
flag has been introduced to make the user experience easier while maintaining a default configuration which targets a productionized environment.The
--dev
mode will enable a few options for development which are not normally on by default:--hot-reload
when running without--dev
)Additional considerations will be made in the future as we introduce new features that might necessitate a "development" workflow which is different than the default mode of operation. We will try to minimize these differences to avoid surprises in a production deployment while providing an execellent development experience. In the future, the (upcoming)
rover dev
experience will become our suggested pattern, but this should serve the purpose in the near term.By @bnjjj and @EverlastingBugstopper and @abernix in #1748
Apollo Studio Federated Tracing (#1514)
Add support of federated tracing in Apollo Studio:
By @BrynCooke & @bnjjj & @o0Ignition0o in #1514
Provide access to the supergraph SDL from rhai scripts (Issue #1735)
There is a new global constant
apollo_sdl
which can be use to read thesupergraph SDL as a string.
By @garypen in #1737
Add support for
tokio-console
(PR #1632)To aid in debugging the router, this adds support for tokio-console, enabled by a Cargo feature.
To run the router with tokio-console, build it with
RUSTFLAGS="--cfg tokio_unstable" cargo run --features console
.By @Geal in #1632
Restore the ability to specify custom schema and configuration sources (#1733)
You may now, once again, specify custom schema and config sources when constructing an executable. We had previously omitted this behavior in our API pruning with the expectation that it was still possible to specify via command line arguments and we almost immediately regretted it. We're happy to have it back!
By @BrynCooke in #1734
Environment variable expansion prefixing (#1759)
The environment variable
APOLLO_ROUTER_CONFIG_ENV_PREFIX
can be used to prefix environment variable lookups during configuration expansion. This feature is undocumented and unsupported and may change at any time. We do not recommend using this.For example:
APOLLO_ROUTER_CONFIG_ENV_PREFIX=MY_PREFIX
Would cause:
${env.FOO}
to be mapped to${env.MY_PREFIX_FOO}
when expansion is performed.By @BrynCooke in #1763
Environment variable expansion mode configuration (#1772)
The environment variable
APOLLO_ROUTER_CONFIG_SUPPORTED_MODES
can be used to restrict which modes can be used for environment expansion. This feature is undocumented and unsupported and may change at any time. We do not recommend using this.For example:
APOLLO_ROUTER_CONFIG_SUPPORTED_MODES=env,file
env and file expansionAPOLLO_ROUTER_CONFIG_SUPPORTED_MODES=env
- only env variable expansion allowedBy @BrynCooke in #1774
🐛 Fixes
Support execution of the bare
__typename
field (Issue #1761)For queries like
query { __typename }
, we now perform the expected behavior and return a GraphQL response even if the introspection has been disabled. (introspection: false
should only apply to schema introspeciton not type-name introspection.)By @bnjjj in #1762
Set
hasNext
for the last chunk of a deferred response (#1687 #1745)There will no longer be an empty last response
{"hasNext": false}
and thehasNext
field will be set on the last deferred response. There can still be one edge case where that empty message can occur, if some deferred queries were cancelled too quickly. Generally speaking, clients should expect this to happen to allow future behaviors and this is specified in the@defer
draft specification.By @bnjjj in #1687
By @Geal in #1745
🛠 Maintenance
Add errors vec in
QueryPlannerResponse
to handle errors inquery_planning_service
(PR #1504)We changed
QueryPlannerResponse
to:Vec<apollo_router::graphql::Error>
Vec
This should improve the messages returned during query planning.
By @bnjjj in #1504
Store the Apollo usage reporting Protobuf interface file in the repository
Previously this file was downloaded when compiling the Router, but we had no good way to automatically check when to re-download it without causing the Router to be compiled all the time.
Instead a copy now resides in the repository, with a test checking that it is up to date. This file can be updated by running this command then sending a PR:
By @SimonSapin
Disable compression on
multipart/mixed
HTTP responses (Issue #1572)The Router now reverts to using unpatched
async-compression
, and instead disables compression of multipart responses. We aim to re-enable compression soon, with a proper solution that is being designed in Nullus157/async-compression#154.As context to why we've made this change: features such as
@defer
require the Apollo Router to send a stream of multiple GraphQL responses in a single HTTP response with the body being a single byte stream. Due to current limitations with our upstream compression library, that entire byte stream is compressed as a whole, which causes the entire deferred response to be held back before being returned. This obviously isn't ideal for the@defer
feature which tries to get reponses to client soon possible.This change replaces our previous work-around which involved a patched
async-compression
, which was not trivial to apply when using the Router as a dependency since Cargo patching is done in a project’s rootCargo.toml
.Again, we aim to re-visit this as soon as possible but found this to be the more approachable work-around.
By @SimonSapin in #1749