-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-08] Store prebuilt versions of our custom React Native artifacts #57120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! I'd like to work on this issue 😅🚀 |
Please provide a proposal for a versioning schema that's compliant with https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855 I think that we'd want to basically use the RN base version, for example |
Hi! We're still exploring our options here. Nevertheless, I find this resource very useful for further investigation. Ideally, we would like to maintain the following version scheme:
When appending a hash to the version, we might encounter issues related to Maven's version ordering. Since the hash would be compared lexicographically, we could lose information about which hash corresponds to a newer version. To resolve this, we can store the hash in the build artifact's metadata and maintain a mapping of
|
Hi! I wanted to share an update. Recently, I investigated how artifacts are created in the I have started working on a workflow that will publish these patched artifacts to a public Maven repository. There are two challenges to address:
First issue can be resolved by using They also define the same versioning scheme that I suggested here. So I think It's totally fine to follow this idea. Here's the quote from
|
sounds like we're close then? Let me know when you're ready for us to create a public maven repo and I can create a task for someone to make it |
I think we're getting closer. We just need to bring all parts together, but overall, the separate pieces are ready. We could discuss details regarding maven repository. Is there a preferred method for hosting it? E.g. we could use MavenCentral or self-hosted Nexus Repository Manager. We could also try to host plain maven repository on S3. |
Not sure I'm too passionate either way. If MavenCentral is an option, let's just use that? |
Sure! The only drawback of Maven Central is that the process of adding our repository there is quite complex, and we have less control. For example, we cannot delete a release version of a package, we can only delete SNAPSHOT versions, so we need to be cautious with the publication process. One interesting alternative I found today is GitHub Packages. It's very easy to publish, and we can delete it anytime if anything goes wrong. Unfortunately there is one drawback. Downloading packages (even public ones) requires authentication with a GitHub token. So, users locally would need to have the Then, we would need to access it, for example, like this:
and read those credentials in
I'm leaving the final decision to you 😅 |
Regarding other updates: I'm integrating a versioning mechanism with GitHub workflow. This is the last missing piece, and once it's ready, I will share a demo of the POC here. Then we can start adapting it in the App repository. |
Looking forward to seeing the POC here. GitHub Packages seems like a great option to me, since we use the platform so heavily, it's great to not add another 3rd party system. 👍🏼 |
Awesome! Sorry for the delay, I’ve been handling a lot of high-priority crashes recently, but I’ve started moving the POC to the App repository. Nevertheless, If you'd like to see current version of POC on new RN project here's a repository I was working on https://github.com/mateuuszzzzz/rn-android-artifacts Here is workflow that handles publication process https://github.com/mateuuszzzzz/rn-android-artifacts/blob/main/.github/workflows/buildAndPublishArtifacts.yml And example package published by mentioned workflow: https://github.com/mateuuszzzzz/rn-android-artifacts/packages/2440639 As I'm moving this workflow to App repository I need to refactor it a bit, including:
|
I see your POC workflow uses |
Yeah, this is final strategy I'd like to implement. |
I created a draft PR where I'll be moving the entire POC logic. I also simplified the publication process a bit, so now we can publish directly from the App repository. I'll post a TODO list in the PR's description. |
Just left a big review on the PR. Overall it looks very promising |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.38-4 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-05-08. 🎊 For reference, here are some details about the assignees on this issue:
|
Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO. |
I created a draft PR with 2 plugins. One is used during configuration and the other one during build phase. I'm working on another HybridApp PR that will use those plugins in Here's what I'd like to address now:
Also, I’m leaning back toward our previous approach of identifying artifacts by contents hash. I’ve found it difficult to reliably verify whether a given commit matches an artifact’s version. There are numerous edge cases, such as staged versus unstaged changes. That need to be accounted for all at once, which complicates the implementation. |
Hi, I wanted to share an update. I prepared a few PRs to bring prebuilt artifacts to main so I'll describe next steps here.
NewDot PR is currently missing implementation of |
@roryabraham all PRs are ready. In case you'd like to start reviewing them, this is the correct order of reviewing/merging:
|
Also, after merging #61862 all existing patches will become outdated. Before merging this PR, we can delete existing packages to have a "clean start". However, this is not a blocker. |
I noticed one more edge case that we should handle in order to make the workflow more resilient to errors. If we merge more than one PR that modifies react-native patches in a short time window, the workflow that finishes last will fail due to a conflicting Maven package version. Initially, they will read the same latest version from GitHub Packages and will try to publish the same version twice. I'm curious if we already have solutions for this type of problem in our existing workflows. If not, I will try to come up with a solution that resolves the mentioned issue. Currently, I'm leaning towards enabling |
Yeah, |
Today I tested the workflow and discovered that if we merge a PR modifying patches first in the App repository and then another in the Mobile-Expensify repository, the first workflow that builds artifacts for both apps gets canceled, and only the second workflow that builds artifacts for HybridApp runs. As a result, the artifacts for the standalone NewDot build are missing. Mentioned issue occurs at both the workflow and job levels of concurrency. I suggest refactoring the workflow by splitting the current jobs into two separate ones: the first job would check whether new artifacts need to be built, and the second job would handle building and publishing them. This way, we could apply concurrency control to the second job. |
That sounds reasonable. What concurrency group key will you use for the publish job? |
I wanted to use EDIT: Marked as ready for a review |
@roryabraham I removed HOLD from plugin PR, this one is already adjusted to recently merged PR |
By the way, once those changes are merged, we can start gradually enabling prebuilt artifacts. First, we can enable them for local builds by default (this will require setting |
Coming from: https://expensify.slack.com/archives/C05LX9D6E07/p1739874783843659
Proposal: Reduce Build Time by Optimizing React Native Compilation
Background
Our build times for standalone NewDot and HybridApp have a significant impact on developer productivity and CI efficiency. Faster builds allow for quicker iterations, reducing the feedback loop when testing new changes. Currently, our build times remain high despite optimizations, affecting both local development and CI runs.
Problem
When engineers push new changes, the long build times delay feedback cycles, which slows down development.
Solution
We will store build artifacts for our patched React Native versions instead of building React Native from source each time. These stored artifacts will be regenerated only when patches on main or the React Native version change, which happens rarely. This will involve:
The text was updated successfully, but these errors were encountered: