-
Notifications
You must be signed in to change notification settings - Fork 2k
Integration testsuite direct dependency on Apollo Server #7114
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
Conversation
The peer dependency arrangement of testsuite on server was problematic. In one sense, it seems reasonable since we want integration authors to bring their own AS package. However, bumping that peer dependency with every version update is technically a breaking change - and our release tooling (changeset) doesn't provide us a means to workaround the behavior where it major version bumps both packages. For correctness and compliance with our tooling, a direct dependency addresses both concerns. We've also added an additional test which ensures that the versions match. The test really just validates that there's one install of @apollo/server (by using an instanceof check against the testsuite's ApolloServer constructor and the actual instance provided by the testsuite consumer).
✅ Deploy Preview for apollo-server-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Add a "Fixes #7109"? |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1327636:
|
@@ -28,6 +28,7 @@ | |||
"dependencies": { | |||
"@apollo/cache-control-types": "^1.0.2", | |||
"@apollo/client": "^3.6.9", | |||
"@apollo/server": "^4.0.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be precise rather than caret?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This test ensures that consumers of this testsuite are using the lockstep | ||
// versioned packages of @apollo/server and | ||
// @apollo/server-integration-testsuite. If these versions are out of sync, | ||
// this test should fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if the comment and/or test name could be more clear/verbose here. Does saying something like "It looks like you have multiple copies of @apollo/server
installed in your project. @apollo/server-integration-testsuite
always installs a copy of @apollo/server
with a precisely matching version number; have you installed @apollo/server
and @apollo/server-integration-testsuite
with non-matching versions?" help? (I don't know how to print custom error messages though... I guess just manually throwing an Error.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, throwing an error here now (but still running the expect for the known-passing case).
This reverts commit 44ca8e8.
To validate the case where this new test fails, I:
|
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @apollo/server-integration-testsuite@4.1.0 ### Minor Changes - [`2a2d1e3b4`](2a2d1e3) Thanks [@glasser](https://github.com/glasser)! - The `cache-control` HTTP response header set by the cache control plugin now properly reflects the cache policy of all operations in a batched HTTP request. (If you write the `cache-control` response header via a different mechanism to a format that the plugin would not produce, the plugin no longer writes the header.) For more information, see [advisory GHSA-8r69-3cvp-wxc3](GHSA-8r69-3cvp-wxc3). - [`2a2d1e3b4`](2a2d1e3) Thanks [@glasser](https://github.com/glasser)! - Plugins processing multiple operations in a batched HTTP request now have a shared `requestContext.request.http` object. Changes to HTTP response headers and HTTP status code made by plugins operating on one operation can be immediately seen by plugins operating on other operations in the same HTTP request. - [`2a2d1e3b4`](2a2d1e3) Thanks [@glasser](https://github.com/glasser)! - New field `GraphQLRequestContext.requestIsBatched` available to plugins. - [#7114](#7114) [`c1651bfac`](c1651bf) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Directly depend on Apollo Server rather than as a peer ### Patch Changes - Updated dependencies \[[`2a2d1e3b4`](2a2d1e3), [`2a2d1e3b4`](2a2d1e3), [`2a2d1e3b4`](2a2d1e3)]: - @apollo/server@4.1.0 ## @apollo/server@4.1.0 ### Minor Changes - [`2a2d1e3b4`](2a2d1e3) Thanks [@glasser](https://github.com/glasser)! - The `cache-control` HTTP response header set by the cache control plugin now properly reflects the cache policy of all operations in a batched HTTP request. (If you write the `cache-control` response header via a different mechanism to a format that the plugin would not produce, the plugin no longer writes the header.) For more information, see [advisory GHSA-8r69-3cvp-wxc3](GHSA-8r69-3cvp-wxc3). - [`2a2d1e3b4`](2a2d1e3) Thanks [@glasser](https://github.com/glasser)! - Plugins processing multiple operations in a batched HTTP request now have a shared `requestContext.request.http` object. Changes to HTTP response headers and HTTP status code made by plugins operating on one operation can be immediately seen by plugins operating on other operations in the same HTTP request. - [`2a2d1e3b4`](2a2d1e3) Thanks [@glasser](https://github.com/glasser)! - New field `GraphQLRequestContext.requestIsBatched` available to plugins. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The peer dependency arrangement of testsuite on server was problematic. In one sense, it seems reasonable since we want integration authors to bring their own AS package. However, bumping that peer dependency with every version update is technically a breaking change - and our release tooling (changeset) doesn't provide us a means to workaround the behavior where it major version bumps both packages.
For correctness and compliance with our tooling, a direct dependency addresses both concerns. We've also added an additional test which ensures that the versions match. The test really just validates that there's one install of @apollo/server (by using an instanceof check against the testsuite's ApolloServer constructor and the actual instance provided by the testsuite consumer).
Fixes #7109