Skip to content

Commit

Permalink
feat(deps): update dependency probot to v13 (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] committed Feb 17, 2024
1 parent 8bc2d75 commit 2e570c5
Show file tree
Hide file tree
Showing 153 changed files with 536 additions and 712 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -61,22 +61,22 @@
"@commitlint/config-conventional": "18.4.3",
"@commitlint/lint": "18.4.3",
"@commitlint/parse": "18.4.3",
"@octokit/core": "3.6.0",
"@octokit/rest": "18.12.0",
"@octokit/webhooks": "9.26.3",
"@octokit/core": "5.0.2",
"@octokit/rest": "20.0.2",
"@octokit/webhooks": "12.0.10",
"@slack/web-api": "6.12.0",
"@tryfabric/mack": "1.2.1",
"body-parser": "1.20.2",
"conventional-changelog-conventionalcommits": "7.0.2",
"cookie-parser": "1.4.6",
"delay": "6.0.0",
"dotenv": "8.6.0",
"dotenv": "16.4.4",
"emoji-regex": "10.3.0",
"issue-parser": "6.0.0",
"jsonwebtoken": "9.0.2",
"liwi-mongo": "11.0.0",
"lock": "1.1.0",
"probot": "12.3.3",
"probot": "13.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"simple-oauth2": "5.0.0",
Expand All @@ -103,7 +103,7 @@
"check-package-dependencies": "7.0.0",
"eslint": "8.56.0",
"jest": "29.7.0",
"nock": "13.5.1",
"nock": "14.0.0-beta.2",
"pob-babel": "38.0.2",
"smee-client": "2.0.0",
"type-fest": "4.10.2",
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-package.js
Expand Up @@ -7,7 +7,7 @@ await createCheckPackage()
.checkSatisfiesVersionsFromDependency('probot', {
dependencies: ['@octokit/core', '@octokit/webhooks'],
})
.checkSatisfiesVersionsBetweenDependencies('probot', '@octokit/rest', {
.checkSatisfiesVersionsBetweenDependencies('@octokit/rest', 'probot', {
dependencies: [
'@octokit/plugin-rest-endpoint-methods',
'@octokit/plugin-paginate-rest',
Expand Down
9 changes: 6 additions & 3 deletions src/__fixtures__/pull_request_30.opened.json
Expand Up @@ -172,7 +172,8 @@
"default_branch": "master",
"is_template": false,
"topics": [],
"visibility": "public"
"visibility": "public",
"web_commit_signoff_required": false
}
},
"base": {
Expand Down Expand Up @@ -294,7 +295,8 @@
"default_branch": "master",
"is_template": false,
"topics": [],
"visibility": "public"
"visibility": "public",
"web_commit_signoff_required": false
}
},
"_links": {
Expand Down Expand Up @@ -436,7 +438,8 @@
"delete_branch_on_merge": true,
"is_template": false,
"topics": [],
"visibility": "public"
"visibility": "public",
"web_commit_signoff_required": false
},
"organization": {
"login": "reviewflow",
Expand Down
12 changes: 6 additions & 6 deletions src/context/repoContext.ts
Expand Up @@ -356,16 +356,16 @@ async function initRepoContext<
): Promise<void> => {
let lockMergePr = automergeQueue[0];
if (lockMergePr && String(lockMergePr.number) === String(pr.number)) {
removePrContext.log(
removePrContext.log.info(
`merge lock: remove ${fullName}#${pr.number}: ${reason}`,
);
automergeQueue.shift();
lockMergePr = automergeQueue[0];
if (!lockMergePr) {
removePrContext.log(`merge lock: nothing next ${fullName}`);
removePrContext.log.info(`merge lock: nothing next ${fullName}`);
await updateAutomergeQueueInDb(automergeQueue);
} else {
removePrContext.log(lockMergePr, `merge lock: next ${fullName}`);
removePrContext.log.info(lockMergePr, `merge lock: next ${fullName}`);
await Promise.all([
// eslint-disable-next-line @typescript-eslint/no-use-before-define
reschedule(removePrContext, lockMergePr, 'short'),
Expand All @@ -378,7 +378,7 @@ async function initRepoContext<
(value) => String(value.number) !== String(pr.number),
);
if (automergeQueue.length !== previousLength) {
removePrContext.log(
removePrContext.log.info(
`merge lock: remove ${fullName}#${pr.number}: ${reason}`,
);
await updateAutomergeQueueInDb(automergeQueue);
Expand Down Expand Up @@ -524,7 +524,7 @@ async function initRepoContext<
},
removePrFromAutomergeQueue,
pushAutomergeQueue: async (pr: LockedMergePr): Promise<void> => {
context.log(
context.log.info(
{
repo: fullName,
pr,
Expand Down Expand Up @@ -565,7 +565,7 @@ export const obtainRepoContext = <T extends EventsWithRepository>(
let accountConfig = accountConfigs[owner.login];

if (!accountConfig) {
context.log(`using default config for ${owner.login}`);
context.log.info(`using default config for ${owner.login}`);
accountConfig = defaultConfig;
}

Expand Down
14 changes: 7 additions & 7 deletions src/context/slack/initTeamSlack.ts
Expand Up @@ -99,7 +99,7 @@ export const initTeamSlack = async <TeamNames extends string>(
});
return im.channel;
} catch (error) {
context.log('could create im', { err: error });
context.log.error('could create im', { err: error });
}
};

Expand Down Expand Up @@ -157,7 +157,7 @@ export const initTeamSlack = async <TeamNames extends string>(
}

const user = membersMap.get(toUser.login);
if (!user || !user.slackClient || !user.im) return null;
if (!user?.slackClient || !user.im) return null;

const result = await user.slackClient.chat.postMessage({
username: process.env.REVIEWFLOW_NAME,
Expand Down Expand Up @@ -190,7 +190,7 @@ export const initTeamSlack = async <TeamNames extends string>(
if (process.env.DRY_RUN && process.env.DRY_RUN !== 'false') return null;

const user = membersMap.get(toUser.login);
if (!user || !user.slackClient || !user.im) return null;
if (!user?.slackClient || !user.im) return null;

try {
const result = await user.slackClient.chat.update({
Expand Down Expand Up @@ -221,7 +221,7 @@ export const initTeamSlack = async <TeamNames extends string>(
context.log.debug({ ts, channel }, 'slack: delete message');

const user = membersMap.get(toUser.login);
if (!user || !user.slackClient || !user.im) return;
if (!user?.slackClient || !user.im) return;

await user.slackClient.chat.delete({
ts,
Expand All @@ -237,7 +237,7 @@ export const initTeamSlack = async <TeamNames extends string>(
context.log.debug({ ts, channel, name }, 'slack: add reaction');

const user = membersMap.get(toUser.login);
if (!user || !user.slackClient || !user.im) return;
if (!user?.slackClient || !user.im) return;

try {
await user.slackClient.reactions.add({
Expand All @@ -256,7 +256,7 @@ export const initTeamSlack = async <TeamNames extends string>(
context.log.debug({ githubLogin }, 'update slack home');

const user = membersMap.get(githubLogin);
if (!user || !user.slackClient || !user.member) return;
if (!user?.slackClient || !user.member) return;

slackHome.scheduleUpdateMember(context.octokit, user.slackClient, {
user: { id: user.member.userGithubId, login: githubLogin },
Expand All @@ -274,7 +274,7 @@ export const initTeamSlack = async <TeamNames extends string>(
'user.id': userId,
});

if (!member || !member.slack) return;
if (!member?.slack) return;

const slackClient = getSlackClient(member.slack.teamId);
if (slackClient) {
Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/actions/utils/createStatus.ts
Expand Up @@ -12,7 +12,7 @@ export default async function createStatus<
): Promise<void> {
let description = status.title;
if (description.length > 140) {
context.log('description too long', { description });
context.log.warn('description too long', { description });
description = description.slice(0, 140);
}

Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/closed.ts
Expand Up @@ -49,7 +49,7 @@ export default function closed(app: Probot, appContext: AppContext): void {
);

if ((pullRequest as any).merged) {
const isNotFork = pullRequest.head.repo.id === repo.id;
const isNotFork = pullRequest.head.repo?.id === repo.id;
const options = parseOptions(
reviewflowPrContext.commentBody,
repoContext.config.prDefaultOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/opened.test.ts
Expand Up @@ -71,7 +71,7 @@ describe('opened', (): void => {

.post(
'/repos/reviewflow/reviewflow-test/issues/30/labels',
'[":ok_hand: code/needs-review"]',
'{"labels":[":ok_hand: code/needs-review"]}',
)
.reply(200, [
{
Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/readyForReview.test.ts
Expand Up @@ -57,7 +57,7 @@ describe('edited', (): void => {

.post(
'/repos/reviewflow/reviewflow-test/issues/54/labels',
'[":ok_hand: code/needs-review"]',
'{"labels":[":ok_hand: code/needs-review"]}',
)
.reply(200, [
{
Expand Down
8 changes: 7 additions & 1 deletion src/tests/setup.ts
@@ -1,7 +1,7 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { jest } from '@jest/globals';
import nock from 'nock';
import { Probot } from 'probot';
import { Probot, ProbotOctokit } from 'probot';
import repoLabels from '../__fixtures__/labels.json';
import { createEmptyReviews } from '../events/pr-handlers/utils/groupReviewsWithState';
import initApp from '../initApp';
Expand All @@ -12,6 +12,7 @@ jest.setTimeout(30_000);

process.env.REVIEWFLOW_NAME = 'reviewflow-dev';
const APP_ID = 1;

nock.disableNetConnect();

export const initializeProbotApp = async ({
Expand All @@ -26,6 +27,11 @@ export const initializeProbotApp = async ({
appId: APP_ID,
privateKey: 'test',
githubToken: 'test',
// Disable throttling & retrying requests for easier testing
Octokit: ProbotOctokit.defaults({
retry: { enabled: false },
throttle: { enabled: false },
}),
});
const mockStores = {
orgs: {
Expand Down

0 comments on commit 2e570c5

Please sign in to comment.