Skip to content

Auto-file staging retest request for cherry-picked blocker fixes#96103

Open
jasperhuangg wants to merge 5 commits into
mainfrom
auto-retest-cp
Open

Auto-file staging retest request for cherry-picked blocker fixes#96103
jasperhuangg wants to merge 5 commits into
mainfrom
auto-retest-cp

Conversation

@jasperhuangg

@jasperhuangg jasperhuangg commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

When a deploy-blocker fix is cherry-picked to staging, the deployer currently files a Slack #retests request by hand. This does it automatically: a new deploy job fires on a staging cherry-pick (once all platforms land) when the cherry-picked PR is on the current StagingDeployCash checklist and links a deploy-blocker issue on it, then POSTs the retest request to the Slack webhook.

The webhook URL is loaded from 1Password (Repository-Secrets/SLACK_RETEST_WEBHOOK in the Mobile-Deploy-CI vault), not the code.

How it works

  1. A staging deploy finishes on all platforms and was triggered by a cherry-pick.
  2. The job resolves the cherry-picked PR from the deploy's commit range.
  3. It checks that PR is on the current StagingDeployCash checklist and links a deploy-blocker issue on it.
  4. If so, it POSTs the retest request to the Slack #retests workflow.
  5. It drops a marker comment on the PR so a re-deploy won't file a duplicate.

Fixed Issues

$
PROPOSAL:

Tests

This is a deploy-workflow change with no app-facing UI. It only runs inside the staging deploy for a cherry-pick, so it can't be exercised in the local dev environment. Logic is covered by unit tests:

  1. Run npx jest tests/unit/createRetestRequestForCPTest.ts.
  2. Verify all tests pass (commit-trailer parsing, linked-issue parsing, Slack payload mapping, dedupe marker).
  • Verify that no errors appear in the JS console

Offline tests

N/A, this runs in CI during a deploy, there is no offline client behavior.

QA Steps

N/A. This only runs in the staging deploy workflow when a deploy-blocker fix is cherry-picked to staging, so it can't be triggered on demand by QA. Title includes [No QA].

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

N/A, this is a CI/deploy workflow change with no app UI.

Android: Native

N/A

Android: mWeb Chrome

N/A

iOS: Native

N/A

iOS: mWeb Safari

N/A

MacOS: Chrome / Safari

N/A

@jasperhuangg jasperhuangg requested review from a team as code owners July 14, 2026 17:17
@melvin-bot melvin-bot Bot requested review from JmillsExpensify and removed request for a team July 14, 2026 17:17
@jasperhuangg jasperhuangg changed the title [No QA] feat(deploy): auto-file staging retest request for cherry-picked blocker fixes Auto-file staging retest request for cherry-picked blocker fixes Jul 14, 2026
@melvin-bot melvin-bot Bot requested review from neil-marcellini and removed request for a team July 14, 2026 17:17
@Expensify Expensify deleted a comment from melvin-bot Bot Jul 14, 2026
Comment thread scripts/createRetestRequestForCP.ts
Comment thread scripts/createRetestRequestForCP.ts
@jasperhuangg jasperhuangg changed the title Auto-file staging retest request for cherry-picked blocker fixes [HOLD adding webhook URL secret] Auto-file staging retest request for cherry-picked blocker fixes Jul 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9a96ce8c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/createRetestRequestForCP.ts
@jasperhuangg jasperhuangg changed the title [HOLD adding webhook URL secret] Auto-file staging retest request for cherry-picked blocker fixes Auto-file staging retest request for cherry-picked blocker fixes Jul 14, 2026
@roryabraham roryabraham self-requested a review July 14, 2026 20:37
}

async function run(): Promise<void> {
const deploySHA = process.env.DEPLOY_SHA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the CLI lib from expensify-common to pass these in as CLI args rather than through the env?

/** Map a hit to the flat string payload the Slack workflow webhook expects. */
function buildRetestPayload(hit: RetestHit): Record<string, string> {
return {
isDb: 'dbTrue',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have control over this payload shape? Ideally we wouldn't abbreviate this, and it's unclear to me why we're using dbTrue as a string instead of isDeployBlocker: true (as a boolean)


const hits: RetestHit[] = [];
for (const prNumber of candidatePRNumbers) {
// Gate 2: the cherry-picked PR must be on the current checklist.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must've missed Gate 1 😂

continue;
}

if (await alreadyFiled(prNumber, deployTag)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (await alreadyFiled(prNumber, deployTag)) {
if (await isRetestAlreadyRequested(prNumber, deployTag)) {

export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SLACK_RETEST_WEBHOOK: op://${{ vars.OP_VAULT }}/Repository-Secrets/SLACK_RETEST_WEBHOOK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this vault in 1Password. Should it be in the Mobile-Deploy-CI vault?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants