Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix recently updated PR checker #195

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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