Skip to content

[No QA] Implement Hermes version check for our custom artifacts - #103317

Merged
roryabraham merged 11 commits into
Expensify:mainfrom
software-mansion-labs:hermes-version-in-artifacts-key
Oct 22, 2026
Merged

roryabraham merged 11 commits into
Expensify:mainfrom
software-mansion-labs:hermes-version-in-artifacts-key

Conversation

@mateuuszzzzz

@mateuuszzzzz mateuuszzzzz commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

We had troubles with Hermes ABI mismatch between our artifacts and local builds. This PR adds extra metadata to artifact POM files to allow us to detect ABI mismatches during the build.

This cannot be implemented reliably, as it depends on upstream changes that we cannot predict. However, with this change, ABI mismatches should be detected in most cases. In the worst case, if any part of upstream build infrastructure changes the way it selects the Hermes version, we will immediately know about it, because an artifact built with the wrong Hermes version will be rejected by the build system and the build will fall back to building from source.

Fixed Issues

$ #100503
PROPOSAL:

Tests

  • Hermes version should be included in POM file

Offline tests

QA Steps

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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@mikolajpochec mikolajpochec left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems that the command in buildIOS.yml on line 125 could use flag
--hermes-version-file="$GITHUB_WORKSPACE/node_modules/react-native/sdks/.hermesv1version".

It seems that it currently does not account the new metadata, and without it args['hermes-version-file'] in resolve-artifacts.ts is undefined, so the cache key no longer matches the artifact version.

Comment thread scripts/artifacts-utils/get-hermes-version.sh Outdated
@mateuuszzzzz

Copy link
Copy Markdown
Contributor Author

Seems that the command in buildIOS.yml on line 125 could use flag --hermes-version-file="$GITHUB_WORKSPACE/node_modules/react-native/sdks/.hermesv1version".

It seems that it currently does not account the new metadata, and without it args['hermes-version-file'] in resolve-artifacts.ts is undefined, so the cache key no longer matches the artifact version.

Good catch, I addressed that part

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 8 files with indirect coverage changes

@mateuuszzzzz

Copy link
Copy Markdown
Contributor Author

Let’s merge #103149? first, as it introduces a mechanism for triggering an artifacts build when a workflow file changes. Once it’s merged, we can add the new path for get-hermes-version.sh

@mateuuszzzzz
mateuuszzzzz marked this pull request as ready for review October 20, 2026 14:02
@mateuuszzzzz
mateuuszzzzz requested a review from a team as a code owner October 20, 2026 14:02
@melvin-bot
melvin-bot Bot requested review from aimane-chnaif and removed request for a team October 20, 2026 14:02
@melvin-bot

melvin-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

@aimane-chnaif 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]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T14:08:07.117706Z cbf2705 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mateuuszzzzz

Copy link
Copy Markdown
Contributor Author

FYI: To fix the Verify iOS native configuration / verify (pull_request) check, we first need to build and publish new artifacts from this branch and later install pods with those artifacts. This is because new artifact-matching logic won't be able to find the Hermes version in the POM file, so it will fall back to building from source, which rewrites the entire Podfile.lock.

@aimane-chnaif

aimane-chnaif commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified any copy / text that was added to the app 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 verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android.mov
Android: mWeb Chrome
iOS: HybridApp
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari

@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: 1a2bd08a9c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/artifacts-utils/get-hermes-version.sh
Comment thread scripts/artifacts-utils/get-hermes-version.sh
@MelvinBot

Copy link
Copy Markdown
Contributor

⚠️ A setup step failed before I could start. This is usually a temporary issue — try again in a few minutes, and if it persists post in #melvinbot-ai.

Run details

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

One blocker: get-hermes-version.sh was added without the executable bit (100644). Every workflow runs it as ./scripts/artifacts-utils/get-hermes-version.sh, so it fails with Permission denied. Because the call sits inside echo "VERSION=$(...)", the step still passes and writes an empty VERSION.

That empty value breaks three places:

  1. iOS slice build (publishReactNativeiOSArtifacts.yml:67): this step worked before with the inline sed. Now ios-prebuild.js gets HERMES_VERSION="". Upstream uses process.env.HERMES_VERSION ?? 'latest-v1', and ?? does not replace an empty string, so the slices are built against a bad Hermes version or fail.
  2. iOS publish (build.gradle:6): findProperty('hermesVersion') ?: error(...) treats "" as missing, so publishing fails.
  3. Android publish (publishReactNativeAndroidArtifacts.yml:77): the POM gets an empty hermesVersion. readPomProperty needs [^<]+, so it returns null and every new artifact gets rejected. Builds then quietly fall back to source.

Fix:

  • Run git update-index --chmod=+x scripts/artifacts-utils/get-hermes-version.sh.
  • Make empty output fail the step instead of passing silently. Do this in the script (exit 1 if HERMES_V1_VERSION_NAME is missing) or in the workflow, for example: VERSION=$(./scripts/artifacts-utils/get-hermes-version.sh) && [ -n "$VERSION" ] && echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT".
