Skip to content

Commit

Permalink
Merge pull request #5136 from apollographql/release-2.24.0
Browse files Browse the repository at this point in the history
Release 2.24.0
  • Loading branch information
glasser committed Apr 30, 2021
2 parents c0265ac + f2349d0 commit 8d45c2e
Show file tree
Hide file tree
Showing 41 changed files with 7,389 additions and 167 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
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
28 changes: 14 additions & 14 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/apollo-cache-control/package.json
@@ -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
@@ -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
2 changes: 1 addition & 1 deletion packages/apollo-datasource/package.json
@@ -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
@@ -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
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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
2 changes: 1 addition & 1 deletion packages/apollo-server-core/package.json
@@ -1,6 +1,6 @@
{
"name": "apollo-server-core",
"version": "2.23.0",
"version": "2.24.0",
"description": "Core engine for Apollo GraphQL server",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/plugin/traceTreeBuilder.ts
Expand Up @@ -261,7 +261,7 @@ function errorToProtobufError(error: GraphQLError): Trace.Error {
}

// Converts a JS Date into a Timestamp.
function dateToProtoTimestamp(date: Date): google.protobuf.Timestamp {
export function dateToProtoTimestamp(date: Date): google.protobuf.Timestamp {
const totalMillis = +date;
const millis = totalMillis % 1000;
return new google.protobuf.Timestamp({
Expand Down

0 comments on commit 8d45c2e

Please sign in to comment.