From 9f32602bf3ee6097cb8120b342446bd8ee14c9ce Mon Sep 17 00:00:00 2001 From: Jake Awe Date: Thu, 8 Feb 2024 13:43:58 -0600 Subject: [PATCH] fix pulls filter --- src/plugins/ForwardMerger/forward_merger.ts | 4 ++-- src/plugins/ReleaseDrafter/release_drafter.ts | 2 +- test/fixtures/responses/list_pulls.json | 4 ++-- test/forward_merger.test.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/ForwardMerger/forward_merger.ts b/src/plugins/ForwardMerger/forward_merger.ts index fe395458..3541ac79 100644 --- a/src/plugins/ForwardMerger/forward_merger.ts +++ b/src/plugins/ForwardMerger/forward_merger.ts @@ -52,7 +52,7 @@ export class ForwardMerger extends OpsBotPlugin { const { data: pr } = await this.context.octokit.pulls.create({ owner: this.repo.owner.login, repo: this.repo.name, - title: "Forward-merge " + this.currentBranch + " into " + nextBranch, + title: `Forward-merge ${this.currentBranch} into ${nextBranch} [skip ci]`, head: this.currentBranch, base: nextBranch, maintainer_can_modify: false, @@ -70,7 +70,7 @@ export class ForwardMerger extends OpsBotPlugin { } catch (error) { await this.issueComment( pr.number, - "**FAILURE** - Unable to forward-merge due to an error, **manual** merge is necessary. Do not use the `Resolve conflicts` option in this PR, follow these instructions https://docs.rapids.ai/maintainers/forward-merger/ \n **IMPORTANT**: When merging this PR, do not use the [auto-merger](https://docs.rapids.ai/resources/auto-merger/) (i.e. the `/merge` comment). Instead, an admin must manually merge by changing the merging strategy to `Create a Merge Commit`. Otherwise, history will be lost and the branches become incompatible." + "**FAILURE** - Unable to forward-merge due to an error, **manual** merge is necessary. Do not use the `Resolve conflicts` option in this PR, follow these instructions https://docs.rapids.ai/maintainers/forward-merger/ \n\n**IMPORTANT**: When merging this PR, do not use the [auto-merger](https://docs.rapids.ai/resources/auto-merger/) (i.e. the `/merge` comment). Instead, an admin must manually merge by changing the merging strategy to `Create a Merge Commit`. Otherwise, history will be lost and the branches become incompatible." ); return; } diff --git a/src/plugins/ReleaseDrafter/release_drafter.ts b/src/plugins/ReleaseDrafter/release_drafter.ts index bb116575..d5e6f056 100644 --- a/src/plugins/ReleaseDrafter/release_drafter.ts +++ b/src/plugins/ReleaseDrafter/release_drafter.ts @@ -119,7 +119,7 @@ export class ReleaseDrafter extends OpsBotPlugin { return prs .filter( (pr) => - !pr.title.toLowerCase().startsWith("[gpuci] forward-merge branch-") + !pr.user?.login.toLowerCase().startsWith("rapids-bot") ) .filter((pr) => pr.merged_at); // merged_at === null for PRs that were closed, but not merged } diff --git a/test/fixtures/responses/list_pulls.json b/test/fixtures/responses/list_pulls.json index 818631de..589808a9 100644 --- a/test/fixtures/responses/list_pulls.json +++ b/test/fixtures/responses/list_pulls.json @@ -84,9 +84,9 @@ }, { "number": 9134, - "title": "[gpuCI] Forward-merge branch-0.17 to branch-0.18 [skip ci]", + "title": "Forward-merge branch-0.17 to branch-0.18 [skip ci]", "user": { - "login": "octokit" + "login": "rapids-bot" }, "labels": [{ "name": "doc" }], "merged_at": "2021-01-27T13:38:56Z" diff --git a/test/forward_merger.test.ts b/test/forward_merger.test.ts index 3d37cb36..07f49cf7 100644 --- a/test/forward_merger.test.ts +++ b/test/forward_merger.test.ts @@ -173,7 +173,7 @@ describe("Forward Merger", () => { expect(mockIssueComment).toBeCalledWith( pr.data.number, - "**FAILURE** - Unable to forward-merge due to an error, **manual** merge is necessary. Do not use the `Resolve conflicts` option in this PR, follow these instructions https://docs.rapids.ai/maintainers/forward-merger/ \n **IMPORTANT**: When merging this PR, do not use the [auto-merger](https://docs.rapids.ai/resources/auto-merger/) (i.e. the `/merge` comment). Instead, an admin must manually merge by changing the merging strategy to `Create a Merge Commit`. Otherwise, history will be lost and the branches become incompatible." + "**FAILURE** - Unable to forward-merge due to an error, **manual** merge is necessary. Do not use the `Resolve conflicts` option in this PR, follow these instructions https://docs.rapids.ai/maintainers/forward-merger/ \n\n**IMPORTANT**: When merging this PR, do not use the [auto-merger](https://docs.rapids.ai/resources/auto-merger/) (i.e. the `/merge` comment). Instead, an admin must manually merge by changing the merging strategy to `Create a Merge Commit`. Otherwise, history will be lost and the branches become incompatible." ); });