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

[No QA] Simplify electron-builder configs #7684

Merged
merged 16 commits into from
Feb 14, 2022

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Feb 10, 2022

Details

Following up on #7665 to do some cleanup.

Fixed Issues

n/a

Tests

  1. Run npm run desktop, and verify that the app loads correctly.
  2. Make a visible change to a React Native file, then save. The desktop app should hot-reload.
  3. Run npm run desktop-build-local, install the app and make sure it works! It should have a production app icon, not a staging app icon.
  4. Run npm run desktop-build-staging-local, install the app and make sure it works! It should have a staging app icon, not a production app icon.
  5. Merge this PR and pray that it doesn't break our desktop deploys 🙃
  • Verify that no errors appear in the JS console

QA Steps

None.

  • Verify that no errors appear in the JS console

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Desktop (production build)

image

image

image

Desktop (staging build)

image

@roryabraham roryabraham self-assigned this Feb 10, 2022
@botify
Copy link

botify commented Feb 10, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@roryabraham roryabraham changed the title Simplify electron-builder configs [HOLD] Simplify electron-builder configs Feb 11, 2022
@botify
Copy link

botify commented Feb 11, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@botify
Copy link

botify commented Feb 11, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@roryabraham roryabraham changed the title [HOLD] Simplify electron-builder configs [HOLD][No QA] Simplify electron-builder configs Feb 11, 2022
@botify
Copy link

botify commented Feb 11, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@roryabraham

This comment was marked as off-topic.

@roryabraham

This comment was marked as off-topic.

@roryabraham

This comment was marked as resolved.

@roryabraham

This comment was marked as resolved.

@neil-marcellini
Copy link
Contributor

I'm going to un-assign from this review because I've been swamped by PRs lately and this one is quite a bit over my head.

@neil-marcellini neil-marcellini removed their request for review February 11, 2022 18:02
Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Looking really great! A few suggestions

config/electronBuilder/electronBuilder.ghactions.config.js Outdated Show resolved Hide resolved
config/electronBuilder/electronBuilder.local.config.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@botify
Copy link

botify commented Feb 11, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@roryabraham
Copy link
Contributor Author

Updated!

@botify
Copy link

botify commented Feb 11, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@botify
Copy link

botify commented Feb 11, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@roryabraham roryabraham marked this pull request as ready for review February 11, 2022 19:58
@roryabraham roryabraham requested a review from a team as a code owner February 11, 2022 19:58
@MelvinBot MelvinBot requested review from Gonals and removed request for a team February 11, 2022 19:58
@roryabraham
Copy link
Contributor Author

Taking this off draft and marking it as ready for review, but I think we should keep it on hold until it's not DBSF.

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Cool, this looks good to me. How come it's on HOLD?

@tgolen
Copy link
Contributor

tgolen commented Feb 14, 2022

Oh, because it was Friday, got it. You can self merge this when you are ready :D

@roryabraham roryabraham changed the title [HOLD][No QA] Simplify electron-builder configs [No QA] Simplify electron-builder configs Feb 14, 2022
@botify
Copy link

botify commented Feb 14, 2022

npm has a package.json file and a package-lock.json file. It seems you updated one without the other, which is usually a sign of a mistake. If you are updating a package make sure that you update the version in package.json then run npm install

@roryabraham roryabraham merged commit 24b9474 into main Feb 14, 2022
@roryabraham roryabraham deleted the Rory-LessConfusingDesktopEnvironments branch February 14, 2022 17:08
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

Copy link
Contributor

@kidroca kidroca left a comment

Choose a reason for hiding this comment

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

I'm working on reducing desktop size here: #7744 and noticed some merge conflicts.
I decided to leave some notes

Do we expect any more Desktop changes, because I'm having to change my code each time a change is made?

(managed to reduce the installer to ~90Mb)

Comment on lines +3 to +10
module.exports = {
...baseElectronBuilderConfig,
publish: [{
provider: 's3',
bucket: process.env.ELECTRON_ENV === 'staging' ? 'staging-expensify-cash' : 'expensify-cash',
channel: 'latest',
}],
afterSign: './desktop/notarize.js',
Copy link
Contributor

Choose a reason for hiding this comment

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

Were there any problems when this was part of the single config?
I have no problems building local builds without this change?

E.g. I don't use --publish and this just creates a local build for me, no need for desktop-build-local and desktop-build-local-staging scripts


Separate question: If notarize.js is something only used for config/build signing why keep it in desktop ? it gets packed to the electron app due to the desktop/*.js pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Were there any problems when this was part of the single config?

I always run into issues with the notarizing step. You don't experience that?

Separate question: If notarize.js is something only used for config/build signing why keep it in desktop ?

Just because it's specific to the desktop application.

Comment on lines +20 to +24
"desktop": "export ELECTRON_ENV=development && node desktop/start.js",
"desktop-build": "export ELECTRON_ENV=production && webpack --config config/webpack/webpack.prod.js --platform desktop && electron-builder --config config/electronBuilder/electronBuilder.ghactions.config.js",
"desktop-build-staging": "export ELECTRON_ENV=staging && webpack --config config/webpack/webpack.staging.js --platform desktop && electron-builder --config config/electronBuilder/electronBuilder.ghactions.config.js",
"desktop-build-local": "export ELECTRON_ENV=production && webpack --config config/webpack/webpack.prod.js --platform desktop && electron-builder --config config/electronBuilder/electronBuilder.local.config.js",
"desktop-build-staging-local": "export ELECTRON_ENV=staging && webpack --config config/webpack/webpack.staging.js --platform desktop && electron-builder --config config/electronBuilder/electronBuilder.local.config.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks a bit odd - none of the other build scripts web/mobile have to set ENV vars in their package script.
It might be better to extract a script like desktop/start.js but perhaps desktop/build.js where the appropriate dotenv file can be loaded. The least it would hide these details and make the scripts shorter

@roryabraham
Copy link
Contributor Author

Do we expect any more Desktop changes

I don't expect any more for now.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @roryabraham in version: 1.1.39-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @timszot in version: 1.1.39-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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.

6 participants