Skip to content

Comments

[NoQA] Fix: reuse concurrency group for testBuild and testBuildOnPush#81520

Closed
LukasMod wants to merge 1 commit intoExpensify:mainfrom
callstack-internal:fix/test-build-on-push-concurrency-3
Closed

[NoQA] Fix: reuse concurrency group for testBuild and testBuildOnPush#81520
LukasMod wants to merge 1 commit intoExpensify:mainfrom
callstack-internal:fix/test-build-on-push-concurrency-3

Conversation

@LukasMod
Copy link
Contributor

@LukasMod LukasMod commented Feb 5, 2026

Explanation of Change

Reuse the same group for both testBuild and testBuildOnPush workflows to avoid scenario where manual adhoc in some cases can run parallel with testBuildOnPush and result same fingerprint.

Fixed Issues

Follow up to #78772
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@LukasMod LukasMod marked this pull request as ready for review February 5, 2026 12:26
@LukasMod LukasMod requested a review from a team as a code owner February 5, 2026 12:26
@melvin-bot melvin-bot bot requested review from MariaHCD and removed request for a team February 5, 2026 12:26
@melvin-bot
Copy link

melvin-bot bot commented Feb 5, 2026

@MariaHCD Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@mountiny mountiny self-requested a review February 5, 2026 20:19
@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2026

@LukasMod I am not sure about this change, I think for the adhocs on Prs we prefer to get the builds asap but with this it might cause them to be queued behind bunch of prs merged to main, right? I think it is better to use potentially slightly outdated fingerprint but not wait for the builds from push to main

Copy link
Member

@rafecolton rafecolton left a comment

Choose a reason for hiding this comment

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

Is this still needed now that we are using the commit hash instead of relying on the fingerprint?

@LukasMod
Copy link
Contributor Author

LukasMod commented Feb 6, 2026

@rafecolton @mountiny true, I would treat it more as a hotfix and figure out something better to include always identifier in artifact name. Pain point is that first build with new fingerprint is without identifier.

Prepare for longer story, I will try to explain how the workflow generally works for adhocs first:

First Build Flow (No Cached Artifact Exists) - New Native Changes

  1. Calculate Native Fingerprint
  2. Generates hash based on native changes/env/packages -> abc123
  3. Check for Cached Artifacts for rock-ios-device-AdHoc-abc123 → ❌ Not found, ARTIFACT_URL empty, we have to build from scratch
  4. building app
  5. ARTIFACT_NAME stays the same: rock-ios-device-AdHoc-abc123(without identifier hash). It's to be able for other builds to fetch "base" build by just fingerprint name in step 3.
  6. upload build for caching purpose as a zip https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/rock-ios-device-AdHoc-abc123.zip
  7. upload build for distribution purpose (ipa, manifest and index.html) at (example) https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-abc123/index.html

Second Build

  1. Calculate Native Fingerprint
  2. Generates hash based on native changes/env/packages -> abc123def456 SAME
  3. Check for Cached Artifacts for rock-ios-device-AdHoc-abc123def456 ✅ Found, there is ARTIFACT_URL
  4. Download build from ARTIFACT_URL
  5. Re-sign, build bundle and replace old one
  6. We are in re-sign flow and have ARTIFACT_URL (base build already in cache) so we adds identifier to avoid overwrites and create new link eg. rock-ios-device-AdHoc-commitSha-abc123def456 which points to specific commit but also reuse native build

uploads stays the same, just diff naming
7. upload build for caching purpose as a zip https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/rock-ios-device-AdHoc-commitSha-abc123.zip
8. upload build for distribution purpose (ipa, manifest and index.html) at (example) https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-commitSha-abc123/index.html


