Skip to content
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 2.24.0 #5136

Merged
merged 11 commits into from
Apr 30, 2021
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ The version headers in this history reflect the versions of Apollo Server itself

> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. With few exceptions, the format of the entry should follow convention (i.e., prefix with package name, use markdown `backtick formatting` for package names and code, suffix with a link to the change-set à la `[PR #YYY](https://link/pull/YYY)`, etc.). When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.

## v2.24.0

- `apollo-server-core`: Apollo Studio usage reporting uses a more efficient format which sends fewer detailed traces to Apollo's server. This change should not have a major effect on the experience of using Apollo Studio. [PR #4142](https://github.com/apollographql/apollo-server/pull/4142)

## v2.23.0

- `apollo-server-core`: Add optional argument to `ApolloServer.executeOperation` allowing the caller to manually specify an argument to the `config` function analogous to that provided by integration packages. [PR #4166](https://github.com/apollographql/apollo-server/pull/4166) [Issue #2886](https://github.com/apollographql/apollo-server/issues/2886)
Expand Down
79 changes: 42 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"npm": "^6.14.11"
},
"dependencies": {
"@apollographql/apollo-tools": "0.4.14",
"@apollographql/apollo-tools": "0.5.0",
"apollo-cache-control": "file:packages/apollo-cache-control",
"apollo-datasource": "file:packages/apollo-datasource",
"apollo-datasource-rest": "file:packages/apollo-datasource-rest",
Expand Down Expand Up @@ -79,7 +79,7 @@
"@types/micro": "7.3.4",
"@types/nock": "10.0.3",
"@types/node": "8.10.65",
"@types/node-fetch": "2.5.8",
"@types/node-fetch": "2.5.10",
"@types/qs": "6.9.6",
"@types/qs-middleware": "1.0.1",
"@types/request": "2.48.5",
Expand Down Expand Up @@ -120,7 +120,7 @@
"memcached-mock": "0.1.0",
"mock-req": "0.2.0",
"nock": "10.0.6",
"node-fetch": "2.3.0",
"node-fetch": "2.6.1",
"prettier": "2.1.2",
"qs-middleware": "1.0.3",
"request": "2.88.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-cache-control/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-cache-control",
"version": "0.12.0",
"version": "0.13.0",
"description": "A GraphQL extension for cache control",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-datasource-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-datasource-rest",
"version": "0.12.0",
"version": "0.13.0",
"author": "Apollo <opensource@apollographql.com>",
"license": "MIT",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe('RESTDataSource', () => {

expect(fetch).toBeCalledTimes(1);
expect(fetch.mock.calls[0][0].url).toEqual('https://api.example.com/foo');
expect(fetch.mock.calls[0][0].body).toEqual(
expect(fetch.mock.calls[0][0].body.toString()).toEqual(
JSON.stringify({ foo: 'bar' }),
);
expect(fetch.mock.calls[0][0].headers.get('Content-Type')).toEqual(
Expand All @@ -285,7 +285,7 @@ describe('RESTDataSource', () => {

expect(fetch).toBeCalledTimes(1);
expect(fetch.mock.calls[0][0].url).toEqual('https://api.example.com/foo');
expect(fetch.mock.calls[0][0].body).toEqual(
expect(fetch.mock.calls[0][0].body.toString()).toEqual(
JSON.stringify(['foo', 'bar']),
);
expect(fetch.mock.calls[0][0].headers.get('Content-Type')).toEqual(
Expand Down Expand Up @@ -321,7 +321,7 @@ describe('RESTDataSource', () => {

expect(fetch).toBeCalledTimes(1);
expect(fetch.mock.calls[0][0].url).toEqual('https://api.example.com/foo');
expect(fetch.mock.calls[0][0].body).toEqual(
expect(fetch.mock.calls[0][0].body.toString()).toEqual(
JSON.stringify({ foo: 'bar' }),
);
expect(fetch.mock.calls[0][0].headers.get('Content-Type')).toEqual(
Expand Down Expand Up @@ -349,7 +349,7 @@ describe('RESTDataSource', () => {

expect(fetch).toBeCalledTimes(1);
expect(fetch.mock.calls[0][0].url).toEqual('https://api.example.com/foo');
expect(fetch.mock.calls[0][0].body).not.toEqual('{}');
expect(fetch.mock.calls[0][0].body.toString()).not.toEqual('{}');
expect(fetch.mock.calls[0][0].headers.get('Content-Type')).not.toEqual(
'application/json',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-datasource/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-datasource",
"version": "0.8.0",
"version": "0.9.0",
"author": "Apollo <opensource@apollographql.com>",
"license": "MIT",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions packages/apollo-reporting-protobuf/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "apollo-reporting-protobuf",
"version": "0.6.2",
"version": "0.7.0",
"description": "Protobuf format for Apollo usage reporting",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"clean": "git clean -fdX -- dist",
"prepare": "npm run clean && mkdir dist && npm run pbjs && npm run pbts && cp src/* dist",
"pbjs": "apollo-pbjs --target static-module --out dist/protobuf.js --wrap commonjs --force-number src/reports.proto",
"pbjs": "apollo-pbjs --target static-module --out dist/protobuf.js --wrap commonjs --force-number --no-from-object src/reports.proto",
"pbts": "apollo-pbts -o dist/protobuf.d.ts dist/protobuf.js",
"update-proto": "curl -sSfo src/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto"
},
Expand All @@ -29,6 +29,6 @@
},
"homepage": "https://github.com/apollographql/apollo-server#readme",
"dependencies": {
"@apollo/protobufjs": "^1.0.3"
"@apollo/protobufjs": "1.2.2"
}
}
23 changes: 2 additions & 21 deletions packages/apollo-reporting-protobuf/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,10 @@ const protobufJS = require('@apollo/protobufjs/minimal');

// Remove Long support. Our uint64s tend to be small (less
// than 104 days).
// XXX Just remove this in our fork? We already deleted
// the generation of Long in protobuf.d.ts in the fork.
// https://github.com/protobufjs/protobuf.js/issues/1253
protobufJS.util.Long = undefined;
protobufJS.configure();

// Override the generated protobuf Traces.encode function so that it will look
// for Traces that are already encoded to Buffer as well as unencoded
// Traces. This amortizes the protobuf encoding time over each generated Trace
// instead of bunching it all up at once at sendReport time. In load tests, this
// change improved p99 end-to-end HTTP response times by a factor of 11 without
// a casually noticeable effect on p50 times. This also makes it easier for us
// to implement maxUncompressedReportSize as we know the encoded size of traces
// as we go.
const originalTracesAndStatsEncode = protobuf.TracesAndStats.encode;
protobuf.TracesAndStats.encode = function(message, originalWriter) {
const writer = originalTracesAndStatsEncode(message, originalWriter);
const encodedTraces = message.encodedTraces;
if (encodedTraces != null && encodedTraces.length) {
for (let i = 0; i < encodedTraces.length; ++i) {
writer.uint32(/* id 1, wireType 2 =*/ 10);
writer.bytes(encodedTraces[i]);
}
}
return writer;
};

module.exports = protobuf;
6 changes: 5 additions & 1 deletion packages/apollo-reporting-protobuf/src/reports.proto
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ message ContextualizedStats {

// A sequence of traces and stats. An individual trace should either be counted as a stat or trace
message TracesAndStats {
repeated Trace trace = 1;
repeated Trace trace = 1 [(js_preEncoded)=true];
repeated ContextualizedStats stats_with_context = 2 [(js_use_toArray)=true];
// This field is used to validate that the algorithm used to construct `stats_with_context`
// matches similar algorithms in Apollo's servers. It is otherwise ignored and should not
// be included in reports.
repeated Trace internal_traces_contributing_to_stats = 3 [(js_preEncoded)=true];
}
2 changes: 1 addition & 1 deletion packages/apollo-server-azure-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-azure-functions",
"version": "2.23.0",
"version": "2.24.0",
"description": "Production-ready Node.js GraphQL server for Azure Functions",
"keywords": [
"GraphQL",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-cache-memcached/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-cache-memcached",
"version": "0.7.0",
"version": "0.8.0",
"author": "Apollo <opensource@apollographql.com>",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-cache-redis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-cache-redis",
"version": "1.4.0",
"version": "1.5.0",
"author": "Apollo <opensource@apollographql.com>",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-caching/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-caching",
"version": "0.6.0",
"version": "0.7.0",
"author": "Apollo <opensource@apollographql.com>",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-cloud-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-cloud-functions",
"version": "2.23.0",
"version": "2.24.0",
"description": "Production-ready Node.js GraphQL server for Google Cloud Functions",
"keywords": [
"GraphQL",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-cloudflare",
"version": "2.23.0",
"version": "2.24.0",
"description": "Production-ready Node.js GraphQL server for Cloudflare workers",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down