What I checked and found correct
  • Version formats match. In RN 0.86.0, sdks/.hermesv1version is hermes-v250829098.0.14 and version.properties has HERMES_V1_VERSION_NAME=250829098.0.14. After getLocalHermesVersion strips the prefix, the publish and consume sides compare the same string. The legacy file (hermes-v0.17.0) also strips correctly.
  • Removing RCT_HERMES_V1_ENABLED from ios/Podfile is safe. RN 0.86's hermes-utils.rb treats V1 as on unless the variable is "0" (ENV['RCT_HERMES_V1_ENABLED'] != "0"), so hermestag_file still picks .hermesv1version.
  • Android default matches. android/gradle.properties sets hermesV1Enabled=true, and the settings-phase fallback is also true.
  • Missing-file handling. A missing tag file throws inside findMatchingArtifactsVersion, and resolveArtifacts catches it and falls back to a source build.
  • Existing artifacts. Artifacts published before this change have no hermesVersion, so they will be rejected until new ones are published. You already noted this for the iOS native configuration check.

@MelvinBot

Copy link
Copy Markdown
Contributor

The PR head hasn't changed since my earlier review (still 1a2bd08), so that review still applies.

One blocker: scripts/artifacts-utils/get-hermes-version.sh is committed as 100644, so the workflows can't run it. The echo "VERSION=$(...)" steps then pass with an empty version. That breaks the iOS slice build and iOS publishing, and it makes every new Android artifact get rejected.

To fix it:

  1. Run git update-index --chmod=+x scripts/artifacts-utils/get-hermes-version.sh.
  2. Make the step fail when the version comes back empty.

Everything else I checked looks correct.

@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.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/artifacts-utils/get-hermes-version.sh
mateuuszzzzz and others added 2 commits October 21, 2026 13:48
The publish workflows invoke it directly, so with mode 100644 the step
recorded an empty Hermes version.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mateuuszzzzz and others added 3 commits October 21, 2026 15:00
The script decides which Hermes version the POM records, so a change to
it must produce new artifacts, like the other publisher inputs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mateuuszzzzz

Copy link
Copy Markdown
Contributor Author

@aimane-chnaif I addressed your review

@aimane-chnaif

Copy link
Copy Markdown
Contributor

@codex review

@aimane-chnaif

Copy link
Copy Markdown
Contributor

Author checklist is failing

@MelvinBot

Copy link
Copy Markdown
Contributor

Review (cbf2705)

No blockers. The script is executable now (100755), which fixes the problem from my last review. One non-blocking hardening item remains.

A failure in the Hermes version step still passes silently. All three steps run echo "VERSION=$(./scripts/artifacts-utils/get-hermes-version.sh)" >> "$GITHUB_OUTPUT" (Android :77, iOS :67, iOS :226). Bash takes the exit code from echo, so the script's exit 1 is lost. If a future RN version renames HERMES_V1_VERSION_NAME, the sed on get-hermes-version.sh:21 also prints nothing and exits 0. In either case:

  • Android publishes a POM with an empty hermesVersion. The resolver rejects that artifact, and every build quietly falls back to building from source.
  • iOS slices are built with HERMES_VERSION="". iOS publish does fail loudly, because build.gradle requires the property.

Suggested fix: Make the script fail when the version is empty, and stop the workflow from swallowing that failure:

# get-hermes-version.sh
VERSION=$(sed -n 's/^HERMES_V1_VERSION_NAME=//p' "$HERMES_VERSION_FILE")
[[ -n "$VERSION" ]] || { error "HERMES_V1_VERSION_NAME not found in $HERMES_VERSION_FILE"; exit 1; }
echo "$VERSION"
# each workflow step
run: |
  VERSION=$(./scripts/artifacts-utils/get-hermes-version.sh)
  echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
What I checked and found correct
  • Version formats match. version.properties has HERMES_V1_VERSION_NAME=250829098.0.14, and .hermesv1version is hermes-v250829098.0.14. getLocalHermesVersion strips the prefix, so the publish and consume sides compare the same string.
  • Every resolver caller passes --hermes-version-file. These are PatchedArtifactsSettings.gradle, patched_ios_artifacts.rb, and buildIOS.yml. A missing argument falls back to a source build.
  • iOS tag-file choice. hermestag_file uses hermes_v1_enabled (ENV['RCT_HERMES_V1_ENABLED'] != "0"). Removing the explicit '1' from ios/Podfile therefore keeps V1. A failure inside resolve is caught and falls back to a source build.
  • Republish trigger. Adding get-hermes-version.sh to both the paths filter and the DID_WORKFLOWS_CHANGE diff is consistent.
  • CI. The only failing checks are the checklist and independent-approval checks. All verify jobs and the Bun tests pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: cbf270570f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@aimane-chnaif

aimane-chnaif commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

iOS is too slow to build.

And app crashes on launch (not reproduced on main)

crash

@aimane-chnaif

Copy link
Copy Markdown
Contributor

I found offending PR which caused above crash - #104368. So not blocking on this

@melvin-bot
melvin-bot Bot requested a review from roryabraham October 21, 2026 16:19
@mateuuszzzzz mateuuszzzzz changed the title Implement Hermes version check for our custom artifacts [No QA] Implement Hermes version check for our custom artifacts Oct 22, 2026
@roryabraham
roryabraham merged commit ee3c6d5 into Expensify:main Oct 22, 2026
48 of 89 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #103317.

Android 🤖 iOS 🍎
❌ FAILED ❌ https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-ee3c6d51-63e5521-e7bef24c3f461d43c438dd9313c8a81265f58c54/index.html
The QR code can't be generated, because the Android build failed iOS
Web 🕸️
https://103317.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

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.

5 participants