diff --git a/src/helpers/remind-and-remove.ts b/src/helpers/remind-and-remove.ts index b0d634b..6fd57b0 100644 --- a/src/helpers/remind-and-remove.ts +++ b/src/helpers/remind-and-remove.ts @@ -25,7 +25,7 @@ export async function remindAssigneesForIssue(context: ContextPlugin, issue: Lis } else if (config.pullRequestRequired && !hasLinkedPr) { await unassignUserFromIssue(context, issue); } else { - logger.info(`Passed the reminder threshold on ${issue.html_url}, sending a reminder.`); + logger.info(`Passed the reminder threshold on ${issue.html_url} sending a reminder.`); await remindAssignees(context, issue); } } @@ -96,7 +96,9 @@ async function removeAllAssignees(context: ContextPlugin, issue: ListIssueForRep return false; } const logins = issue.assignees.map((o) => o?.login).filter((o) => !!o) as string[]; - const logMessage = logger.info(`Passed the deadline and no activity is detected, removing assignees: ${logins.map((o) => `@${o}`).join(", ")}.`); + const logMessage = logger.info(`Passed the deadline and no activity is detected, removing assignees: ${logins.map((o) => `@${o}`).join(", ")}.`, { + issue: issue.html_url, + }); const metadata = createStructuredMetadata(UNASSIGN_HEADER, logMessage); await octokit.rest.issues.createComment({ diff --git a/tests/main.test.ts b/tests/main.test.ts index 41f732f..6385aa8 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -122,7 +122,7 @@ describe("User start/stop", () => { expect(errorSpy).toHaveBeenCalledWith(`Failed to update activity for ${getIssueHtmlUrl(1)}, there is no assigned event.`); expect(infoSpy).toHaveBeenCalledWith(`Nothing to do for ${getIssueHtmlUrl(2)}, still within due-time.`); - expect(infoSpy).toHaveBeenCalledWith(`Passed the reminder threshold on ${getIssueHtmlUrl(3)}, sending a reminder.`); + expect(infoSpy).toHaveBeenCalledWith(`Passed the reminder threshold on ${getIssueHtmlUrl(3)} sending a reminder.`); expect(infoSpy).toHaveBeenCalledWith(`@user2, this task has been idle for a while. Please provide an update.\n\n`, { taskAssignees: [2], caller: STRINGS.LOGS_ANON_CALLER, @@ -138,7 +138,7 @@ describe("User start/stop", () => { await expect(run(context)).resolves.toEqual({ message: "OK" }); expect(infoSpy).toHaveBeenCalledWith(`Nothing to do for ${getIssueHtmlUrl(2)}, still within due-time.`); - expect(infoSpy).toHaveBeenCalledWith(`Passed the reminder threshold on ${getIssueHtmlUrl(3)}, sending a reminder.`); + expect(infoSpy).toHaveBeenCalledWith(`Passed the reminder threshold on ${getIssueHtmlUrl(3)} sending a reminder.`); expect(infoSpy).toHaveBeenCalledWith(`@user2, this task has been idle for a while. Please provide an update.\n\n`, { taskAssignees: [2], caller: STRINGS.LOGS_ANON_CALLER, @@ -157,7 +157,7 @@ describe("User start/stop", () => { await run(context); expect(infoSpy).toHaveBeenCalledWith(`Nothing to do for ${getIssueHtmlUrl(2)}, still within due-time.`); - expect(infoSpy).toHaveBeenCalledWith(`Passed the reminder threshold on ${getIssueHtmlUrl(3)}, sending a reminder.`); + expect(infoSpy).toHaveBeenCalledWith(`Passed the reminder threshold on ${getIssueHtmlUrl(3)} sending a reminder.`); expect(infoSpy).toHaveBeenCalledWith(`@user2, this task has been idle for a while. Please provide an update.\n\n`, { taskAssignees: [2], caller: STRINGS.LOGS_ANON_CALLER,