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

[$500] Allow Desktop AhDoc and Dev builds to be installed alongside production #24426

Closed
Julesssss opened this issue Aug 11, 2023 · 23 comments
Closed
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Monthly KSv2 Reviewing Has a PR in review

Comments

@Julesssss
Copy link
Contributor

Julesssss commented Aug 11, 2023

Problem

We recently enabled the ability to install mobile apps side by side, preventing the need to constantly reinstall and re-authenticate after testing a dev or AdHoc build. However, we didn't do the same thing for Desktop.

Solution

Let's do the same thing for Desktop!

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01af6dab8731944ef3
  • Upwork Job ID: 1690005246967926784
  • Last Price Increase: 2023-12-21
@Julesssss Julesssss self-assigned this Aug 11, 2023
@Julesssss Julesssss added Improvement Item broken or needs improvement. Weekly KSv2 Engineering Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed Weekly KSv2 labels Aug 11, 2023
@melvin-bot melvin-bot bot changed the title Allow Desktop AhDoc and Dev builds to be installed alongside production [$1000] Allow Desktop AhDoc and Dev builds to be installed alongside production Aug 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01af6dab8731944ef3

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

Triggered auto assignment to @lschurr (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ArekChr (External)

@allroundexperts
Copy link
Contributor

allroundexperts commented Aug 11, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Build desktop app separately for different environments

What is the root cause of that problem?

We are using the same app id as defined here.

What changes do you think we should make in order to solve the problem?

We need to use different appId for different environments. We can replace this with:

    appId: appIds[process.env.ELECTRON_ENV],

appIds can be defined as:

const appIds = {
    production: 'com.expensifyreactnative.chat',
    staging: 'com.expensifyreactnative.staging.chat',
    adhoc: 'com.expensifyreactnative.adhoc.chat',
};

We can do a similar thing for productName / dmg object and the name inside package.json if required. The logos seem to be correct for each environment right now except on About page which we can modify as well using the env variable. I think this can be handled in the PR!

What alternative solutions did you explore? (Optional)

None

@Talha345
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

We want to allow multiple builds for each environment to be installed concurrently on a system.

What is the root cause of that problem?

This was never implemented which can bee seen in the config file as we have static values for appID, productName, and dmg etc.

What changes do you think we should make in order to solve the problem?

We can make the configuration file dynamic and generate separate builds for each environment by making the following changes:

const appIds = {
    production: 'com.expensifyreactnative.chat',
    staging: 'com.expensifyreactnative.chat.staging',
    adhoc: 'com.expensifyreactnative.chat.adhoc',
};

Then we can use: appId: appIds[process.env.ELECTRON_ENV].

Similarly, we should follow the same pattern and update productName for clarity like:

productNames: {
    production: 'New Expensify',
    staging: 'New Expensify Staging',
    adhoc: 'New Expensify AdHoc',
},

and use it like productName: productNames[process.env.ELECTRON_ENV].

Same hash can be used for the dmg section and the following configs can be updated under dmg:

title: productNames[process.env.ELECTRON_ENV]
artifactName: `NewExpensify-${process.env.ELECTRON_ENV}-${version}.dmg`,

What alternative solutions did you explore? (Optional)

@jeet-dhandha
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Build desktop app separately for different environments

What is the root cause of that problem?

  • Dynamic Values are not used for below details (Currently only used for s3Bucket):
    • productName
    • appId
    • dmg.title
    • dmg.artifactName
    • protocols.name (Optional - Only if needed.)

What changes do you think we should make in order to solve the problem?

  • We can use process.env.ELECTRON_ENV to set the values dynamically. (As suggested by everyone, i am just giving extra details, that's all.)
const env = process.env.ELECTRON_ENV;

// Below can be used to set values for productName, dmg.title
const names = {
    production: "New Expensify",
    staging: "New Expensify Staging",
    dev: "New Expensify Dev",
    adhoc: "New Expensify Adhoc",
};

const artifactName = names[env].split(" ").join("") + ".dmg";

const appIds = {
    production: "com.expensifyreactnative.chat",
    staging: "com.expensifyreactnative.staging.chat",
    dev: "com.expensifyreactnative.dev.chat",
    adhoc: "com.expensifyreactnative.adhoc.chat",
};
  • For logos we can use ExpensifyCashLogo.js to render logos dynamically. This was created for that sole purpose but haven't been used yet. (I don't know why.)

  • Also we will need to update color in new-expensify-dev.svg from .st2{fill:#002e22} to .st2{fill:#03D47C}. Others like new-expensify-staging.svg and new-expensify.svg are already using above color.

  • For other places like Share QR code, etc. can be updated using ExpensifyCashLogo.js.

What alternative solutions did you explore? (Optional)

  • N/A

@melvin-bot melvin-bot bot added the Overdue label Aug 14, 2023
@Julesssss
Copy link
Contributor Author

Thanks all. Given the relative simplicity of these changes, I think going with the first proposal is fine.

@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Overdue labels Aug 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 14, 2023

📣 @allroundexperts Please request via NewDot manual requests for the Contributor role ($1000)

@allroundexperts
Copy link
Contributor

PR created.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Sep 11, 2023
@melvin-bot melvin-bot bot added the Monthly KSv2 label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

This issue has not been updated in over 15 days. @Julesssss, @ArekChr, @allroundexperts, @lschurr 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!

@Julesssss Julesssss added Weekly KSv2 and removed Monthly KSv2 labels Sep 11, 2023
@Julesssss
Copy link
Contributor Author

We had some issues with the test builds, I just rebuilt and it should work this time.

@Julesssss
Copy link
Contributor Author

This isn't a regression, as it was up to me to verify this... but the prod builds are failing due to these changes.

We're defaulting to the Dev environment when building the prod app...

 • signing         file=desktop-build/mac/New Expensify Dev.app identityName=Developer ID Application: Expensify, Inc.

@Julesssss
Copy link
Contributor Author

Note: When running npm run build-desktop-adhoc locally, the build generated uses word marks of dev environment. This is because .env.adhoc file is missing on localhost.

@allroundexperts I think this happened, like you predicted.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Sep 15, 2023
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

This issue has not been updated in over 15 days. @Julesssss, @ArekChr, @allroundexperts, @lschurr 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!

@allroundexperts
Copy link
Contributor

@Julesssss @lschurr What's the update here? The PR got merged long time ago.

@Julesssss
Copy link
Contributor Author

Sorry, just saw this.

I think we should just close the issue as it's unlikely we'll find time to work on this

@allroundexperts do we need a 50% payment to make this fair? We merged a change but had to revert

@allroundexperts
Copy link
Contributor

Yea, sounds good!

@Julesssss
Copy link
Contributor Author

Hey @lschurr would you mind paying out $500 to @allroundexperts please when you have a moment. Thanks

@Julesssss Julesssss changed the title [$1000] Allow Desktop AhDoc and Dev builds to be installed alongside production [$500] Allow Desktop AhDoc and Dev builds to be installed alongside production Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

Upwork job price has been updated to $500

@allroundexperts
Copy link
Contributor

I get paid through the App @Julesssss. A payment summary comment is all I need 😄

@lschurr
Copy link
Contributor

lschurr commented Dec 22, 2023

Payment summary:

@lschurr
Copy link
Contributor

lschurr commented Dec 22, 2023

I think we can close yeah?

@lschurr lschurr closed this as completed Dec 22, 2023
@JmillsExpensify
Copy link

$500 payment to @allroundexperts based on comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants