Skip to content
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

[HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [HOLD for payment 2024-06-13] [HybridApp] Problem #5: Deploy the HybridApp more regularly #37858

Closed
AndrewGable opened this issue Mar 7, 2024 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Weekly KSv2

Comments

@AndrewGable
Copy link
Contributor

AndrewGable commented Mar 7, 2024

Problem

We ship changes to the New experience much faster than we ever had for the Old experience. This means that bugs are fixed much faster and we need to deploy the HybridApp on a faster cadence than we have historically deployed the Expensify iOS/Android app.

We should deploy the HybridApp on the same cadence (daily on Monday-Friday) as we deploy the New Expensify app. Every time we deploy the New Expensify app to web and desktop, we should also run the same deploy to the Expensify HybridApp on iOS and Android.

As discussed in the predesign, for the V1 we’ll automatically deploy HybridApp to staging with every NewDot staging deploy. However, for now we’ll only deploy HybridApp to production manually on an ad-hoc/weekly basis. Once we have some stable releases done, we’ll likely reopen the conversation for how to automatically deploy HybridApp to production on a daily basis.

Solution

Mobile-Deploy Background

For some background, the existing deploy workflow for the Expensify Classic mobile app lives in the Mobile-Deploy repo. Like all GitHub Workflows, it’s triggered by events:

  • workflow_dispatch – this allows you to manually trigger the workflow from the GitHub Actions console (open-source example). Furthermore, it allows you to specify some inputs to the workflow

  • schedule – this uses cron syntax to specify a cadence at which the workflow should run

More specifically, the Expensify Classic deploy workflow is set up to run every day at 6pm UTC, and when run manually it accepts 4 optional inputs.

Making Mobile-Deploy callable

In order to hook this up with the NewDot deploy cycle, the first thing we’ll need to do is make the Mobile-Deploy GitHub Workflow a callable workflow. This will enable it to be triggered programmatically from other workflows. Fortunately, this is simple to achieve:

  1. First, add the workflow_call event trigger to the workflow

  2. Duplicate all the inputs of workflow_dispatch for the workflow_call trigger. (no, the inputs cannot be shared between these two event triggers)

Calling Mobile-Deploy from E/App

Next, we’ll need to call the Mobile-Deploy workflow from within the existing New Expensify deploy workflows. The simplest way to do this will be to just add one more job to the existing platformDeploy workflow (for staging deploys only, for now).

Note that in order to call a workflow from another repo, we need to use the full repo slug instead of a relative path.

Deployer permissions

In order for this to work, we’ll need to give OSBotify access to the Mobile-Deploy repo, or else he won’t be able to trigger callable workflows in Mobile-Deploy.

Furthermore, we should also add some basic validation to verify that any caller of the Mobile-Deploy workflow is indeed a mobile deployer. To do this, we can:

  1. Extract the existing validateActor job into a callable workflow within E/App.

  2. Call that workflow from Mobile-Deploy as the first job in the workflow, and if the user is not found to be a mobile deployer, skip all subsequent jobs.

Syncing versions

In order to make bug tracking easier across HybridApp and NewDot, we’ll keep the versions in-sync. In order to do this, we’ll first create a PR to update the HybridApp version to 9.0.0.0 in order to make it clear we have a major update. Then we will manually update the NewDot version to match the current HybridApp version (9.0.0.0).

Then, we’ll update Mobile-Deploy’s deploy.yml workflow to accept a version string as an input, and pass that to Mobile-Expensify’s shell script to bump the app version. Then when triggering the HybridApp deploy from NewDot, we’ll pass the current NewDot version.
That way, the versions of HybridApp and NewDot will always be in sync, and it’s easy to reconcile bug reports coming from either app (though generally, most bug reports should be coming from HybridApp, while the bulk of the source code comes from NewDot).

Issue OwnerCurrent Issue Owner: @AndrewGable
@roryabraham
Copy link
Contributor

haven't jumped into this yet, but I'm adding something to this issue which we discussed in slack:

My thought was we should run automation to keep the submodule hash in sync with the current App hash. So whenever the commit hash is updated on main, staging or production on App, we have automation that updates the hash in Mobile-Expensify/react-native to that hash

@melvin-bot melvin-bot bot removed the Overdue label Mar 21, 2024
@roryabraham
Copy link
Contributor

roryabraham commented Mar 21, 2024

One way to do this, rather than some kind of GitHub Action, would be to use git hooks

edit: nah, don't think it's a great idea because it's less configurable for local workflows. It would make it difficult to checkout whatever combination of branches you want

@AndrewGable
Copy link
Contributor Author

I think the nice thing about storing the latest commit hash of main automatically in the submodule is it will be treated like any other file tracked in git.

Additionally, we can get rid of the npm run submodule-update script

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Apr 15, 2024
Copy link

melvin-bot bot commented Apr 15, 2024

This issue has not been updated in over 15 days. @roryabraham eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot removed the Overdue label Apr 15, 2024
@AndrewGable AndrewGable self-assigned this May 8, 2024
Copy link

melvin-bot bot commented May 8, 2024

Triggered auto assignment to @fukawi2 (ring0), see https://stackoverflow.com/c/expensify/questions/6102 for more details.

@AndrewGable
Copy link
Contributor Author

@fukawi2 - Can you verify that this bot has this access?

In order for this to work, we’ll need to give OSBotify access to the Mobile-Deploy repo, or else he won’t be able to trigger callable workflows in Mobile-Deploy.

@fukawi2
Copy link
Contributor

fukawi2 commented May 9, 2024

It has read access to the repo:

image

I'm guessing you need that upgraded to Read/Write?

@AndrewGable
Copy link
Contributor Author

Yes - It will need write to kick off a workflow

Google Chrome 2024-05-14 at 11 07 36

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Monthly KSv2 labels May 14, 2024
@AndrewGable
Copy link
Contributor Author

Bump @fukawi2, thank you!

@fukawi2
Copy link
Contributor

fukawi2 commented May 17, 2024

Sorry, been focused on fires and stuff. Does this need to be Daily?

@AndrewGable
Copy link
Contributor Author

Yes please

@AndrewGable AndrewGable added Daily KSv2 and removed Weekly KSv2 labels May 20, 2024
@AndrewGable
Copy link
Contributor Author

PR is under review and most likely will be merged today

@roryabraham
Copy link
Contributor

PR merged

@AndrewGable
Copy link
Contributor Author

Let's see how the first deploy goes 🤞

@AndrewGable
Copy link
Contributor Author

PR did not work, I am going to try again after reverting it

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jun 4, 2024
@AndrewGable
Copy link
Contributor Author

We tried again, got a new error, and learned that we probably cannot use a reusable workflow because of permissions.

It seems like GitHub does not allow us to call a private reuseable workflow from a public repo.

Google Chrome 2024-06-04 at 16 03 34
Google Chrome 2024-06-04 at 16 02 30

We confirmed this looking in the settings too
Google Chrome 2024-06-04 at 16 15 29

@AndrewGable
Copy link
Contributor Author

This is now working, we are deploying HybridApp on every staging NewDot deploy. I have one last clean up PR

@github-project-automation github-project-automation bot moved this from Release 2: Summer 2024 (Aug) to Done in [#whatsnext] #wave-collect Jun 5, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 6, 2024
@melvin-bot melvin-bot bot changed the title [HybridApp] Problem #5: Deploy the HybridApp more regularly [HOLD for payment 2024-06-13] [HybridApp] Problem #5: Deploy the HybridApp more regularly Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.79-11 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 2024-06-13. 🎊

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 11, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-13] [HybridApp] Problem #5: Deploy the HybridApp more regularly [HOLD for payment 2024-06-18] [HOLD for payment 2024-06-13] [HybridApp] Problem #5: Deploy the HybridApp more regularly Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 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 2024-06-18. 🎊

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-18] [HOLD for payment 2024-06-13] [HybridApp] Problem #5: Deploy the HybridApp more regularly [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [HOLD for payment 2024-06-13] [HybridApp] Problem #5: Deploy the HybridApp more regularly Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-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 2024-06-20. 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants