From 91784762990829a2242d3d9e95dc03b540331f9c Mon Sep 17 00:00:00 2001 From: clee2000 <44682903+clee2000@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:44:02 -0800 Subject: [PATCH] [ez][bot] Disable bot to not add triaged if oncall: pt2 label is present (#4898) Only impacts disable bot, there might be other bots that auto add triaged label but I can't find them --- torchci/pages/api/flaky-tests/disable.ts | 7 ++++++- torchci/test/disableFlakyBot.test.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/torchci/pages/api/flaky-tests/disable.ts b/torchci/pages/api/flaky-tests/disable.ts index ab2af5e54d..43b7ae6ada 100644 --- a/torchci/pages/api/flaky-tests/disable.ts +++ b/torchci/pages/api/flaky-tests/disable.ts @@ -409,7 +409,12 @@ export async function getTestOwnerLabels( labels.push("module: unknown"); } - if (labels.some((x) => x.startsWith("module: ") && x !== "module: unknown")) { + if ( + labels.some((x) => x.startsWith("module: ") && x !== "module: unknown") && + !labels.includes("oncall: pt2") + ) { + // Add triaged if there is a module label and none of labels are oncall: pt2 + // (see https://github.com/pytorch/pytorch/issues/117846) labels.push("triaged"); } return { labels, additionalErrMessage }; diff --git a/torchci/test/disableFlakyBot.test.ts b/torchci/test/disableFlakyBot.test.ts index 8b9455ce49..243ed440d8 100644 --- a/torchci/test/disableFlakyBot.test.ts +++ b/torchci/test/disableFlakyBot.test.ts @@ -732,7 +732,7 @@ describe("Disable Flaky Test Bot Unit Tests", () => { let { labels, additionalErrMessage } = await disableFlakyTestBot.getTestOwnerLabels(test); expect(additionalErrMessage).toEqual(undefined); - expect(labels).toEqual(["module: fft", "oncall: pt2", "triaged"]); + expect(labels).toEqual(["module: fft", "oncall: pt2"]); handleScope(scope); });