From 5554e3dec7a54828aeae2a35a29199d5f51e5067 Mon Sep 17 00:00:00 2001 From: shikajiro Date: Tue, 27 Feb 2024 17:18:24 +0900 Subject: [PATCH 1/3] =?UTF-8?q?label=E3=81=AE=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/repository/chatwork.ts | 40 ++++++++------------------------------ src/usecase.ts | 6 ------ 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/src/repository/chatwork.ts b/src/repository/chatwork.ts index ae3bf6a..002b65f 100644 --- a/src/repository/chatwork.ts +++ b/src/repository/chatwork.ts @@ -32,41 +32,17 @@ export const ChatworkRepositoryImpl = { roomId: string, accountId: string, message: string, - labels: string[], ): Promise => { - const isHurry = labels.find((label) => label === "hurry"); - const is2days = labels.find((label) => label === "2days"); let limit = 0; const now = new Date(); - if (isHurry !== undefined) { - limit = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate(), - 23, - 59, - 59, - ).getTime(); - } else if (is2days !== undefined) { - limit = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate() + 2, - 23, - 59, - 59, - ).getTime(); - } else { - // is2weeks or default - limit = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate() + 14, - 23, - 59, - 59, - ).getTime(); - } + limit = new Date( + now.getFullYear(), + now.getMonth(), + now.getDate() + 14, + 23, + 59, + 59, + ).getTime(); const encodedParams = new URLSearchParams(); encodedParams.set("body", message); encodedParams.set("to_ids", accountId); diff --git a/src/usecase.ts b/src/usecase.ts index c480b99..58767c8 100644 --- a/src/usecase.ts +++ b/src/usecase.ts @@ -44,11 +44,6 @@ export const execPrReviewRequestedMention = async ( } core.info(`reviewers ${reviewers}`); - core.info(`labels ${payload.pull_request?.labels[0]?.name}`); - const labels = payload.pull_request?.labels?.map( - (label: any) => label.name, - ) as string[]; - const slackIds = convertToChatworkUsername(reviewers, mapping); if (slackIds.length === 0) { core.info( @@ -87,7 +82,6 @@ export const execPrReviewRequestedMention = async ( account.room_id, account.account_id, message, - labels, ); } }; From 9ddc8fb2f29f00b3a62e8ffc61a4fcd598bc38bc Mon Sep 17 00:00:00 2001 From: shikajiro Date: Tue, 27 Feb 2024 17:32:29 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .coderabbit.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..9e82aec --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,29 @@ +language: "ja" +early_access: false +reviews: + request_changes_workflow: false + high_level_summary: true + poem: true + review_status: true + collapse_walkthrough: false + path_filters: + - "!**/.xml" + path_instructions: + - path: "**/*.js" + instructions: "Review the JavaScript code for conformity with the Google JavaScript style guide, highlighting any deviations." + - path: "tests/**/*" + instructions: | + "Assess the unit test code employing the Mocha testing framework. Confirm that: + - The tests adhere to Mocha's established best practices. + - Test descriptions are sufficiently detailed to clarify the purpose of each test." + auto_review: + enabled: true + ignore_title_keywords: + - "WIP" + - "DO NOT MERGE" + drafts: false + base_branches: + - "develop" + - "feat/.*" +chat: + auto_reply: true \ No newline at end of file From f2c4006d3eda784bc888bc3dedcdeb15db0f0b8b Mon Sep 17 00:00:00 2001 From: shikajiro Date: Tue, 27 Feb 2024 17:59:07 +0900 Subject: [PATCH 3/3] =?UTF-8?q?utc=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/repository/chatwork.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/repository/chatwork.ts b/src/repository/chatwork.ts index 002b65f..43e7476 100644 --- a/src/repository/chatwork.ts +++ b/src/repository/chatwork.ts @@ -33,16 +33,15 @@ export const ChatworkRepositoryImpl = { accountId: string, message: string, ): Promise => { - let limit = 0; const now = new Date(); - limit = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate() + 14, + const limit = Date.UTC( + now.getUTCFullYear(), + now.getUTCMonth(), + now.getUTCDate() + 14, 23, 59, - 59, - ).getTime(); + 59 + ); const encodedParams = new URLSearchParams(); encodedParams.set("body", message); encodedParams.set("to_ids", accountId);