From 3748cbad063f677ece2c4f89e89e2b79db172c83 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Oct 2026 09:09:09 -0700 Subject: [PATCH 1/2] Exclude Internal QA cherry-picks when creating the next deploy checklist --- scripts/createOrUpdateDeployChecklist.ts | 3 +- .../createOrUpdateDeployChecklist.test.ts | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/scripts/createOrUpdateDeployChecklist.ts b/scripts/createOrUpdateDeployChecklist.ts index a109693e1246..b514e36ba7b4 100644 --- a/scripts/createOrUpdateDeployChecklist.ts +++ b/scripts/createOrUpdateDeployChecklist.ts @@ -229,7 +229,8 @@ async function run(): Promise { const {mergedPRs: mergedPREntries, submoduleUpdates} = await GitUtils.getMergedPRsDeployedBetween(previousChecklistData.tag, newStagingTag, CONST.APP_REPO); const mergedPRs = mergedPREntries.map((pr) => pr.prNumber).sort((a, b) => a - b); - const previousPRNumbers = new Set(previousChecklistData.PRList.map((pr) => pr.number)); + // Internal QA PRs are listed in their own section, so a cherry-picked one would otherwise reappear in the next checklist + const previousPRNumbers = new Set([...previousChecklistData.PRList, ...previousChecklistData.internalQAPRList].map((pr) => pr.number)); const previousMobileExpensifyPRNumbers = new Set(previousChecklistData.PRListMobileExpensify.map((pr) => pr.number)); core.startGroup('Filtering PRs:'); core.info('mergedPRs includes cherry-picked PRs that have already been released with previous checklist, so we need to filter these out'); diff --git a/tests/tooling/createOrUpdateDeployChecklist.test.ts b/tests/tooling/createOrUpdateDeployChecklist.test.ts index d6dbc37437cf..3c367942ef7b 100644 --- a/tests/tooling/createOrUpdateDeployChecklist.test.ts +++ b/tests/tooling/createOrUpdateDeployChecklist.test.ts @@ -790,6 +790,67 @@ describe('createOrUpdateDeployChecklist', () => { mockGetDeployChecklistData.mockRestore(); }); + + test('filters out Internal QA PRs that were already included in previous checklist', async () => { + // Given a previous checklist where cherry-picked PR 8 sat in the Internal QA section rather than the main PR list + vol.reset(); + vol.fromJSON({ + [PATH_TO_PACKAGE_JSON]: JSON.stringify({version: '1.0.3-0'}), + }); + + mockGetInput.mockImplementation((arg) => (arg === 'GITHUB_TOKEN' ? 'fake_token' : '')); + mockGetMergedPRsDeployedBetween.mockImplementation(async (fromRef, toRef, repositoryName) => { + if (fromRef === '1.0.2-1-staging' && toRef === '1.0.3-0-staging') { + if (repositoryName === CONST.MOBILE_EXPENSIFY_REPO) { + return {mergedPRs: [], submoduleUpdates: []}; + } + return toMergedPRs([6, 8, 10, 11]); + } + return {mergedPRs: [], submoduleUpdates: []}; + }); + + const mockGetDeployChecklistData = jest.spyOn(DeployChecklistUtils, 'getDeployChecklistData'); + mockGetDeployChecklistData.mockImplementation(() => ({ + title: 'Previous Checklist', + url: `https://github.com/${process.env.GITHUB_REPOSITORY}/issues/29`, + number: 29, + labels: [LABELS.STAGING_DEPLOY_CASH], + PRList: [{url: `https://github.com/${process.env.GITHUB_REPOSITORY}/pull/6`, number: 6, isChecked: true}], + PRListMobileExpensify: [], + deployBlockers: [], + internalQAPRList: [{url: `https://github.com/${process.env.GITHUB_REPOSITORY}/pull/8`, number: 8, isChecked: true}], + isSentryChecked: true, + isGHStatusChecked: true, + version: '1.0.2-1', + tag: '1.0.2-1-staging', + })); + + mockDeployChecklistIssuesByLabel({ + [CONST.LABELS.STAGING_DEPLOY]: [ + { + number: 29, + state: 'closed', + labels: [LABELS.STAGING_DEPLOY_CASH], + }, + ], + }); + + // When a new checklist is created + await run(); + const createCall = mockCreateIssue.mock.lastCall; + if (!createCall || !createCall[0]) { + throw new Error('Expected issues.create to receive a request payload.'); + } + const createPayload = createCall[0]; + + // Then both previously released PRs are excluded, regardless of which section listed them + expect(createPayload.body).toContain('https://github.com/Expensify/App/pull/10'); + expect(createPayload.body).toContain('https://github.com/Expensify/App/pull/11'); + expect(createPayload.body).not.toContain('https://github.com/Expensify/App/pull/6'); + expect(createPayload.body).not.toContain('https://github.com/Expensify/App/pull/8'); + + mockGetDeployChecklistData.mockRestore(); + }); }); describe('chronological section with submodule updates', () => { From b74b0ef89d14203fea7adc706fd8ee887bac87d2 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Oct 2026 09:27:21 -0700 Subject: [PATCH 2/2] Reword comment on previous checklist PR exclusion --- scripts/createOrUpdateDeployChecklist.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/createOrUpdateDeployChecklist.ts b/scripts/createOrUpdateDeployChecklist.ts index b514e36ba7b4..d32bb5102139 100644 --- a/scripts/createOrUpdateDeployChecklist.ts +++ b/scripts/createOrUpdateDeployChecklist.ts @@ -229,7 +229,7 @@ async function run(): Promise { const {mergedPRs: mergedPREntries, submoduleUpdates} = await GitUtils.getMergedPRsDeployedBetween(previousChecklistData.tag, newStagingTag, CONST.APP_REPO); const mergedPRs = mergedPREntries.map((pr) => pr.prNumber).sort((a, b) => a - b); - // Internal QA PRs are listed in their own section, so a cherry-picked one would otherwise reappear in the next checklist + // Previous PRs should include PRs and internalQA items const previousPRNumbers = new Set([...previousChecklistData.PRList, ...previousChecklistData.internalQAPRList].map((pr) => pr.number)); const previousMobileExpensifyPRNumbers = new Set(previousChecklistData.PRListMobileExpensify.map((pr) => pr.number)); core.startGroup('Filtering PRs:');