Skip to content

Commit

Permalink
[ez][bot] Disable bot to not add triaged if oncall: pt2 label is pres…
Browse files Browse the repository at this point in the history
…ent (#4898)

Only impacts disable bot, there might be other bots that auto add
triaged label but I can't find them
  • Loading branch information
clee2000 authored Jan 19, 2024
1 parent ba88604 commit 9178476
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion torchci/pages/api/flaky-tests/disable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion torchci/test/disableFlakyBot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

1 comment on commit 9178476

@vercel
Copy link

@vercel vercel bot commented on 9178476 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.