From e23cceedf7078e6c30d1e575c33067a796eeffe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Wed, 13 Dec 2023 16:02:27 +0900 Subject: [PATCH] chore: add debugging logs --- src/handlers/wildcard/unassign/unassign.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/handlers/wildcard/unassign/unassign.ts b/src/handlers/wildcard/unassign/unassign.ts index efc08eaa5..bd8486c90 100644 --- a/src/handlers/wildcard/unassign/unassign.ts +++ b/src/handlers/wildcard/unassign/unassign.ts @@ -11,12 +11,20 @@ type IssuesListEventsResponseData = RestEndpointMethodTypes["issues"]["listEvent export async function checkTasksToUnassign(context: Context) { const logger = context.logger; + logger.debug("Checking tasks to unassign"); + const issuesAndPullsOpened = await listAllIssuesAndPullsForRepo(context, IssueType.OPEN); + + logger.debug("Fetched all issues and pulls opened", { issuesAndPullsOpened }); + const assignedIssues = issuesAndPullsOpened.filter((issue) => issue.assignee); const tasksToUnassign = await Promise.all( - assignedIssues.map(async (assignedIssue: GitHubIssue) => checkTaskToUnassign(context, assignedIssue)) + assignedIssues.map((assignedIssue: GitHubIssue) => checkTaskToUnassign(context, assignedIssue)) ); + + logger.debug("Checked tasks to unassign", { tasksToUnassign }); + logger.ok("Checked all the tasks to unassign", { tasksToUnassign: tasksToUnassign.filter(Boolean).map((task) => task?.metadata), });