Now edge case (but realistic one). We have new native changes on main branch, just merged.

  1. Main branch. testBuild on push is triggered, no cached build for new fingerprint -> building rock-ios-device-AdHoc-abc123
  2. feature branch. Developer pulls from main, same native code + new JS changes. testBuild is triggered manually. no cached build for new fingerprint (build from main is in progress, not uploaded yet) -> building for rock-ios-device-AdHoc-abc123
  3. Main branch: build is finished, zip and adhoc files uploaded with rock-ios-device-AdHoc-abc123
  4. Feature branch: build is finished, zip and adhoc files uploaded with rock-ios-device-AdHoc-abc123

There is a step, Find artifact URL again before uploading, that runs after the build to close that gap:
https://github.com/callstackincubator/ios/blob/d638bd25c764655baeeced3232c692f1698cf72b/action.yml#L436-L446
However, it’s not doing what we would expect in this specific use case and seems to have no effect later in the re-sign flow. In this scenario, we want to store both builds for testing (current main and feature branch), as both may contain different JS.

One potential solution could be to run Update Artifact Name for re-signed builds again after Find artifact URL again before uploading and add an identifier hash for the latest build during re-signing. This would make the gap very small (seconds instead of ~20 minutes). It also should be relatively simple, but it also feels a bit hacky and we would still have builds without identifiers.

Ideally, I think we should rethink how ad-hoc uploads work and adjust them so they always include some identifier (like commitSha), while still allowing the creation of a base build (zip with just fingerprint) for other flows. Ideally only once, without polluting the remote cache with multiple ZIPs that won’t be reused anyway, since the name is updated later and the check is based on the fingerprint rather than identifier + fingerprint.

I’m thinking about something like this:

  1. Upload only the .zip based on the fingerprint (without an identifier), since this is the one reused for building apps. 2. Before uploading, each build should always check whether it already exists. Whether it’s triggered from main or a feature branch, the same fingerprint should result in a single ZIP build: rock-artifacts/rock-device-AdHoc-fingerprint.zip. (no identifier). Each build with native changes should be as reusable as possible. There’s no need for multiple ZIPs for different commits.
  2. Each ad-hoc upload (non-ZIP files) should include an identifier in it's name so we can always point to a very specific commit and avoid issues like the one described. The identifier + fingerprint would always refer to a specific test build, no matter if it's a first fresh native build on main or on feature branch. We should be able to control identifier in case of more specific scenarios (like pointing to specific Mobile-Expensify commit). We could reuse new custom-ref input from fix).

With this, whole edge case could looks like this:

  1. Main branch. testBuild on push is triggered, no cached build for new fingerprint -> building rock-ios-device-AdHoc-abc123
  2. feature branch. Developer pulls from main, same native code + new JS changes. testBuild is triggered manually. no cached build for new fingerprint (build from main is in progress, not uploaded yet) -> building for rock-ios-device-AdHoc-abc123
  3. Main branch: build is finished, zip uploaded with rock-ios-device-AdHoc-abc123, adhoc files uploaded with rock-ios-device-AdHoc-identifier1-abc123
  4. Feature branch: build is finished, recheck if zip build exists, zip found for rock-ios-device-AdHoc-abc123, upload zip aborted, adhoc files uploaded with rock-ios-device-AdHoc-identifier2-abc123

I think that solution could be related to gh actions and not rock itself but I would need discuss it with a rock team. There is also a chance that I'm missing something here, whole issue combines expensify CI + rock logic + gh actions.

WDYT? cc @adhorodyski

@mountiny
Copy link
Contributor

mountiny commented Feb 7, 2026

I am curious to hear from the Rock team on this one @adhorodyski @rinej seems like something for them to consider how to handle such edge case

@LukasMod
Copy link
Contributor Author

If the scenario described in this PR starts happening too often, we can use this PR to block parallel builds between the two workflows. It can serve as a Plan B. In the meantime, I will try to prepare a proper solution to handle this from GitHub Actions, as mentioned in #81520 (comment)

@LukasMod
Copy link
Contributor Author

Closing this one as we have proper fix here: #82391

@LukasMod LukasMod closed this Feb 13, 2026
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.

3 participants