From c5d47884fb3cabc431579c4df41a745f483bc089 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 26 Nov 2026 11:55:57 +0000 Subject: [PATCH 1/3] fix(github): Run the next-action backfill again for the merge access rule --- packages/junior-github/src/pull-request-action-backfill.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/junior-github/src/pull-request-action-backfill.ts b/packages/junior-github/src/pull-request-action-backfill.ts index 929d5268f99..b672072977c 100644 --- a/packages/junior-github/src/pull-request-action-backfill.ts +++ b/packages/junior-github/src/pull-request-action-backfill.ts @@ -33,7 +33,8 @@ import { export const GITHUB_PULL_REQUEST_ACTION_BACKFILL_TASK = "backfillPullRequestActions"; -const VERSION = "v1"; +// v2: a requester without write access gets no merge ask. +const VERSION = "v2"; const CURSOR_KEY = `pull-request-action-backfill:${VERSION}:cursor`; const DONE_KEY = `pull-request-action-backfill:${VERSION}:done`; // How often a page ran again, so its next run has a new task key. From 6f47504320e5398324f1b31f92ec562e88750888 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:27:49 +0000 Subject: [PATCH 2/3] fix(github): Ask in limbo during the v2 backfill as a webhook does --- .../src/pull-request-action-backfill.ts | 10 ++++-- .../tests/pull-request-action.test.ts | 33 +++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/packages/junior-github/src/pull-request-action-backfill.ts b/packages/junior-github/src/pull-request-action-backfill.ts index b672072977c..46f9f73f6a7 100644 --- a/packages/junior-github/src/pull-request-action-backfill.ts +++ b/packages/junior-github/src/pull-request-action-backfill.ts @@ -16,7 +16,8 @@ * page with a pull request that a webhook was checking runs again, because * that webhook does not ask a requester who acted before the last push. Bump * `VERSION` when a new derivation rule must reach pull requests that went - * quiet before it. + * quiet before it, and set `ASK_AFTER_REQUESTER_ACTED` to whether the rule + * needs that ask. */ import type { PluginStartedTaskDefinition, @@ -33,8 +34,11 @@ import { export const GITHUB_PULL_REQUEST_ACTION_BACKFILL_TASK = "backfillPullRequestActions"; -// v2: a requester without write access gets no merge ask. const VERSION = "v2"; +// v1 brought limbo asks to quiet pull requests, also where the requester +// acted before the last push. v2 brings only the merge access rule, so it +// asks in limbo as a webhook does. +const ASK_AFTER_REQUESTER_ACTED = false; const CURSOR_KEY = `pull-request-action-backfill:${VERSION}:cursor`; const DONE_KEY = `pull-request-action-backfill:${VERSION}:done`; // How often a page ran again, so its next run has a new task key. @@ -85,7 +89,7 @@ export function githubPullRequestActionBackfillTask(args: { .sort((a, b) => a.id - b.id) .slice(0, PAGE_SIZE); const busy = await syncGitHubPullRequestActions({ - askAfterRequesterActed: true, + askAfterRequesterActed: ASK_AFTER_REQUESTER_ACTED, ...startedTaskSyncContext(ctx, { botEmail: args.botEmail(), env: args.env, diff --git a/packages/junior-github/tests/pull-request-action.test.ts b/packages/junior-github/tests/pull-request-action.test.ts index db7c7487cbe..abb72791afa 100644 --- a/packages/junior-github/tests/pull-request-action.test.ts +++ b/packages/junior-github/tests/pull-request-action.test.ts @@ -826,6 +826,39 @@ describe("next action item", () => { } }); + it("backfills without asking a requester who commented before the last push", async () => { + const fixture = await createGitHubFixture(); + const requests: string[] = []; + // The pull request waits on nobody, but the requester commented before + // the last push. A webhook does not ask them again, and nor does the + // backfill. + mockGitHub( + { + comments: [{ at: "2026-07-01T13:00:00.000Z", login: "Requester" }], + draft: false, + headCommittedAt: "2026-07-02T12:00:00.000Z", + mergeableStates: ["blocked"], + merged: false, + reviews: [], + state: "open", + }, + requests, + ); + try { + await seedJuniorPullRequest(fixture, "slack:C123:1712345.0001"); + const h = createPluginHarness(fixture, requesterUsers); + await h.heartbeat(Date.parse("2026-07-03T12:00:00.000Z")); + await h.runStartedTasks(); + expect(requests).toContain("pull"); + expect( + requests.filter((request) => request.startsWith("request")), + ).toEqual([]); + expect(h.notices).toEqual([]); + } finally { + await fixture.close(); + } + }); + it("backfills a page again when a webhook was checking one of its pull requests", async () => { const fixture = await createGitHubFixture(); const requests: string[] = []; From 2067cc0d1b4adb5625e0032c01b9815fd9796446 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:37:10 +0000 Subject: [PATCH 3/3] test(github): Expect the v2 backfill to ask in limbo as a webhook does --- .../tests/pull-request-action.test.ts | 33 ------------------- .../tests/pull-request-limbo.test.ts | 6 ++-- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/packages/junior-github/tests/pull-request-action.test.ts b/packages/junior-github/tests/pull-request-action.test.ts index abb72791afa..db7c7487cbe 100644 --- a/packages/junior-github/tests/pull-request-action.test.ts +++ b/packages/junior-github/tests/pull-request-action.test.ts @@ -826,39 +826,6 @@ describe("next action item", () => { } }); - it("backfills without asking a requester who commented before the last push", async () => { - const fixture = await createGitHubFixture(); - const requests: string[] = []; - // The pull request waits on nobody, but the requester commented before - // the last push. A webhook does not ask them again, and nor does the - // backfill. - mockGitHub( - { - comments: [{ at: "2026-07-01T13:00:00.000Z", login: "Requester" }], - draft: false, - headCommittedAt: "2026-07-02T12:00:00.000Z", - mergeableStates: ["blocked"], - merged: false, - reviews: [], - state: "open", - }, - requests, - ); - try { - await seedJuniorPullRequest(fixture, "slack:C123:1712345.0001"); - const h = createPluginHarness(fixture, requesterUsers); - await h.heartbeat(Date.parse("2026-07-03T12:00:00.000Z")); - await h.runStartedTasks(); - expect(requests).toContain("pull"); - expect( - requests.filter((request) => request.startsWith("request")), - ).toEqual([]); - expect(h.notices).toEqual([]); - } finally { - await fixture.close(); - } - }); - it("backfills a page again when a webhook was checking one of its pull requests", async () => { const fixture = await createGitHubFixture(); const requests: string[] = []; diff --git a/packages/junior-github/tests/pull-request-limbo.test.ts b/packages/junior-github/tests/pull-request-limbo.test.ts index f2339877225..2e8e2ba598e 100644 --- a/packages/junior-github/tests/pull-request-limbo.test.ts +++ b/packages/junior-github/tests/pull-request-limbo.test.ts @@ -147,7 +147,9 @@ describe("limbo review ask", () => { }>([ { asks: true, github: {}, name: "waits on nobody" }, { - asks: true, + // The v2 backfill asks as a webhook does, so it does not ask a + // requester who acted before the last push again. + asks: false, github: { comments: [{ at: "2026-07-02T11:00:00.000Z", login: "Requester" }], }, @@ -239,7 +241,7 @@ describe("limbo review ask", () => { name: "a comment-only review answers no ask, but Junior acts next", }, { - asks: true, + asks: false, github: { reviews: [ {