Skip to content

Commit 2a08a48

Browse files
Merge pull request #26 from opentable/GP-361
[GP-361] Fix rlp-email-templates integration, allow to run Mercury in dev mode again.
2 parents 5ca19fc + f43c839 commit 2a08a48

File tree

5 files changed

+126
-42
lines changed

5 files changed

+126
-42
lines changed

package-lock.json

Lines changed: 115 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mercury-bot",
3-
"version": "3.0.3",
3+
"version": "3.1.0",
44
"description": "Mercury is a bot for managing in-code static translations",
55
"main": "src/app.js",
66
"scripts": {
@@ -45,7 +45,7 @@
4545
"sinon": "^7.4.2"
4646
},
4747
"dependencies": {
48-
"@octokit/rest": "16.28.9",
48+
"@octokit/rest": "^16.43.2",
4949
"async": "2.6.3",
5050
"base-64": "0.1.0",
5151
"config": "1.31.0",

src/resources/handle-pull-request.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
const MAX_ALLOWED_BODY_CHARS = 65536;
4+
35
const errorTypes = require('../constants/error-types');
46
const metadataFormatter = require('../utils/format-pr-metadata');
57

@@ -24,7 +26,7 @@ module.exports = ({ emitter, config }) => (repository, callback) => {
2426
head: `${config.github.owner}:${config.github.branch}`,
2527
title: pullRequestMetadata.title,
2628
base: repository.manifestContent.workingBranch,
27-
body: pullRequestMetadata.body
29+
body: pullRequestMetadata.body.length > MAX_ALLOWED_BODY_CHARS ? "This repository has too many translation files, Mercury can't return a status description with the PR." : pullRequestMetadata.body
2830
};
2931

3032
let handlePr;

src/services/github.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const _ = require('lodash');
44
const File = require('./github/file');
5-
const Octokit = require('@octokit/rest');
5+
const { Octokit } = require('@octokit/rest');
66
const PullRequest = require('./github/pull-request');
77
const RateLimit = require('./github/rate-limit');
88
const Reference = require('./github/reference');
@@ -47,7 +47,10 @@ module.exports = config => {
4747
readOctokit.git
4848
.getTree(options)
4949
.then(({ data }) => {
50-
next(null, _.map(data.tree, x => x.path));
50+
next(
51+
null,
52+
_.map(data.tree, x => x.path)
53+
);
5154
})
5255
.catch(err => next(err));
5356
});

src/services/github/rate-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const async = require('async');
4-
const Octokit = require('@octokit/rest');
4+
const { Octokit } = require('@octokit/rest');
55

66
module.exports = config => ({
77
get: next => {

0 commit comments

Comments
 (0)