From 77414d0df86882346c63c43d3ecdc92bcb94ce5e Mon Sep 17 00:00:00 2001 From: Jake Awe Date: Wed, 27 Nov 2024 13:42:07 -0600 Subject: [PATCH] fix recently updated PR checker --- src/plugins/RecentlyUpdated/check_pr.ts | 6 +++--- test/fixtures/responses/list_pulls.json | 4 ++-- test/recently_updated.test.ts | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/RecentlyUpdated/check_pr.ts b/src/plugins/RecentlyUpdated/check_pr.ts index cb22f5b..04d1446 100644 --- a/src/plugins/RecentlyUpdated/check_pr.ts +++ b/src/plugins/RecentlyUpdated/check_pr.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createSetCommitStatus, isGPUTesterPR } from "../../shared"; +import { createSetCommitStatus, isRapidsBotPR } from "../../shared"; import { PRContext, PullsListResponseData } from "../../types"; import { Context } from "probot"; import { OpsBotPlugin } from "../../plugin"; @@ -40,8 +40,8 @@ export const checkPR = async function ( await setCommitStatus("Checking if PR has recent updates...", "pending"); - if (isGPUTesterPR(pr)) { - await setCommitStatus("Automated GPUTester PR detected", "success"); + if (isRapidsBotPR(pr)) { + await setCommitStatus("Automated rapids-bot PR detected", "success"); return; } diff --git a/test/fixtures/responses/list_pulls.json b/test/fixtures/responses/list_pulls.json index 589808a..b2b1ea2 100644 --- a/test/fixtures/responses/list_pulls.json +++ b/test/fixtures/responses/list_pulls.json @@ -25,9 +25,9 @@ "recently_updated": [ { "number": 1234, - "title": "[RELEASE] cuml v0.18", + "title": "Forward-merge branch-0.17 to branch-0.18 [skip ci]", "user": { - "login": "GPUtester" + "login": "rapids-bot[bot]" }, "labels": [{ "name": "breaking" }, { "name": "bug" }], "merged_at": "2021-01-27T13:38:56Z", diff --git a/test/recently_updated.test.ts b/test/recently_updated.test.ts index bffa489..7f23cb0 100644 --- a/test/recently_updated.test.ts +++ b/test/recently_updated.test.ts @@ -48,10 +48,10 @@ describe("Recently Updated", () => { ); }); - test("release PR", async () => { + test("Forward Merge PR", async () => { const context = makePRContext({ - title: "[RELEASE] cuml v0.18", - user: "GPUtester", + title: "Forward-merge branch-0.17 to branch-0.18 [skip ci]", + user: "rapids-bot[bot]", }); await new PRRecentlyUpdated(context).checkPR(); expect(mockCreateCommitStatus).toBeCalledTimes(2); @@ -61,7 +61,7 @@ describe("Recently Updated", () => { "https://docs.rapids.ai/resources/recently-updated/" ); expect(mockCreateCommitStatus.mock.calls[1][0].description).toBe( - "Automated GPUTester PR detected" + "Automated rapids-bot PR detected" ); }); @@ -124,7 +124,7 @@ describe("Recently Updated", () => { "https://docs.rapids.ai/resources/recently-updated/" ); expect(mockCreateCommitStatus.mock.calls[1][0].description).toBe( - "Automated GPUTester PR detected" + "Automated rapids-bot PR detected" ); });