Repository navigation
Description
Proposal: Cache reusable native builds in GitHub
Strategy
The success of Expensify largely depends on rapid and effective engineering output to bring ideas and improvements to market quickly. Systemic problems that slow development for all engineers, have both a real cost and an opportunity cost in wasted time.
Background
As React Native developers, we work mainly with JavaScript, which is updated daily by many contributors. However, React Native requires compiling the native parts of our app every time we build, even when there are no native changes. Existing local and remote caching systems are in place, but they often fail or require manual debugging. For EApp/Hybrid, a complete build can take 20-30 minutes per platform, and new developers sometimes spend hours wrestling with environment-specific build errors.
Problem
When engineers push new changes to the remote or build the app locally, long build times slow down the development process, which prevents us from maintaining efficient feedback cycles.
Solution
We propose a two-part solution:
- Introduce a small collection of GitHub actions and workflows to build debug and release versions of EApp/Hybrid iOS and Android apps, only when native changes are involved, completely skipping the native build for JS-only changes.
- Accompany it with a CLI plugin for downloading builds produced and hosted in GitHub CI, instead of building everything once again locally.
Before/After
- Remote build: ~25mins 100% of the time -> ~7s 90% of the time
- Local clean build: ~25mins 100% of the time -> ~1.5mins 90% of the time
- Local cached build: 12-30s 100% of the time -> 12s 100% of the time
For the remaining ~10% containing native changes, only a single remote build will trigger, producing an artifact for everyone to reuse. With the above changes, we can turn 25min long AdHoc builds into a <10s signing step and 25min local builds into 1-2min download steps.
Activity
roryabraham commentedon Mar 19, 2025
Coming from https://expensify.slack.com/archives/C05LX9D6E07/p1740996271773479
adhorodyski commentedon Mar 19, 2025
I've rebased the PR, adding a before-we-merge checklist of smaller details to double check. ccing @staszekscp here as well.
adhorodyski commentedon Mar 19, 2025
Once we're happy with the state of the 1st PR, I'll create a general public post describing in detail the schedule for rolling this out.
mainwithremoteCacheProvider: nullfor a 2 weeks period. This will preserve the same style of builds for everyone, both locally and on CI, allowing us to gradually get used to the new style of the CLI and polish any potential rough edges.mainto start generating remote artifacts. This is going to run in the background and will enable everyone interested to locally useremoteCacheProvider: 'github-actions'for testing on the debug builds.remoteCacheProvider: 'github-actions'merged intomainto change the default behaviour. From then on every environment will default to reusing these builds artifacts.112 remaining items
melvin-bot commentedon Jun 10, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.63-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-06-17. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 17, 2025
Payment Summary
Upwork Job
BugZero Checklist (@muttmuure)
parasharrajat commentedon Jun 17, 2025
All of these PRs were tested and reviewed by me for this task/project.
Technically, I would request the standard payout of each review as per policy, but a few of them were smaller changes, so I am happy to ignore those. The standard payout for all these PRs would be (8 * 250) = $2000, but I think the more suitable amount would be $1250.
cc: @muttmuure
muttmuure commentedon Jun 22, 2025
Seems fair enough to me
muttmuure commentedon Jun 22, 2025
$1250 - @parasharrajat C+
parasharrajat commentedon Jun 24, 2025
@muttmuure We can close this issue. I will request later. Thanks.
parasharrajat commentedon Jun 27, 2025
Payment requested as per #58743 (comment)
[-][Due for payment 2025-06-17] [Due for payment 2025-06-12] [Due for payment 2025-05-28]Cache reusable native builds in GitHub[/-][+][Due for payment 2025-06-17] Cache reusable native builds in GitHub[/+]parasharrajat commentedon Jul 5, 2025
We can close this issue. Payment is already requested.
JmillsExpensify commentedon Jul 9, 2025
$1,250 approved for @parasharrajat