Skip to content

Commit

Permalink
fix recently updated PR checker (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe authored Nov 27, 2024
1 parent 14172f1 commit e9cf434
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/plugins/RecentlyUpdated/check_pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/responses/list_pulls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions test/recently_updated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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"
);
});

Expand Down Expand Up @@ -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"
);
});

Expand Down

0 comments on commit e9cf434

Please sign in to comment.