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

chore: deps updates #260

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,30 @@
"prepare": "husky install"
},
"dependencies": {
"fs-extra": "^7.0.0",
"fs-extra": "^11.1.1",
"global-agent": "^3.0.0",
"node-fetch": "^2.6.7",
"probot": "^12.2.8",
"prom-client": "^13.1.0",
"queue": "^4.5.0",
"simple-git": "3.16.0",
"what-the-diff": "^0.4.0",
"probot": "^12.3.1",
"prom-client": "^14.2.0",
"queue": "^6.0.0",
"simple-git": "3.19.1",
"what-the-diff": "^0.6.0",
"yaml": "^2.3.1"
},
"devDependencies": {
"@types/bunyan": "^1.8.5",
"@types/fs-extra": "^5.0.1",
"@types/fs-extra": "^11.0.1",
"@types/jest": "^29.0.0",
"@types/node": "^18.11.8",
"@types/node-fetch": "^2.5.4",
"@types/pino-std-serializers": "^4.0.0",
"@types/sinon": "^5.0.5",
"@types/sinon": "^10.0.15",
"husky": "^6.0.0",
"jest": "^29.0.0",
"lint-staged": "^10.4.2",
"nock": "^13.2.9",
"prettier": "^2.0.5",
"sinon": "^7.5.0",
"smee-client": "^1.0.1",
"prettier": "^3.0.0",
"sinon": "^15.2.0",
"smee-client": "^1.2.3",
"ts-jest": "^29.0.0",
"tslint": "^5.20.1",
"tslint-config-airbnb": "^5.11.2",
Expand Down
18 changes: 10 additions & 8 deletions spec/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ describe('trop', () => {
data: [
{
id: 208045946,
url:
'https://api.github.com/repos/octocat/Hello-World/labels/bug',
url: 'https://api.github.com/repos/octocat/Hello-World/labels/bug',
name: 'bug',
description: "Something isn't working",
color: 'f29513',
Expand Down Expand Up @@ -244,8 +243,9 @@ describe('trop', () => {

await robot.receive(event);

const updatePayload = (checkUtils.updateBackportInformationCheck as jest.Mock)
.mock.calls[0][2];
const updatePayload = (
checkUtils.updateBackportInformationCheck as jest.Mock
).mock.calls[0][2];

expect(updatePayload).toMatchObject({
title: 'Conflicting Backport Information',
Expand All @@ -268,8 +268,9 @@ describe('trop', () => {

await robot.receive(event);

const updatePayload = (checkUtils.updateBackportInformationCheck as jest.Mock)
.mock.calls[0][2];
const updatePayload = (
checkUtils.updateBackportInformationCheck as jest.Mock
).mock.calls[0][2];

expect(updatePayload).toMatchObject({
title: 'Backport Information Provided',
Expand All @@ -291,8 +292,9 @@ describe('trop', () => {

await robot.receive(event);

const updatePayload = (checkUtils.updateBackportInformationCheck as jest.Mock)
.mock.calls[0][2];
const updatePayload = (
checkUtils.updateBackportInformationCheck as jest.Mock
).mock.calls[0][2];

expect(updatePayload).toMatchObject({
title: 'Backport Information Provided',
Expand Down
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,7 @@ const probotHandler: ApplicationFunction = async (robot, { getRouter }) => {
await context.octokit.issues.createComment(
context.repo({
issue_number: issue.number,
body:
'This PR has not been merged yet, and cannot be backported.',
body: 'This PR has not been merged yet, and cannot be backported.',
}),
);
return false;
Expand All @@ -554,8 +553,7 @@ const probotHandler: ApplicationFunction = async (robot, { getRouter }) => {
).data as WebHookPR;
await context.octokit.issues.createComment(
context.repo({
body:
'The backport process for this PR has been manually initiated - here we go! :D',
body: 'The backport process for this PR has been manually initiated - here we go! :D',
issue_number: issue.number,
}),
);
Expand Down
15 changes: 7 additions & 8 deletions src/operations/update-manual-backport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,13 @@ please check out #${pr.number}`;

// TODO(codebytere): Once probot updates to @octokit/rest@16 we can use .paginate to
// get all the comments properly, for now 100 should do
const {
data: existingComments,
} = await context.octokit.issues.listComments(
context.repo({
issue_number: oldPRNumber,
per_page: 100,
}),
);
const { data: existingComments } =
await context.octokit.issues.listComments(
context.repo({
issue_number: oldPRNumber,
per_page: 100,
}),
);

// We should only comment if there is not a previous existing comment
const shouldComment = !existingComments.some(
Expand Down
13 changes: 5 additions & 8 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fetch from 'node-fetch';
import * as fs from 'fs-extra';
import { IQueue } from 'queue';
import Queue from 'queue';
import simpleGit from 'simple-git';

import queue from './Queue';
Expand Down Expand Up @@ -29,7 +29,6 @@ import {
} from './types';
import { Context, Probot } from 'probot';

const makeQueue: IQueue = require('queue');
const { parse: parseDiff } = require('what-the-diff');

const backportViaAllHisto = new client.Histogram({
Expand Down Expand Up @@ -116,8 +115,7 @@ const tryBackportAllCommits = async (opts: TryBackportOptions) => {
await context.octokit.issues.createComment(
context.repo({
issue_number: opts.pr.number,
body:
'This PR has exceeded the automatic backport commit limit \
body: 'This PR has exceeded the automatic backport commit limit \
and must be performed manually.',
}),
);
Expand All @@ -132,7 +130,7 @@ and must be performed manually.',
);

const patches: string[] = new Array(commits.length).fill('');
const q = makeQueue({ concurrency: 5 });
const q = new Queue({ concurrency: 5 });
q.stop();

for (const [i, commit] of commits.entries()) {
Expand Down Expand Up @@ -357,9 +355,8 @@ const checkUserHasWriteAccess = async (
);

const params = context.repo({ username: user });
const {
data: userInfo,
} = await context.octokit.repos.getCollaboratorPermissionLevel(params);
const { data: userInfo } =
await context.octokit.repos.getCollaboratorPermissionLevel(params);

// Possible values for the permission key: 'admin', 'write', 'read', 'none'.
// In order for the user's review to count, they must be at least 'write'.
Expand Down
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2018",
"target": "ES2020",
"outDir": "lib",
"lib": [
"ESNext"
"ES2022",
"ESNext",
"dom",
],
"sourceMap": true,
"rootDir": "src",
Expand Down
Loading
Loading