From b857f734cda0049e527d802e0f18359d734bcc5a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 31 Oct 2022 12:41:37 -0600 Subject: [PATCH 001/185] Apply some logging tweaks --- e2e/config.js | 4 ++-- e2e/testRunner.js | 2 +- e2e/utils/logger.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/config.js b/e2e/config.js index 6e8b8793dcd3..2523de555257 100644 --- a/e2e/config.js +++ b/e2e/config.js @@ -14,7 +14,7 @@ module.exports = { APP_PACKAGE: 'com.expensify.chat', // The port of the testing server that communicates with the app - SERVER_PORT: 3000, + SERVER_PORT: 4723, // The amount of times a test should be executed for average performance metrics RUNS: 30, @@ -36,7 +36,7 @@ module.exports = { LOG_FILE: `${OUTPUT_DIR}/debug.log`, // The time in milliseconds after which an operation fails due to timeout - INTERACTION_TIMEOUT: 30_000, + INTERACTION_TIMEOUT: 300000, TEST_NAMES, diff --git a/e2e/testRunner.js b/e2e/testRunner.js index 6884cda5831d..74208c89014d 100644 --- a/e2e/testRunner.js +++ b/e2e/testRunner.js @@ -53,7 +53,7 @@ const restartApp = async () => { const runTestsOnBranch = async (branch, baselineOrCompare) => { // Switch branch and install dependencies const progress = Logger.progressInfo(`Preparing ${baselineOrCompare} tests on branch '${branch}'`); - await execAsync(`git switch ${branch}`); + await execAsync(`git checkout ${branch}`); if (!args.includes('--skipInstallDeps')) { progress.updateText(`Preparing ${baselineOrCompare} tests on branch '${branch}' - npm install`); diff --git a/e2e/utils/logger.js b/e2e/utils/logger.js index cbe76bbaf300..a12fecd1efad 100644 --- a/e2e/utils/logger.js +++ b/e2e/utils/logger.js @@ -1,7 +1,7 @@ const fs = require('fs'); const {LOG_FILE} = require('../config'); -let isVerbose = false; +let isVerbose = true; const setLogLevelVerbose = (value) => { isVerbose = value; }; From 106a88b7067c046de3a86c780e0cdad0053f1683 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 31 Oct 2022 12:43:48 -0600 Subject: [PATCH 002/185] Add TestSpec --- e2e/TestSpec.yml | 32 ++++++++++++++++++++++++++++++++ e2e/testRunner.js | 2 -- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 e2e/TestSpec.yml diff --git a/e2e/TestSpec.yml b/e2e/TestSpec.yml new file mode 100644 index 000000000000..087d331352d6 --- /dev/null +++ b/e2e/TestSpec.yml @@ -0,0 +1,32 @@ +version: 0.1 + +phases: + install: + commands: + - export NVM_DIR=$HOME/.nvm + - . $NVM_DIR/nvm.sh + - nvm install 16.15.1 + + # Fetch latest code from GitHub + - git clone https://github.com/Expensify/App.git Git-App + - cd $DEVICEFARM_TEST_PACKAGE_PATH/Git-App + - git checkout andrew-aws-df + - npm install + + # Bundle install doesn't work so install fastlane manually + - gem install fastlane + + # Move APK to correct location + - mkdir -p android/app/build/outputs/apk/e2eRelease/ + - cp ../app-e2eRelease.apk android/app/build/outputs/apk/e2eRelease/ + + - PORT=4723 + - IP_ADDRESS=$(ip -4 addr show eth0 | grep -Po "(?<=inet\s)\d+(\.\d+){3}") + - reverse_values="{\"ip_address\":\"$IP_ADDRESS\",\"local_port\":\"$PORT\",\"remote_port\":\"$PORT\"}" + - "curl -H \"Content-Type: application/json\" -X POST -d \"$reverse_values\" http://localhost:31007/reverse_forward_tcp" + - adb reverse tcp:$PORT tcp:$PORT + + test: + commands: + - echo "Starting tests" + - npm run test:e2e -- --skipInstallDeps --skipBuild diff --git a/e2e/testRunner.js b/e2e/testRunner.js index 74208c89014d..a3fa0d9b105d 100644 --- a/e2e/testRunner.js +++ b/e2e/testRunner.js @@ -70,8 +70,6 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => { // Install app and reverse ports let progressLog = Logger.progressInfo('Installing app'); await installApp('android'); - Logger.log('Reversing port (for connecting to testing server) …'); - await reversePort(); progressLog.done(); // Start the HTTP server From 9ce17a69024c3ba6b34e9882ef64f2bb55b8582a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 31 Oct 2022 13:40:59 -0600 Subject: [PATCH 003/185] Tweak TestSpec to a working solution --- e2e/TestSpec.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/e2e/TestSpec.yml b/e2e/TestSpec.yml index 087d331352d6..696bd830f218 100644 --- a/e2e/TestSpec.yml +++ b/e2e/TestSpec.yml @@ -13,13 +13,11 @@ phases: - git checkout andrew-aws-df - npm install - # Bundle install doesn't work so install fastlane manually - - gem install fastlane - - # Move APK to correct location + # Move compiled APK to correct location - mkdir -p android/app/build/outputs/apk/e2eRelease/ - cp ../app-e2eRelease.apk android/app/build/outputs/apk/e2eRelease/ + # Reverse ports using AWS magic - PORT=4723 - IP_ADDRESS=$(ip -4 addr show eth0 | grep -Po "(?<=inet\s)\d+(\.\d+){3}") - reverse_values="{\"ip_address\":\"$IP_ADDRESS\",\"local_port\":\"$PORT\",\"remote_port\":\"$PORT\"}" From b06342f1a20080894187193e6c7d6acde41592bb Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 31 Oct 2022 13:49:53 -0600 Subject: [PATCH 004/185] Tweak artifacts --- e2e/TestSpec.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/e2e/TestSpec.yml b/e2e/TestSpec.yml index 696bd830f218..b2d680f7c090 100644 --- a/e2e/TestSpec.yml +++ b/e2e/TestSpec.yml @@ -28,3 +28,10 @@ phases: commands: - echo "Starting tests" - npm run test:e2e -- --skipInstallDeps --skipBuild + +# The artifacts phase lets you specify the location where your tests logs, device logs will be stored. +# And also let you specify the location of your test logs and artifacts which you want to be collected by Device Farm. +# These logs and artifacts will be available through ListArtifacts API in Device Farm. +artifacts: +- $DEVICEFARM_LOG_DIR +- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/e2e From 7bec64d285650d2cbb7560f7da7760cb946f35ab Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 14:54:12 -0600 Subject: [PATCH 005/185] Move e2e to tests folder and remove unused code --- .gitignore | 2 +- README.md | 2 +- e2e/utils/androidReversePort.js | 6 --- e2e/utils/startRecordingVideo.js | 39 ------------------- package.json | 2 +- src/libs/E2E/client.js | 4 +- src/libs/E2E/reactNativeLaunchingTest.js | 2 +- {e2e => tests/e2e}/.env.e2e | 0 {e2e => tests/e2e}/ADDING_TESTS.md | 0 {e2e => tests/e2e}/README.md | 2 +- {e2e => tests/e2e}/TestSpec.yml | 0 {e2e => tests/e2e}/compare/compare.js | 0 {e2e => tests/e2e}/compare/math.js | 0 {e2e => tests/e2e}/compare/output/console.js | 0 {e2e => tests/e2e}/compare/output/format.js | 0 {e2e => tests/e2e}/compare/output/markdown.js | 0 .../e2e}/compare/output/markdownTable.js | 0 {e2e => tests/e2e}/config.js | 0 {e2e => tests/e2e}/measure/math.js | 0 {e2e => tests/e2e}/measure/writeTestStats.js | 0 {e2e => tests/e2e}/server/index.js | 0 {e2e => tests/e2e}/server/routes.js | 0 {e2e => tests/e2e}/testRunner.js | 6 --- {e2e => tests/e2e}/utils/execAsync.js | 0 {e2e => tests/e2e}/utils/installApp.js | 0 {e2e => tests/e2e}/utils/killApp.js | 0 {e2e => tests/e2e}/utils/launchApp.js | 0 {e2e => tests/e2e}/utils/logger.js | 0 {e2e => tests/e2e}/utils/withFailTimeout.js | 0 29 files changed, 7 insertions(+), 58 deletions(-) delete mode 100644 e2e/utils/androidReversePort.js delete mode 100644 e2e/utils/startRecordingVideo.js rename {e2e => tests/e2e}/.env.e2e (100%) rename {e2e => tests/e2e}/ADDING_TESTS.md (100%) rename {e2e => tests/e2e}/README.md (98%) rename {e2e => tests/e2e}/TestSpec.yml (100%) rename {e2e => tests/e2e}/compare/compare.js (100%) rename {e2e => tests/e2e}/compare/math.js (100%) rename {e2e => tests/e2e}/compare/output/console.js (100%) rename {e2e => tests/e2e}/compare/output/format.js (100%) rename {e2e => tests/e2e}/compare/output/markdown.js (100%) rename {e2e => tests/e2e}/compare/output/markdownTable.js (100%) rename {e2e => tests/e2e}/config.js (100%) rename {e2e => tests/e2e}/measure/math.js (100%) rename {e2e => tests/e2e}/measure/writeTestStats.js (100%) rename {e2e => tests/e2e}/server/index.js (100%) rename {e2e => tests/e2e}/server/routes.js (100%) rename {e2e => tests/e2e}/testRunner.js (95%) rename {e2e => tests/e2e}/utils/execAsync.js (100%) rename {e2e => tests/e2e}/utils/installApp.js (100%) rename {e2e => tests/e2e}/utils/killApp.js (100%) rename {e2e => tests/e2e}/utils/launchApp.js (100%) rename {e2e => tests/e2e}/utils/logger.js (100%) rename {e2e => tests/e2e}/utils/withFailTimeout.js (100%) diff --git a/.gitignore b/.gitignore index ba331269cf99..768ab38507e3 100644 --- a/.gitignore +++ b/.gitignore @@ -93,4 +93,4 @@ storybook-static .jest-cache # E2E test reports -e2e/.results/ +tests/e2e/.results/ diff --git a/README.md b/README.md index d63b6b064532..5c01a17b4df5 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ variables referenced here get updated since your local `.env` file is ignored. - `ONYX_METRICS` (optional) - Set this to `true` to capture even more performance metrics and see them in Flipper see [React-Native-Onyx#benchmarks](https://github.com/Expensify/react-native-onyx#benchmarks) for more information - `E2E_TESTING` (optional) - This needs to be set to `true` when running the e2e tests for performance regression testing. - This happens usually automatically, read [this](e2e/README.md) for more information + This happens usually automatically, read [this](tests/e2e/README.md) for more information ---- diff --git a/e2e/utils/androidReversePort.js b/e2e/utils/androidReversePort.js deleted file mode 100644 index b644ca1538dd..000000000000 --- a/e2e/utils/androidReversePort.js +++ /dev/null @@ -1,6 +0,0 @@ -const {SERVER_PORT} = require('../config'); -const execAsync = require('./execAsync'); - -module.exports = function () { - return execAsync(`adb reverse tcp:${SERVER_PORT} tcp:${SERVER_PORT}`); -}; diff --git a/e2e/utils/startRecordingVideo.js b/e2e/utils/startRecordingVideo.js deleted file mode 100644 index 005c9c123774..000000000000 --- a/e2e/utils/startRecordingVideo.js +++ /dev/null @@ -1,39 +0,0 @@ -const execAsync = require('./execAsync'); -const {OUTPUT_DIR} = require('../config'); -const Logger = require('../utils/logger'); - -module.exports = () => { - // The emulator on CI launches with no-window option. - // Taking screenshots results in blank shots. - // Recording a video however includes the graphic content. - const cmd = 'adb shell screenrecord /sdcard/video.mp4'; - let recordingFailed = false; - const recording = execAsync(cmd); - recording.catch((error) => { - // Don't abort on errors - Logger.warn('Error while recording video', error); - recordingFailed = true; - }); - - return (save = false) => { - if (recordingFailed) { return; } - - recording.abort(); - return new Promise((resolve) => { - if (!save) { - resolve(); - return; - } - setTimeout(() => { - if (save) { - const getVideo = () => execAsync('adb pull /sdcard/video.mp4'); - const moveVideo = () => execAsync(`mv video.mp4 ${OUTPUT_DIR}/video.mp4`); - const cleanupVideo = () => execAsync('adb shell rm /sdcard/video.mp4'); - getVideo().then(moveVideo).then(cleanupVideo).then(resolve); - } else { - resolve(); - } - }, 1000); // Give the device some time to finish writing the file - }); - }; -}; diff --git a/package.json b/package.json index bf8cb05fc550..1cc534782b68 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.common.js --env envFile=.env.production", "symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map", "symbolicate:ios": "npx metro-symbolicate main.jsbundle.map", - "test:e2e": "node ./e2e/testRunner.js" + "test:e2e": "node tests/e2e/testRunner.js" }, "dependencies": { "@expensify/react-native-web": "0.18.9", diff --git a/src/libs/E2E/client.js b/src/libs/E2E/client.js index 1d61bfb348a8..82a1acdf3df2 100644 --- a/src/libs/E2E/client.js +++ b/src/libs/E2E/client.js @@ -1,5 +1,5 @@ -import Routes from '../../../e2e/server/routes'; -import Config from '../../../e2e/config'; +import Routes from '../../../tests/e2e/server/routes'; +import Config from '../../../tests/e2e/config'; const SERVER_ADDRESS = `http://localhost:${Config.SERVER_PORT}`; diff --git a/src/libs/E2E/reactNativeLaunchingTest.js b/src/libs/E2E/reactNativeLaunchingTest.js index 392ed7c207b1..f0fa7200a3c9 100644 --- a/src/libs/E2E/reactNativeLaunchingTest.js +++ b/src/libs/E2E/reactNativeLaunchingTest.js @@ -12,7 +12,7 @@ Performance.markStart('regularAppStart'); import '../../../index'; Performance.markEnd('regularAppStart'); -import E2EConfig from '../../../e2e/config'; +import E2EConfig from '../../../tests/e2e/config'; import E2EClient from './client'; console.debug('=========================='); diff --git a/e2e/.env.e2e b/tests/e2e/.env.e2e similarity index 100% rename from e2e/.env.e2e rename to tests/e2e/.env.e2e diff --git a/e2e/ADDING_TESTS.md b/tests/e2e/ADDING_TESTS.md similarity index 100% rename from e2e/ADDING_TESTS.md rename to tests/e2e/ADDING_TESTS.md diff --git a/e2e/README.md b/tests/e2e/README.md similarity index 98% rename from e2e/README.md rename to tests/e2e/README.md index 72cc4fead9a1..be45d677bae7 100644 --- a/e2e/README.md +++ b/tests/e2e/README.md @@ -32,7 +32,7 @@ It will run the tests of a test case multiple time to average out the results. ## Adding tests -To add a test checkout the [designed guide](./ADDING_TESTS.md). +To add a test checkout the [designed guide](tests/e2e/ADDING_TESTS.md). ## Structure diff --git a/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml similarity index 100% rename from e2e/TestSpec.yml rename to tests/e2e/TestSpec.yml diff --git a/e2e/compare/compare.js b/tests/e2e/compare/compare.js similarity index 100% rename from e2e/compare/compare.js rename to tests/e2e/compare/compare.js diff --git a/e2e/compare/math.js b/tests/e2e/compare/math.js similarity index 100% rename from e2e/compare/math.js rename to tests/e2e/compare/math.js diff --git a/e2e/compare/output/console.js b/tests/e2e/compare/output/console.js similarity index 100% rename from e2e/compare/output/console.js rename to tests/e2e/compare/output/console.js diff --git a/e2e/compare/output/format.js b/tests/e2e/compare/output/format.js similarity index 100% rename from e2e/compare/output/format.js rename to tests/e2e/compare/output/format.js diff --git a/e2e/compare/output/markdown.js b/tests/e2e/compare/output/markdown.js similarity index 100% rename from e2e/compare/output/markdown.js rename to tests/e2e/compare/output/markdown.js diff --git a/e2e/compare/output/markdownTable.js b/tests/e2e/compare/output/markdownTable.js similarity index 100% rename from e2e/compare/output/markdownTable.js rename to tests/e2e/compare/output/markdownTable.js diff --git a/e2e/config.js b/tests/e2e/config.js similarity index 100% rename from e2e/config.js rename to tests/e2e/config.js diff --git a/e2e/measure/math.js b/tests/e2e/measure/math.js similarity index 100% rename from e2e/measure/math.js rename to tests/e2e/measure/math.js diff --git a/e2e/measure/writeTestStats.js b/tests/e2e/measure/writeTestStats.js similarity index 100% rename from e2e/measure/writeTestStats.js rename to tests/e2e/measure/writeTestStats.js diff --git a/e2e/server/index.js b/tests/e2e/server/index.js similarity index 100% rename from e2e/server/index.js rename to tests/e2e/server/index.js diff --git a/e2e/server/routes.js b/tests/e2e/server/routes.js similarity index 100% rename from e2e/server/routes.js rename to tests/e2e/server/routes.js diff --git a/e2e/testRunner.js b/tests/e2e/testRunner.js similarity index 95% rename from e2e/testRunner.js rename to tests/e2e/testRunner.js index a3fa0d9b105d..599f0f2e319a 100644 --- a/e2e/testRunner.js +++ b/tests/e2e/testRunner.js @@ -24,11 +24,9 @@ const killApp = require('./utils/killApp'); const launchApp = require('./utils/launchApp'); const createServerInstance = require('./server'); const installApp = require('./utils/installApp'); -const reversePort = require('./utils/androidReversePort'); const math = require('./measure/math'); const writeTestStats = require('./measure/writeTestStats'); const withFailTimeout = require('./utils/withFailTimeout'); -const startRecordingVideo = require('./utils/startRecordingVideo'); const args = process.argv.slice(2); @@ -121,8 +119,6 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => { const progressText = `(${testIndex + 1}/${numOfTests}) Running test '${config.name}' (iteration ${i + 1}/${RUNS})`; testLog.updateText(progressText); - const stopVideoRecording = startRecordingVideo(); - await restartApp(); // Wait for a test to finish by waiting on its done call to the http server @@ -134,10 +130,8 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => { resolve(); }); }), progressText); - await stopVideoRecording(false); } catch (e) { // When we fail due to a timeout it's interesting to take a screenshot of the emulator to see whats going on - await stopVideoRecording(true); testLog.done(); throw e; // Rethrow to abort execution } diff --git a/e2e/utils/execAsync.js b/tests/e2e/utils/execAsync.js similarity index 100% rename from e2e/utils/execAsync.js rename to tests/e2e/utils/execAsync.js diff --git a/e2e/utils/installApp.js b/tests/e2e/utils/installApp.js similarity index 100% rename from e2e/utils/installApp.js rename to tests/e2e/utils/installApp.js diff --git a/e2e/utils/killApp.js b/tests/e2e/utils/killApp.js similarity index 100% rename from e2e/utils/killApp.js rename to tests/e2e/utils/killApp.js diff --git a/e2e/utils/launchApp.js b/tests/e2e/utils/launchApp.js similarity index 100% rename from e2e/utils/launchApp.js rename to tests/e2e/utils/launchApp.js diff --git a/e2e/utils/logger.js b/tests/e2e/utils/logger.js similarity index 100% rename from e2e/utils/logger.js rename to tests/e2e/utils/logger.js diff --git a/e2e/utils/withFailTimeout.js b/tests/e2e/utils/withFailTimeout.js similarity index 100% rename from e2e/utils/withFailTimeout.js rename to tests/e2e/utils/withFailTimeout.js From 6c255fb0b363433e2af15703d7b0405f574eca67 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 16:26:36 -0600 Subject: [PATCH 006/185] Try making run from GitHub actions --- .../e2ePerformanceRegressionTests.yml | 83 +++++-------------- 1 file changed, 22 insertions(+), 61 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index a59eb8c0dbff..6f86234fe740 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -8,72 +8,33 @@ jobs: e2e-tests: if: ${{ github.event.label.name == 'e2e' }} name: "Run e2e performance regression tests" - # Although the tests will run on an android emulator, using macOS as its more performant - runs-on: macos-12 + runs-on: ubuntu-latest steps: - uses: Expensify/App/.github/actions/composite/setupNode@main - - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 - with: - ruby-version: '2.7' - bundler-cache: true - - # Improve emulator startup time, see https://github.com/marketplace/actions/android-emulator-runner - - name: Gradle cache - uses: gradle/gradle-build-action@v2 + - name: Build APK + run: npm run android-build-e2e - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-28 + - name: Zip built APK + run: zip android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk.zip - - name: Create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 with: - api-level: 28 - ram-size: 3072M - heap-size: 512M - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." - -# Note: if the android build fails the logs can be incomplete. It can help to run the build once manually to get a full log - - name: Preheat build system - env: - JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} - run: | - npm run android-build-e2e + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 - - name: Start emulator and run tests - id: tests - uses: reactivecircus/android-emulator-runner@v2 - env: - JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} - INTERACTION_TIMEOUT: 120000 # 2 minutes - # when logging progresses only refresh the _log_ every 30 seconds - LOGGER_PROGRESS_REFRESH_RATE: 30000 - # TODO: remove this once implementation done. - baseline: dev/ci-e2e-tests + - name: Schedule test run + uses: realm/aws-devicefarm/test-application@v1 with: - api-level: 28 - ram-size: 3072M - heap-size: 512M - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - script: npm run test:e2e - - - name: If tests failed, upload logs and video - if: ${{ failure() && steps.tests.conclusion == 'failure' }} - uses: actions/upload-artifact@v3 - with: - name: test-failure-logs - path: e2e/.results - retention-days: 5 - + name: run_with_uploads + project_arn: ${{ secrets.AWS_PROJECT_ARN }} + app_file: android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk + app_type: ANDROID_APP + test_type: APPIUM_NODE + test_package_file: android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk.zip + test_package_type: APPIUM_NODE_TEST_PACKAGE + test_spec_file: tests/e2e/TestSpec.yml + test_spec_type: APPIUM_NODE_TEST_SPEC + remote_src: false From 1631bea914861fbbce80dc50b35556a548a0e2d0 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 16:28:12 -0600 Subject: [PATCH 007/185] Use correct version --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 6f86234fe740..3974635445cc 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -26,7 +26,7 @@ jobs: aws-region: us-west-2 - name: Schedule test run - uses: realm/aws-devicefarm/test-application@v1 + uses: realm/aws-devicefarm/test-application@master with: name: run_with_uploads project_arn: ${{ secrets.AWS_PROJECT_ARN }} From cb3006078a76b7344fa110b206b866ddf5206775 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 16:29:13 -0600 Subject: [PATCH 008/185] Use `workflow_dispatch` as well --- .github/workflows/e2ePerformanceRegressionTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 3974635445cc..e80337a6d280 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -1,6 +1,7 @@ name: Run e2e performance regression tests on: + workflow_dispatch: pull_request: types: [labeled] From 30d1c3330da71a62bb43976e9debaa377ec88d9d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 16:39:15 -0600 Subject: [PATCH 009/185] Use macos for Bundle --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index e80337a6d280..0325f683034b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -9,7 +9,7 @@ jobs: e2e-tests: if: ${{ github.event.label.name == 'e2e' }} name: "Run e2e performance regression tests" - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: Expensify/App/.github/actions/composite/setupNode@main From 579141eae6fd79cb5f9b6418c9777480c962b362 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 16:41:06 -0600 Subject: [PATCH 010/185] Delete unused workflows to clean up my inbox --- .github/workflows/cla.yml | 40 ------------------- .github/workflows/contributorChecklists.yml | 14 ------- .../workflows/contributorPlusChecklists.yml | 14 ------- .../e2ePerformanceRegressionTests.yml | 4 +- .github/workflows/validateGithubActions.yml | 21 ---------- .github/workflows/verifyPodfile.yml | 15 ------- .github/workflows/verifySignedCommits.yml | 14 ------- 7 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 .github/workflows/cla.yml delete mode 100644 .github/workflows/contributorChecklists.yml delete mode 100644 .github/workflows/contributorPlusChecklists.yml delete mode 100644 .github/workflows/validateGithubActions.yml delete mode 100644 .github/workflows/verifyPodfile.yml delete mode 100644 .github/workflows/verifySignedCommits.yml diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 index 8943669c2ba8..000000000000 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: CLA Assistant - -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened, synchronize] - -jobs: - CLA: - runs-on: ubuntu-latest - # This job only runs for pull request comments or pull request target events (not issue comments) - # It does not run for pull requests created by OSBotify - if: ${{ github.event.issue.pull_request || (github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'OSBotify') }} - steps: - - uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73 - id: sign - with: - text: ${{ github.event.comment.body }} - regex: '\s*I have read the CLA Document and I hereby sign the CLA\s*' - - uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73 - id: recheck - with: - text: ${{ github.event.comment.body }} - regex: '\s*recheck\s*' - - name: CLA Assistant - if: ${{ steps.recheck.outputs.match != '' || steps.sign.outputs.match != '' }} || github.event_name == 'pull_request_target' - # Version: 2.1.2-beta - uses: cla-assistant/github-action@948230deb0d44dd38957592f08c6bd934d96d0cf - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOTIFY_TOKEN }} - with: - path-to-signatures: '${{ github.repository }}/cla.json' - path-to-document: 'https://github.com/${{ github.repository }}/blob/main/contributingGuides/CLA.md' - branch: 'main' - remote-organization-name: 'Expensify' - remote-repository-name: 'CLA' - lock-pullrequest-aftermerge: false - allowlist: OSBotify,snyk-bot diff --git a/.github/workflows/contributorChecklists.yml b/.github/workflows/contributorChecklists.yml deleted file mode 100644 index 632fd5355d92..000000000000 --- a/.github/workflows/contributorChecklists.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: PR Author Checklist - -on: pull_request - -jobs: - checklist: - runs-on: ubuntu-latest - if: github.actor != 'OSBotify' - steps: - - name: contributorChecklist.js - uses: Expensify/App/.github/actions/javascript/contributorChecklist@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECKLIST: 'contributor' diff --git a/.github/workflows/contributorPlusChecklists.yml b/.github/workflows/contributorPlusChecklists.yml deleted file mode 100644 index 46dc8ae5a733..000000000000 --- a/.github/workflows/contributorPlusChecklists.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: PR Reviewer Checklist - -on: pull_request_review - -jobs: - checklist: - runs-on: ubuntu-latest - if: github.actor != 'OSBotify' - steps: - - name: contributorChecklist.js - uses: Expensify/App/.github/actions/javascript/contributorChecklist@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECKLIST: 'reviewer' diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 0325f683034b..9051c0517f2c 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -1,9 +1,7 @@ name: Run e2e performance regression tests on: - workflow_dispatch: - pull_request: - types: [labeled] + push: jobs: e2e-tests: diff --git a/.github/workflows/validateGithubActions.yml b/.github/workflows/validateGithubActions.yml deleted file mode 100644 index 4e51d785d6b0..000000000000 --- a/.github/workflows/validateGithubActions.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Validate Github Actions - -on: - pull_request: - types: [opened, synchronize] - branches-ignore: [staging, production] - -jobs: - verify: - if: github.actor != 'OSBotify' - runs-on: ubuntu-latest - steps: - - uses: Expensify/App/.github/actions/composite/setupNode@main - - # Rebuild all the actions on this branch and check for a diff. Fail if there is one, - # because that would be a sign that the PR author did not rebuild the Github Actions - - name: Verify Javascript Action Builds - run: ./.github/scripts/verifyActions.sh - - - name: Validate actions and workflows - run: npm run gh-actions-validate diff --git a/.github/workflows/verifyPodfile.yml b/.github/workflows/verifyPodfile.yml deleted file mode 100644 index 17d80ca7e055..000000000000 --- a/.github/workflows/verifyPodfile.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Verify Podfile - -on: - pull_request: - types: [opened, synchronize] - branches-ignore: [staging, production] - -jobs: - verify: - if: github.actor != 'OSBotify' - runs-on: ubuntu-latest - steps: - - uses: Expensify/App/.github/actions/composite/setupNode@main - - - run: ./.github/scripts/verifyPodfile.sh diff --git a/.github/workflows/verifySignedCommits.yml b/.github/workflows/verifySignedCommits.yml deleted file mode 100644 index e1068e71e041..000000000000 --- a/.github/workflows/verifySignedCommits.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Verify signed commits - -on: - pull_request: - types: [opened, synchronize] - branches-ignore: [staging, production] - -jobs: - verifySignedCommits: - runs-on: ubuntu-latest - steps: - - uses: Expensify/App/.github/actions/javascript/verifySignedCommits@main - with: - GITHUB_TOKEN: ${{ github.token }} From 478ee01bbff9d148786027f16b6422270d899b7d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 16:41:49 -0600 Subject: [PATCH 011/185] Run on push --- .github/workflows/e2ePerformanceRegressionTests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 9051c0517f2c..22c43cd37ad4 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -5,7 +5,6 @@ on: jobs: e2e-tests: - if: ${{ github.event.label.name == 'e2e' }} name: "Run e2e performance regression tests" runs-on: macos-latest steps: From 48c9f8cb3a1c8c704fbca35690c78218faeb6a2d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 17:23:40 -0600 Subject: [PATCH 012/185] Set up ruby and include device pool --- .github/workflows/e2ePerformanceRegressionTests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 22c43cd37ad4..5d93de3389d0 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -10,6 +10,11 @@ jobs: steps: - uses: Expensify/App/.github/actions/composite/setupNode@main + - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 + with: + ruby-version: '2.7' + bundler-cache: true + - name: Build APK run: npm run android-build-e2e @@ -28,6 +33,7 @@ jobs: with: name: run_with_uploads project_arn: ${{ secrets.AWS_PROJECT_ARN }} + device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} app_file: android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app_type: ANDROID_APP test_type: APPIUM_NODE From 574b8fb67ee36dd6c728bdfe0bfee71c67ad3939 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 17:37:56 -0600 Subject: [PATCH 013/185] Tweak android build settings --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 5d93de3389d0..fabc4882f548 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -6,7 +6,7 @@ on: jobs: e2e-tests: name: "Run e2e performance regression tests" - runs-on: macos-latest + runs-on: macos-12 steps: - uses: Expensify/App/.github/actions/composite/setupNode@main @@ -16,6 +16,8 @@ jobs: bundler-cache: true - name: Build APK + env: + JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: npm run android-build-e2e - name: Zip built APK From 84b94e4f255511b5dd65462f738ce98b2a48e342 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 18:13:08 -0600 Subject: [PATCH 014/185] Add debug lines --- .github/workflows/e2ePerformanceRegressionTests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index fabc4882f548..88cae5c05d89 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -15,13 +15,19 @@ jobs: ruby-version: '2.7' bundler-cache: true + - name: debug + run: | + ls -la + ls -la android + ls -la android/app + - name: Build APK env: JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: npm run android-build-e2e - name: Zip built APK - run: zip android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk.zip + run: zip android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk.zip android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 From 90f41cc0044b07fd58512937e6a46e26a751daa3 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 18:26:17 -0600 Subject: [PATCH 015/185] Correct env file location --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 74060ccb501c..9289e1bfd5d5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,7 +16,7 @@ opt_out_usage platform :android do desc "Generate a new local APK for e2e testing" lane :build_e2e do - ENV["ENVFILE"]="e2e/.env.e2e" + ENV["ENVFILE"]="tests/e2e/.env.e2e" ENV["ENTRY_FILE"]="src/libs/E2E/reactNativeLaunchingTest.js" gradle( From 57dc2d750041be28c5f2214054e6d45e266e7df6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 19:03:21 -0600 Subject: [PATCH 016/185] Tweak two configs to pass tests --- tests/e2e/TestSpec.yml | 2 +- tests/e2e/config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index b2d680f7c090..44b52e2755e8 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -8,7 +8,7 @@ phases: - nvm install 16.15.1 # Fetch latest code from GitHub - - git clone https://github.com/Expensify/App.git Git-App + - git clone https://github.com/AndrewGable/App.git Git-App - cd $DEVICEFARM_TEST_PACKAGE_PATH/Git-App - git checkout andrew-aws-df - npm install diff --git a/tests/e2e/config.js b/tests/e2e/config.js index 2523de555257..03e3b4553c08 100644 --- a/tests/e2e/config.js +++ b/tests/e2e/config.js @@ -1,4 +1,4 @@ -const OUTPUT_DIR = 'e2e/.results'; +const OUTPUT_DIR = 'tests/e2e/.results'; /** * @typedef TestConfig From 1d3a54b3c119c987de6f2ea54dd61118fa1bc94a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 19:03:42 -0600 Subject: [PATCH 017/185] Remove debug --- .github/workflows/e2ePerformanceRegressionTests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 88cae5c05d89..a120a9aabca0 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -15,12 +15,6 @@ jobs: ruby-version: '2.7' bundler-cache: true - - name: debug - run: | - ls -la - ls -la android - ls -la android/app - - name: Build APK env: JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} From 063381518c00ab5226626cdb874642aefac9e65c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 20:06:10 -0600 Subject: [PATCH 018/185] Tweak install path for adb --- tests/e2e/TestSpec.yml | 2 ++ tests/e2e/utils/installApp.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 44b52e2755e8..efa6c148166d 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -7,6 +7,8 @@ phases: - . $NVM_DIR/nvm.sh - nvm install 16.15.1 + - ls -la + # Fetch latest code from GitHub - git clone https://github.com/AndrewGable/App.git Git-App - cd $DEVICEFARM_TEST_PACKAGE_PATH/Git-App diff --git a/tests/e2e/utils/installApp.js b/tests/e2e/utils/installApp.js index 79d3bb1638e2..800e537c5289 100644 --- a/tests/e2e/utils/installApp.js +++ b/tests/e2e/utils/installApp.js @@ -2,7 +2,7 @@ const {APP_PACKAGE} = require('../config'); const execAsync = require('./execAsync'); const Logger = require('./logger'); -const APP_PATH_FROM_ROOT = 'android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk'; +const APP_PATH_FROM_ROOT = '../app-e2eRelease.apk'; /** * Installs the app on the currently connected device for the given platform. From a57301e66c3d187a2427e1d729d00618c0eccd6f Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 20:41:52 -0600 Subject: [PATCH 019/185] Show all files --- tests/e2e/TestSpec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index efa6c148166d..48d4e0045e31 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -7,7 +7,7 @@ phases: - . $NVM_DIR/nvm.sh - nvm install 16.15.1 - - ls -la + - ls -R # Fetch latest code from GitHub - git clone https://github.com/AndrewGable/App.git Git-App From 6b53c5ddfd810091f5f0103323b643e99ff70eb6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 20:42:35 -0600 Subject: [PATCH 020/185] Add find --- tests/e2e/TestSpec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 48d4e0045e31..820428d24caa 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -8,6 +8,7 @@ phases: - nvm install 16.15.1 - ls -R + - find . # Fetch latest code from GitHub - git clone https://github.com/AndrewGable/App.git Git-App From 278350d6b73a198280009ae1ec941194d8b1d6e8 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 2 Nov 2022 20:45:21 -0600 Subject: [PATCH 021/185] Try to fix file paths --- .github/workflows/e2ePerformanceRegressionTests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index a120a9aabca0..0ba93df7685a 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -20,8 +20,11 @@ jobs: JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: npm run android-build-e2e + - name: Copy APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease.apk + - name: Zip built APK - run: zip android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk.zip android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk + run: zip app-e2eRelease.apk.zip app-e2eRelease.apk - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -36,10 +39,10 @@ jobs: name: run_with_uploads project_arn: ${{ secrets.AWS_PROJECT_ARN }} device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} - app_file: android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk + app_file: app-e2eRelease.apk app_type: ANDROID_APP test_type: APPIUM_NODE - test_package_file: android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk.zip + test_package_file: app-e2eRelease.apk.zip test_package_type: APPIUM_NODE_TEST_PACKAGE test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC From 1a95f0aeb51809432d6dfa14f0e127ba98634675 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 11:23:15 -0600 Subject: [PATCH 022/185] Try to grab artifacts from device farm --- .../workflows/e2ePerformanceRegressionTests.yml | 14 +++++++++++++- tests/e2e/TestSpec.yml | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 0ba93df7685a..6d2ec1a31043 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -36,7 +36,7 @@ jobs: - name: Schedule test run uses: realm/aws-devicefarm/test-application@master with: - name: run_with_uploads + name: App E2E Performance Regression Tests project_arn: ${{ secrets.AWS_PROJECT_ARN }} device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} app_file: app-e2eRelease.apk @@ -47,3 +47,15 @@ jobs: test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC remote_src: false + file_artifacts: | + tests/e2e/.results/current.json + tests/e2e/.results/baseline.json + tests/e2e/.results/compare.json + tests/e2e/.results/debug.log + tests/e2e/.results/output.md + + - name: Debug + run: find . + + - name: Print results + run: cat tests/e2e/.results/* diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 820428d24caa..62ac936d8e21 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -37,4 +37,10 @@ phases: # These logs and artifacts will be available through ListArtifacts API in Device Farm. artifacts: - $DEVICEFARM_LOG_DIR -- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/e2e + +# Custom artifacts +- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/current.json +- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/compare.json +- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/baseline.json +- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/debug.log +- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/output.md From 3e9deb0af9c156c826e8ca5603318501761f5599 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 11:43:59 -0600 Subject: [PATCH 023/185] Try to see if this improves perf of build --- .github/actions/composite/setupNode/action.yml | 7 +------ .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 2e92ac26d667..534461c3e8fb 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -13,9 +13,4 @@ runs: node-version-file: '.nvmrc' cache: npm - - name: Install node packages - uses: nick-invision/retry@7c68161adf97a48beb850a595b8784ec57a98cbb - with: - timeout_minutes: 10 - max_attempts: 5 - command: npm ci + - run: npm ci diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 6d2ec1a31043..269fb47237af 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -15,6 +15,10 @@ jobs: ruby-version: '2.7' bundler-cache: true + # Cache gradle to improve Android build time + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + - name: Build APK env: JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} From 4ad6c44d9f0c6799177b79cd5e3705af8ba9229d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 11:46:09 -0600 Subject: [PATCH 024/185] Test cache --- .github/actions/composite/setupNode/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 534461c3e8fb..77f9db8ab4d8 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -13,4 +13,5 @@ runs: node-version-file: '.nvmrc' cache: npm - - run: npm ci + - name: Install NPM + run: npm ci From 4bd55e1cb472bb8fbd1d44d9de3bf4ca179fd463 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 11:54:57 -0600 Subject: [PATCH 025/185] Try to use straight npm ci --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 269fb47237af..c8175fc2bcd8 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -8,7 +8,7 @@ jobs: name: "Run e2e performance regression tests" runs-on: macos-12 steps: - - uses: Expensify/App/.github/actions/composite/setupNode@main + - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 with: From 1ffc8d06cb124c502046f8165c54f85b5fcfcb0c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 12:17:30 -0600 Subject: [PATCH 026/185] Try different path for artifacts --- .../workflows/e2ePerformanceRegressionTests.yml | 10 +++++----- tests/e2e/TestSpec.yml | 14 ++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index c8175fc2bcd8..fdd38867a620 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -52,11 +52,11 @@ jobs: test_spec_type: APPIUM_NODE_TEST_SPEC remote_src: false file_artifacts: | - tests/e2e/.results/current.json - tests/e2e/.results/baseline.json - tests/e2e/.results/compare.json - tests/e2e/.results/debug.log - tests/e2e/.results/output.md + Git-App/tests/e2e/.results/current.json + Git-App/tests/e2e/.results/baseline.json + Git-App/tests/e2e/.results/compare.json + Git-App/tests/e2e/.results/debug.log + Git-App/tests/e2e/.results/output.md - name: Debug run: find . diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 62ac936d8e21..1f6b37d37980 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -31,16 +31,14 @@ phases: commands: - echo "Starting tests" - npm run test:e2e -- --skipInstallDeps --skipBuild + - cat tests/e2e/.results/output.md # The artifacts phase lets you specify the location where your tests logs, device logs will be stored. # And also let you specify the location of your test logs and artifacts which you want to be collected by Device Farm. # These logs and artifacts will be available through ListArtifacts API in Device Farm. artifacts: -- $DEVICEFARM_LOG_DIR - -# Custom artifacts -- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/current.json -- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/compare.json -- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/baseline.json -- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/debug.log -- $DEVICEFARM_TEST_PACKAGE_PATH/Git-App/tests/e2e/.results/output.md +- Git-App/tests/e2e/.results/current.json +- Git-App/tests/e2e/.results/compare.json +- Git-App/tests/e2e/.results/baseline.json +- Git-App/tests/e2e/.results/debug.log +- Git-App/tests/e2e/.results/output.md From 665296a52b062597842fd253b7e7ce84e904d94a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 13:18:34 -0600 Subject: [PATCH 027/185] Try one last path --- tests/e2e/TestSpec.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 1f6b37d37980..80ccfd1110c5 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -37,8 +37,8 @@ phases: # And also let you specify the location of your test logs and artifacts which you want to be collected by Device Farm. # These logs and artifacts will be available through ListArtifacts API in Device Farm. artifacts: -- Git-App/tests/e2e/.results/current.json -- Git-App/tests/e2e/.results/compare.json -- Git-App/tests/e2e/.results/baseline.json -- Git-App/tests/e2e/.results/debug.log -- Git-App/tests/e2e/.results/output.md +- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/current.json +- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/compare.json +- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/baseline.json +- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/debug.log +- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/output.md From 540f36bb235724d7b9da4343c267208be2df282a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 13:50:59 -0600 Subject: [PATCH 028/185] Clean up TestSpec --- tests/e2e/TestSpec.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 80ccfd1110c5..1bc628ae3d02 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -7,19 +7,12 @@ phases: - . $NVM_DIR/nvm.sh - nvm install 16.15.1 - - ls -R - - find . - # Fetch latest code from GitHub - git clone https://github.com/AndrewGable/App.git Git-App - cd $DEVICEFARM_TEST_PACKAGE_PATH/Git-App - git checkout andrew-aws-df - npm install - # Move compiled APK to correct location - - mkdir -p android/app/build/outputs/apk/e2eRelease/ - - cp ../app-e2eRelease.apk android/app/build/outputs/apk/e2eRelease/ - # Reverse ports using AWS magic - PORT=4723 - IP_ADDRESS=$(ip -4 addr show eth0 | grep -Po "(?<=inet\s)\d+(\.\d+){3}") @@ -33,9 +26,6 @@ phases: - npm run test:e2e -- --skipInstallDeps --skipBuild - cat tests/e2e/.results/output.md -# The artifacts phase lets you specify the location where your tests logs, device logs will be stored. -# And also let you specify the location of your test logs and artifacts which you want to be collected by Device Farm. -# These logs and artifacts will be available through ListArtifacts API in Device Farm. artifacts: - $WORKING_DIRECTORY/Git-App/tests/e2e/.results/current.json - $WORKING_DIRECTORY/Git-App/tests/e2e/.results/compare.json From 2048bd73bbf578fecbd719d30598ec7ecc51ba17 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 15:55:23 -0600 Subject: [PATCH 029/185] Try to save to `WORKING_DIRECTORY` --- .github/actions/composite/setupNode/action.yml | 8 ++++++-- .github/workflows/e2ePerformanceRegressionTests.yml | 8 ++------ tests/e2e/TestSpec.yml | 6 +----- tests/e2e/config.js | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 77f9db8ab4d8..2e92ac26d667 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -13,5 +13,9 @@ runs: node-version-file: '.nvmrc' cache: npm - - name: Install NPM - run: npm ci + - name: Install node packages + uses: nick-invision/retry@7c68161adf97a48beb850a595b8784ec57a98cbb + with: + timeout_minutes: 10 + max_attempts: 5 + command: npm ci diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index fdd38867a620..966ae137f39a 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -8,7 +8,7 @@ jobs: name: "Run e2e performance regression tests" runs-on: macos-12 steps: - - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df + - uses: Expensify/App/.github/actions/composite/setupNode@main - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 with: @@ -52,11 +52,7 @@ jobs: test_spec_type: APPIUM_NODE_TEST_SPEC remote_src: false file_artifacts: | - Git-App/tests/e2e/.results/current.json - Git-App/tests/e2e/.results/baseline.json - Git-App/tests/e2e/.results/compare.json - Git-App/tests/e2e/.results/debug.log - Git-App/tests/e2e/.results/output.md + Customer Artifacts.zip - name: Debug run: find . diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 1bc628ae3d02..981fd9246bcd 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -27,8 +27,4 @@ phases: - cat tests/e2e/.results/output.md artifacts: -- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/current.json -- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/compare.json -- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/baseline.json -- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/debug.log -- $WORKING_DIRECTORY/Git-App/tests/e2e/.results/output.md +- $WORKING_DIRECTORY diff --git a/tests/e2e/config.js b/tests/e2e/config.js index 03e3b4553c08..faed4bd07081 100644 --- a/tests/e2e/config.js +++ b/tests/e2e/config.js @@ -1,4 +1,4 @@ -const OUTPUT_DIR = 'tests/e2e/.results'; +const OUTPUT_DIR = process.env.WORKING_DIRECTORY || 'tests/e2e/.results'; /** * @typedef TestConfig From f0907968ee8405d604698128a86a13e1db5ce5cc Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 15:59:37 -0600 Subject: [PATCH 030/185] Add debug lines --- tests/e2e/TestSpec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 981fd9246bcd..6c89b3c53598 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -24,7 +24,7 @@ phases: commands: - echo "Starting tests" - npm run test:e2e -- --skipInstallDeps --skipBuild - - cat tests/e2e/.results/output.md + - ls -la $WORKING_DIRECTORY artifacts: - $WORKING_DIRECTORY From 3b5ad5aa5242adf3690f86db212f34563b95b202 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 16:53:12 -0600 Subject: [PATCH 031/185] Try to leave as a comment --- .../e2ePerformanceRegressionTests.yml | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 966ae137f39a..d5dd2095839b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -51,11 +51,27 @@ jobs: test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC remote_src: false - file_artifacts: | - Customer Artifacts.zip + file_artifacts: Customer Artifacts.zip + + - name: Unzip Artifacts + run: unzip Customer Artifacts.zip - name: Debug - run: find . + run: find Host_Machine_Files - name: Print results - run: cat tests/e2e/.results/* + run: cat Host_Machine_Files/$WORKING_DIRECTORY/compare.json + + - name: Set env + run: echo "OUTPUT=$(cat Host_Machine_Files/$WORKING_DIRECTORY/compare.json)" >> $OUTPUT + + - name: Comment on PR + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ${{ env.OUTPUT }} + }) From e472470893867648cfbd85a5c2c5d24da1efece6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 18:01:12 -0600 Subject: [PATCH 032/185] Add \ --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index d5dd2095839b..76181227e8c6 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -54,7 +54,7 @@ jobs: file_artifacts: Customer Artifacts.zip - name: Unzip Artifacts - run: unzip Customer Artifacts.zip + run: unzip Customer\ Artifacts.zip - name: Debug run: find Host_Machine_Files From e3e44564481902aa70b43e4a39dd97bdf0c7a99b Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 18:49:54 -0600 Subject: [PATCH 033/185] Remove debug --- tests/e2e/TestSpec.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 6c89b3c53598..d3a2ed581183 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -24,7 +24,6 @@ phases: commands: - echo "Starting tests" - npm run test:e2e -- --skipInstallDeps --skipBuild - - ls -la $WORKING_DIRECTORY artifacts: - $WORKING_DIRECTORY From 01ea3145d57748e2d36e7c261ebc9b82bac8ed39 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 19:29:36 -0600 Subject: [PATCH 034/185] Try to use ./ --- .github/workflows/e2ePerformanceRegressionTests.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 76181227e8c6..e554d9ef9925 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -56,14 +56,11 @@ jobs: - name: Unzip Artifacts run: unzip Customer\ Artifacts.zip - - name: Debug - run: find Host_Machine_Files - - name: Print results - run: cat Host_Machine_Files/$WORKING_DIRECTORY/compare.json + run: cat ./Host_Machine_Files/$WORKING_DIRECTORY/compare.json - name: Set env - run: echo "OUTPUT=$(cat Host_Machine_Files/$WORKING_DIRECTORY/compare.json)" >> $OUTPUT + run: echo "OUTPUT=$(cat ./Host_Machine_Files/$WORKING_DIRECTORY/compare.json)" >> $OUTPUT - name: Comment on PR uses: actions/github-script@v6 From 6711db72bdcf093396f0c27f9760c987e93f4982 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 20:05:39 -0600 Subject: [PATCH 035/185] Try ubuntu --- .github/workflows/e2ePerformanceRegressionTests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index e554d9ef9925..c9d55f4a376b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -6,7 +6,7 @@ on: jobs: e2e-tests: name: "Run e2e performance regression tests" - runs-on: macos-12 + runs-on: ubuntu-latest steps: - uses: Expensify/App/.github/actions/composite/setupNode@main @@ -20,8 +20,8 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Build APK - env: - JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} +# env: +# JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: npm run android-build-e2e - name: Copy APK From 827de9e5a78e020e5e23eb6153534fe55db45d97 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 20:45:25 -0600 Subject: [PATCH 036/185] More debug --- .github/workflows/e2ePerformanceRegressionTests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index c9d55f4a376b..abda72b5f80a 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -20,8 +20,6 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Build APK -# env: -# JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: npm run android-build-e2e - name: Copy APK @@ -56,11 +54,14 @@ jobs: - name: Unzip Artifacts run: unzip Customer\ Artifacts.zip + - name: debug + run: find . + - name: Print results - run: cat ./Host_Machine_Files/$WORKING_DIRECTORY/compare.json + run: cat ./Host_Machine_Files/$WORKING_DIRECTORY/output.md - name: Set env - run: echo "OUTPUT=$(cat ./Host_Machine_Files/$WORKING_DIRECTORY/compare.json)" >> $OUTPUT + run: echo "OUTPUT=$(cat ./Host_Machine_Files/$WORKING_DIRECTORY/output.md)" >> $OUTPUT - name: Comment on PR uses: actions/github-script@v6 From 3bba04ed2c078e7e5110706e6568a29aa863b179 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 20:51:00 -0600 Subject: [PATCH 037/185] Escape $ --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index abda72b5f80a..a85d0c783fc9 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -58,7 +58,7 @@ jobs: run: find . - name: Print results - run: cat ./Host_Machine_Files/$WORKING_DIRECTORY/output.md + run: cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - name: Set env run: echo "OUTPUT=$(cat ./Host_Machine_Files/$WORKING_DIRECTORY/output.md)" >> $OUTPUT From 5e0bf35811606ca68cf655cbefa83f4bd5f5cc89 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 21:27:27 -0600 Subject: [PATCH 038/185] Fix env too --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index a85d0c783fc9..cc45fada4b84 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -61,7 +61,7 @@ jobs: run: cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - name: Set env - run: echo "OUTPUT=$(cat ./Host_Machine_Files/$WORKING_DIRECTORY/output.md)" >> $OUTPUT + run: echo "OUTPUT=$(cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md)" >> $OUTPUT - name: Comment on PR uses: actions/github-script@v6 From b2a7bb670123f4c024a094c69872b54eea56fdeb Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 22:02:05 -0600 Subject: [PATCH 039/185] Last fix? --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index cc45fada4b84..26825ecf86c4 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -61,7 +61,7 @@ jobs: run: cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - name: Set env - run: echo "OUTPUT=$(cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md)" >> $OUTPUT + run: echo "OUTPUT=$(cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md)" >> "$GITHUB_ENV" - name: Comment on PR uses: actions/github-script@v6 From ebd543ccc6672ec25a6ebccecf5d733056961f0a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 22:02:39 -0600 Subject: [PATCH 040/185] Use quotes? --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 26825ecf86c4..2c0e1b22de85 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -71,5 +71,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: ${{ env.OUTPUT }} + body: "${{ env.OUTPUT }}" }) From 9c3c4c576ebbd0d4772b3d841aaff87a7a10deb8 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 22:40:08 -0600 Subject: [PATCH 041/185] Use multi line env variable --- .github/workflows/e2ePerformanceRegressionTests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 2c0e1b22de85..fcb56230034b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -61,7 +61,10 @@ jobs: run: cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - name: Set env - run: echo "OUTPUT=$(cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md)" >> "$GITHUB_ENV" + run: | + echo 'OUTPUT<> $GITHUB_ENV + cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV - name: Comment on PR uses: actions/github-script@v6 From f985b4fc5de766983bf2beaed69824a7b385f26b Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 3 Nov 2022 23:24:00 -0600 Subject: [PATCH 042/185] Try a different comment action --- .../workflows/e2ePerformanceRegressionTests.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index fcb56230034b..4debdcb93119 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -66,13 +66,9 @@ jobs: cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV - - name: Comment on PR - uses: actions/github-script@v6 + - uses: mshick/add-pr-comment@v1 with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "${{ env.OUTPUT }}" - }) + message: ${{ env.OUTPUT }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: 'github-actions[bot]' + From 47cdafe311342eb72c856fc70347fd911d066e45 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 4 Nov 2022 00:05:10 -0600 Subject: [PATCH 043/185] Clean up debug --- .github/workflows/e2ePerformanceRegressionTests.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 4debdcb93119..41398146eb78 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -51,22 +51,17 @@ jobs: remote_src: false file_artifacts: Customer Artifacts.zip - - name: Unzip Artifacts + - name: Unzip AWS Device Farm results run: unzip Customer\ Artifacts.zip - - name: debug - run: find . - - - name: Print results - run: cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - - - name: Set env + - name: Set output of AWS Device Farm into GitHub ENV run: | echo 'OUTPUT<> $GITHUB_ENV cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV - - uses: mshick/add-pr-comment@v1 + - name: Leave output of AWS Device Farm as a PR comment + uses: mshick/add-pr-comment@v1 with: message: ${{ env.OUTPUT }} repo-token: ${{ secrets.GITHUB_TOKEN }} From fa5049f6a4a8d14537529a892c4d006836d6c8b9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 4 Nov 2022 10:22:10 -0600 Subject: [PATCH 044/185] Try to build two APKs --- .../e2ePerformanceRegressionTests.yml | 24 +++++++++++++++---- tests/e2e/TestSpec.yml | 2 ++ tests/e2e/testRunner.js | 4 ++-- tests/e2e/utils/installApp.js | 9 ++++--- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 41398146eb78..8bd4b81db8ad 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -19,14 +19,28 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v2 - - name: Build APK + - name: Build "Current" APK run: npm run android-build-e2e - - name: Copy APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease.apk + - name: Copy "Current" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-current.apk - - name: Zip built APK - run: zip app-e2eRelease.apk.zip app-e2eRelease.apk +# TODO: Uncomment before merge +# - name: Checkout "Baseline" +# run: git checkout origin main + +# TODO: Delete before merge + - name: Checkout "Baseline" + run: git checkout origin andrew-baseline + + - name: Build "Baseline" APK + run: npm run android-build-e2e + + - name: Copy "Current" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk + + - name: Zip both "Baseline" and "Current" built APKs + run: zip APKs.zip *.apk - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index d3a2ed581183..7261dfcfa4f4 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -7,6 +7,8 @@ phases: - . $NVM_DIR/nvm.sh - nvm install 16.15.1 + - ls -la + # Fetch latest code from GitHub - git clone https://github.com/AndrewGable/App.git Git-App - cd $DEVICEFARM_TEST_PACKAGE_PATH/Git-App diff --git a/tests/e2e/testRunner.js b/tests/e2e/testRunner.js index 599f0f2e319a..2494eb282f42 100644 --- a/tests/e2e/testRunner.js +++ b/tests/e2e/testRunner.js @@ -65,9 +65,9 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => { } progress.done(); - // Install app and reverse ports + // Install app let progressLog = Logger.progressInfo('Installing app'); - await installApp('android'); + await installApp('android', baselineOrCompare); progressLog.done(); // Start the HTTP server diff --git a/tests/e2e/utils/installApp.js b/tests/e2e/utils/installApp.js index 800e537c5289..fa1954d1c3ab 100644 --- a/tests/e2e/utils/installApp.js +++ b/tests/e2e/utils/installApp.js @@ -2,7 +2,8 @@ const {APP_PACKAGE} = require('../config'); const execAsync = require('./execAsync'); const Logger = require('./logger'); -const APP_PATH_FROM_ROOT = '../app-e2eRelease.apk'; +const BASELINE_APP_PATH_FROM_ROOT = '../app-e2eRelease-baseline.apk'; +const COMPARE_APP_PATH_FROM_ROOT = '../app-e2eRelease-compare.apk'; /** * Installs the app on the currently connected device for the given platform. @@ -10,14 +11,16 @@ const APP_PATH_FROM_ROOT = '../app-e2eRelease.apk'; * @param {string} platform * @returns {Promise} */ -module.exports = function (platform = 'android') { +module.exports = function (platform = 'android', baselineOrCompare = 'baseline') { if (platform !== 'android') { throw new Error(`installApp() missing implementation for platform: ${platform}`); } + const apk = baselineOrCompare === 'baseline' ? BASELINE_APP_PATH_FROM_ROOT : COMPARE_APP_PATH_FROM_ROOT; + // Uninstall first, then install return execAsync(`adb uninstall ${APP_PACKAGE}`).catch((e) => { // Ignore errors Logger.warn('Failed to uninstall app:', e); - }).finally(() => execAsync(`adb install ${APP_PATH_FROM_ROOT}`)); + }).finally(() => execAsync(`adb install ${apk}`)); }; From 68b2c1a1feac175feee25f1fc0593a8c02448513 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 4 Nov 2022 10:43:37 -0600 Subject: [PATCH 045/185] Tweak checkout command --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 8bd4b81db8ad..5a8943751d26 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -27,11 +27,11 @@ jobs: # TODO: Uncomment before merge # - name: Checkout "Baseline" -# run: git checkout origin main +# run: git checkout main # TODO: Delete before merge - name: Checkout "Baseline" - run: git checkout origin andrew-baseline + run: git checkout andrew-baseline - name: Build "Baseline" APK run: npm run android-build-e2e From e861d706073fd6546b9a85c0c8580bf23d8236c3 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 14:00:38 -0700 Subject: [PATCH 046/185] Update file names --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 5a8943751d26..4e6b65735538 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -55,10 +55,10 @@ jobs: name: App E2E Performance Regression Tests project_arn: ${{ secrets.AWS_PROJECT_ARN }} device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} - app_file: app-e2eRelease.apk + app_file: app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE - test_package_file: app-e2eRelease.apk.zip + test_package_file: APKs.zip test_package_type: APPIUM_NODE_TEST_PACKAGE test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC From 79aea8e8b99675bdd522b2878778d5e4a4ae03ab Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 14:25:35 -0700 Subject: [PATCH 047/185] Add param --- tests/e2e/utils/installApp.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/utils/installApp.js b/tests/e2e/utils/installApp.js index fa1954d1c3ab..fe1eb735dcd6 100644 --- a/tests/e2e/utils/installApp.js +++ b/tests/e2e/utils/installApp.js @@ -8,7 +8,9 @@ const COMPARE_APP_PATH_FROM_ROOT = '../app-e2eRelease-compare.apk'; /** * Installs the app on the currently connected device for the given platform. * It removes the app first if it already exists, so it's a clean installation. + * * @param {string} platform + * @param {String} baselineOrCompare * @returns {Promise} */ module.exports = function (platform = 'android', baselineOrCompare = 'baseline') { From 0f6f593299490d07dd75ea01d0ba55ed479b2082 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 15:10:02 -0700 Subject: [PATCH 048/185] Current -> Compare --- .github/workflows/e2ePerformanceRegressionTests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 4e6b65735538..44520dad1b38 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -19,11 +19,11 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v2 - - name: Build "Current" APK + - name: Build "Compare" APK run: npm run android-build-e2e - - name: Copy "Current" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-current.apk + - name: Copy "Compare" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-compare.apk # TODO: Uncomment before merge # - name: Checkout "Baseline" @@ -36,10 +36,10 @@ jobs: - name: Build "Baseline" APK run: npm run android-build-e2e - - name: Copy "Current" APK + - name: Copy "Compare" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - - name: Zip both "Baseline" and "Current" built APKs + - name: Zip both "Baseline" and "Compare" built APKs run: zip APKs.zip *.apk - name: Configure AWS credentials From 7d002b181785040b9902c7cbe94b6df69e4daf81 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 16:13:26 -0700 Subject: [PATCH 049/185] Try to use npm install from GitHub runner --- .../workflows/e2ePerformanceRegressionTests.yml | 6 +++--- tests/e2e/TestSpec.yml | 15 +++++---------- tests/e2e/utils/installApp.js | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 44520dad1b38..4ed8f5964f22 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -39,8 +39,8 @@ jobs: - name: Copy "Compare" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - - name: Zip both "Baseline" and "Compare" built APKs - run: zip APKs.zip *.apk + - name: Zip entire directory + run: zip -r App.zip . - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -58,7 +58,7 @@ jobs: app_file: app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE - test_package_file: APKs.zip + test_package_file: App.zip test_package_type: APPIUM_NODE_TEST_PACKAGE test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 7261dfcfa4f4..a587676be452 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -3,17 +3,13 @@ version: 0.1 phases: install: commands: - - export NVM_DIR=$HOME/.nvm - - . $NVM_DIR/nvm.sh - - nvm install 16.15.1 - + # Debug - Remove before merge - ls -la - # Fetch latest code from GitHub - - git clone https://github.com/AndrewGable/App.git Git-App - - cd $DEVICEFARM_TEST_PACKAGE_PATH/Git-App - - git checkout andrew-aws-df - - npm install + # Install correct version of node + - export NVM_DIR=$HOME/.nvm + - . $NVM_DIR/nvm.sh + - nvm use # Reverse ports using AWS magic - PORT=4723 @@ -24,7 +20,6 @@ phases: test: commands: - - echo "Starting tests" - npm run test:e2e -- --skipInstallDeps --skipBuild artifacts: diff --git a/tests/e2e/utils/installApp.js b/tests/e2e/utils/installApp.js index fe1eb735dcd6..88e61df3c127 100644 --- a/tests/e2e/utils/installApp.js +++ b/tests/e2e/utils/installApp.js @@ -9,7 +9,7 @@ const COMPARE_APP_PATH_FROM_ROOT = '../app-e2eRelease-compare.apk'; * Installs the app on the currently connected device for the given platform. * It removes the app first if it already exists, so it's a clean installation. * - * @param {string} platform + * @param {String} platform * @param {String} baselineOrCompare * @returns {Promise} */ From 7baa3e53bb519657a491c5cce04696208c55e69a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 16:58:39 -0700 Subject: [PATCH 050/185] Debug --- .github/workflows/e2ePerformanceRegressionTests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 4ed8f5964f22..47b452b16bc6 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -36,12 +36,15 @@ jobs: - name: Build "Baseline" APK run: npm run android-build-e2e - - name: Copy "Compare" APK + - name: Copy "Baseline" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - name: Zip entire directory run: zip -r App.zip . + - name: Debug + run: ls -la + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: From 1e9178093f1655cba4450c96d80fac4e38eae92b Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 17:03:14 -0700 Subject: [PATCH 051/185] Try npm-bundle --- .github/workflows/e2ePerformanceRegressionTests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 47b452b16bc6..5de969f249e9 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -42,6 +42,12 @@ jobs: - name: Zip entire directory run: zip -r App.zip . + - name: Bundle + run: | + npm install -g npm-bundle + npm-bundle + zip -r MyTests.zip *.tgz + - name: Debug run: ls -la @@ -61,7 +67,7 @@ jobs: app_file: app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE - test_package_file: App.zip + test_package_file: MyTests.zip test_package_type: APPIUM_NODE_TEST_PACKAGE test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC From 47b9069713c425aa30d8ecd8ab4710afbbe7eeb9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 19:07:10 -0700 Subject: [PATCH 052/185] More debug --- .../e2ePerformanceRegressionTests.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 5de969f249e9..980081a6841b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -19,6 +19,15 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v2 + - name: Debug + run: ls -la + + - name: Bundle + run: | + npm install -g npm-bundle + npm-bundle + zip -r MyTests.zip *.tgz + - name: Build "Compare" APK run: npm run android-build-e2e @@ -42,15 +51,6 @@ jobs: - name: Zip entire directory run: zip -r App.zip . - - name: Bundle - run: | - npm install -g npm-bundle - npm-bundle - zip -r MyTests.zip *.tgz - - - name: Debug - run: ls -la - - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: From 543aed0c9b9a0561523adcec85d4295e38f2b1c9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 19:22:27 -0700 Subject: [PATCH 053/185] Testing bundle in different spot --- .../workflows/e2ePerformanceRegressionTests.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 980081a6841b..c6515d45d0ee 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -19,15 +19,6 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v2 - - name: Debug - run: ls -la - - - name: Bundle - run: | - npm install -g npm-bundle - npm-bundle - zip -r MyTests.zip *.tgz - - name: Build "Compare" APK run: npm run android-build-e2e @@ -48,8 +39,11 @@ jobs: - name: Copy "Baseline" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - - name: Zip entire directory - run: zip -r App.zip . + - name: Bundle + run: | + npm install -g npm-bundle + npm-bundle + zip -r MyTests.zip *.tgz - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 From 8c22a84187ebf3906c666529d41205ab71a7b88e Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 20:35:24 -0700 Subject: [PATCH 054/185] Try a debug --- .../e2ePerformanceRegressionTests.yml | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index c6515d45d0ee..53c4d4d0d540 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -16,28 +16,28 @@ jobs: bundler-cache: true # Cache gradle to improve Android build time - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - - - name: Build "Compare" APK - run: npm run android-build-e2e - - - name: Copy "Compare" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-compare.apk - -# TODO: Uncomment before merge +# - name: Gradle cache +# uses: gradle/gradle-build-action@v2 +# +# - name: Build "Compare" APK +# run: npm run android-build-e2e +# +# - name: Copy "Compare" APK +# run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-compare.apk +# +## TODO: Uncomment before merge +## - name: Checkout "Baseline" +## run: git checkout main +# +## TODO: Delete before merge # - name: Checkout "Baseline" -# run: git checkout main - -# TODO: Delete before merge - - name: Checkout "Baseline" - run: git checkout andrew-baseline - - - name: Build "Baseline" APK - run: npm run android-build-e2e - - - name: Copy "Baseline" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk +# run: git checkout andrew-baseline +# +# - name: Build "Baseline" APK +# run: npm run android-build-e2e +# +# - name: Copy "Baseline" APK +# run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - name: Bundle run: | @@ -45,6 +45,9 @@ jobs: npm-bundle zip -r MyTests.zip *.tgz + - name: Debug + run: ls -la + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: From a19e5aa308f3032a8767c71e6cea3e88d145463c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 20:40:56 -0700 Subject: [PATCH 055/185] Undo debug --- .../e2ePerformanceRegressionTests.yml | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 53c4d4d0d540..c4a0bb1072d8 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -16,28 +16,28 @@ jobs: bundler-cache: true # Cache gradle to improve Android build time -# - name: Gradle cache -# uses: gradle/gradle-build-action@v2 -# -# - name: Build "Compare" APK -# run: npm run android-build-e2e -# -# - name: Copy "Compare" APK -# run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-compare.apk -# -## TODO: Uncomment before merge -## - name: Checkout "Baseline" -## run: git checkout main -# -## TODO: Delete before merge + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: Build "Compare" APK + run: npm run android-build-e2e + + - name: Copy "Compare" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-compare.apk + +# TODO: Uncomment before merge # - name: Checkout "Baseline" -# run: git checkout andrew-baseline -# -# - name: Build "Baseline" APK -# run: npm run android-build-e2e -# -# - name: Copy "Baseline" APK -# run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk +# run: git checkout main + +# TODO: Delete before merge + - name: Checkout "Baseline" + run: git checkout andrew-baseline + + - name: Build "Baseline" APK + run: npm run android-build-e2e + + - name: Copy "Baseline" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - name: Bundle run: | From 11e298fb19b6a6c3a9756acba4ad5d3765e0aae2 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 21:15:48 -0700 Subject: [PATCH 056/185] More debug --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index c4a0bb1072d8..5ee6b9396e54 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -46,7 +46,7 @@ jobs: zip -r MyTests.zip *.tgz - name: Debug - run: ls -la + run: ls -hla - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 From a7e89bba5a062c32397254e1ca4d22b779c070d6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 7 Nov 2022 21:30:19 -0700 Subject: [PATCH 057/185] Use custom fork to try to fix bug --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 5ee6b9396e54..05fade0e968c 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -56,7 +56,7 @@ jobs: aws-region: us-west-2 - name: Schedule test run - uses: realm/aws-devicefarm/test-application@master + uses: AndrewGable/aws-devicefarm/test-application@andrew-upload with: name: App E2E Performance Regression Tests project_arn: ${{ secrets.AWS_PROJECT_ARN }} From c9a1dbc08f5ee731fd9b954d9e76f08d43efd7c8 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 8 Nov 2022 09:51:56 -0700 Subject: [PATCH 058/185] Use zip instead of bundle --- .github/workflows/e2ePerformanceRegressionTests.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 05fade0e968c..9c050a3b5d47 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -39,14 +39,11 @@ jobs: - name: Copy "Baseline" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - - name: Bundle - run: | - npm install -g npm-bundle - npm-bundle - zip -r MyTests.zip *.tgz + - name: Zip everything up + run: zip -r App.zip . - name: Debug - run: ls -hla + run: ls -lha - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -64,7 +61,7 @@ jobs: app_file: app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE - test_package_file: MyTests.zip + test_package_file: App.zip test_package_type: APPIUM_NODE_TEST_PACKAGE test_spec_file: tests/e2e/TestSpec.yml test_spec_type: APPIUM_NODE_TEST_SPEC From 95da73262273035daf5d16ef0109b3e8d22ec47f Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 8 Nov 2022 11:01:33 -0700 Subject: [PATCH 059/185] Clean up after runs --- .github/workflows/e2ePerformanceRegressionTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 9c050a3b5d47..a8163df2c648 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -67,6 +67,7 @@ jobs: test_spec_type: APPIUM_NODE_TEST_SPEC remote_src: false file_artifacts: Customer Artifacts.zip + cleanup: true - name: Unzip AWS Device Farm results run: unzip Customer\ Artifacts.zip From ae7278bd2cadea44c03dac97a47a45dcfb47f0db Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 8 Nov 2022 12:01:21 -0700 Subject: [PATCH 060/185] Install correct node and do not switch branches --- tests/e2e/TestSpec.yml | 1 + tests/e2e/testRunner.js | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index a587676be452..38696f817963 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -9,6 +9,7 @@ phases: # Install correct version of node - export NVM_DIR=$HOME/.nvm - . $NVM_DIR/nvm.sh + - nvm install - nvm use # Reverse ports using AWS magic diff --git a/tests/e2e/testRunner.js b/tests/e2e/testRunner.js index 2494eb282f42..a5165db1ac67 100644 --- a/tests/e2e/testRunner.js +++ b/tests/e2e/testRunner.js @@ -49,21 +49,22 @@ const restartApp = async () => { }; const runTestsOnBranch = async (branch, baselineOrCompare) => { - // Switch branch and install dependencies - const progress = Logger.progressInfo(`Preparing ${baselineOrCompare} tests on branch '${branch}'`); - await execAsync(`git checkout ${branch}`); + if (!args.includes('--skipInstallDeps') && !args.includes('--skipBuild')) { + // Switch branch and install dependencies + Logger.log(`Preparing ${baselineOrCompare} tests on branch '${branch}'`); + await execAsync(`git checkout ${branch}`); + } if (!args.includes('--skipInstallDeps')) { - progress.updateText(`Preparing ${baselineOrCompare} tests on branch '${branch}' - npm install`); + Logger.log(`Preparing ${baselineOrCompare} tests on branch '${branch}' - npm install`); await execAsync('npm i'); } // Build app if (!args.includes('--skipBuild')) { - progress.updateText(`Preparing ${baselineOrCompare} tests on branch '${branch}' - building app`); + Logger.log(`Preparing ${baselineOrCompare} tests on branch '${branch}' - building app`); await execAsync('npm run android-build-e2e'); } - progress.done(); // Install app let progressLog = Logger.progressInfo('Installing app'); From 2a86245c10c0a4a4e159856e533670c79762b14c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 8 Nov 2022 15:08:34 -0700 Subject: [PATCH 061/185] Quick debug test --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index a8163df2c648..900bfc882eda 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -56,8 +56,8 @@ jobs: uses: AndrewGable/aws-devicefarm/test-application@andrew-upload with: name: App E2E Performance Regression Tests - project_arn: ${{ secrets.AWS_PROJECT_ARN }} - device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} + project_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} + device_pool_arn: ${{ secrets.AWS_PROJECT_ARN }} app_file: app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE From 1fae6ecf1625d85963bee3ca6b6f17a9457b8cb6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 8 Nov 2022 15:40:12 -0700 Subject: [PATCH 062/185] Undo debug --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 900bfc882eda..a8163df2c648 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -56,8 +56,8 @@ jobs: uses: AndrewGable/aws-devicefarm/test-application@andrew-upload with: name: App E2E Performance Regression Tests - project_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} - device_pool_arn: ${{ secrets.AWS_PROJECT_ARN }} + project_arn: ${{ secrets.AWS_PROJECT_ARN }} + device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} app_file: app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE From 31220d724b581f2a682f5c0ae459c229a9285dbc Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 8 Nov 2022 18:53:49 -0700 Subject: [PATCH 063/185] Fix path --- tests/e2e/utils/installApp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/utils/installApp.js b/tests/e2e/utils/installApp.js index 88e61df3c127..32c2f44c9533 100644 --- a/tests/e2e/utils/installApp.js +++ b/tests/e2e/utils/installApp.js @@ -2,8 +2,8 @@ const {APP_PACKAGE} = require('../config'); const execAsync = require('./execAsync'); const Logger = require('./logger'); -const BASELINE_APP_PATH_FROM_ROOT = '../app-e2eRelease-baseline.apk'; -const COMPARE_APP_PATH_FROM_ROOT = '../app-e2eRelease-compare.apk'; +const BASELINE_APP_PATH_FROM_ROOT = './app-e2eRelease-baseline.apk'; +const COMPARE_APP_PATH_FROM_ROOT = './app-e2eRelease-compare.apk'; /** * Installs the app on the currently connected device for the given platform. From eb7da3674225c35eed2c96f008202a0589c7948f Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 08:30:28 -0700 Subject: [PATCH 064/185] Checkout preivous branch --- .github/workflows/e2ePerformanceRegressionTests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index a8163df2c648..5d83acf157cb 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -39,12 +39,12 @@ jobs: - name: Copy "Baseline" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk + - name: Checkout previous branch for JS Code + run: git checkout - + - name: Zip everything up run: zip -r App.zip . - - name: Debug - run: ls -lha - - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: From 5b314b081d0f6d60e2197b9504f55d3cfc769eb2 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 09:37:32 -0700 Subject: [PATCH 065/185] Remove debug lines --- tests/e2e/TestSpec.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 38696f817963..1c11c103803e 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -3,9 +3,6 @@ version: 0.1 phases: install: commands: - # Debug - Remove before merge - - ls -la - # Install correct version of node - export NVM_DIR=$HOME/.nvm - . $NVM_DIR/nvm.sh From 573c24bd9a4fe7b58d16d9ac21dfd2c468bff38c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 10:35:21 -0700 Subject: [PATCH 066/185] Quiet zip and use npmrc file --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- tests/e2e/TestSpec.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 5d83acf157cb..f4b6a054b276 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -39,11 +39,11 @@ jobs: - name: Copy "Baseline" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk - - name: Checkout previous branch for JS Code + - name: Checkout previous branch for source code to run on AWS Device farm run: git checkout - - name: Zip everything up - run: zip -r App.zip . + run: zip -qr App.zip . - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 1c11c103803e..a91db73fb831 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -6,8 +6,8 @@ phases: # Install correct version of node - export NVM_DIR=$HOME/.nvm - . $NVM_DIR/nvm.sh - - nvm install - - nvm use + - nvm install "$(<.nvmrc)" + - nvm use "$(<.nvmrc)" # Reverse ports using AWS magic - PORT=4723 From 899ea8edc37d4740c40d1c5477bfcd7c62833bb4 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 10:43:47 -0700 Subject: [PATCH 067/185] Undo removal of other workflows --- .github/workflows/cla.yml | 40 +++++++++++++++++++ .github/workflows/contributorChecklists.yml | 14 +++++++ .../workflows/contributorPlusChecklists.yml | 14 +++++++ .github/workflows/validateGithubActions.yml | 21 ++++++++++ .github/workflows/verifyPodfile.yml | 15 +++++++ .github/workflows/verifySignedCommits.yml | 14 +++++++ 6 files changed, 118 insertions(+) create mode 100644 .github/workflows/cla.yml create mode 100644 .github/workflows/contributorChecklists.yml create mode 100644 .github/workflows/contributorPlusChecklists.yml create mode 100644 .github/workflows/validateGithubActions.yml create mode 100644 .github/workflows/verifyPodfile.yml create mode 100644 .github/workflows/verifySignedCommits.yml diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 000000000000..8943669c2ba8 --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,40 @@ +name: CLA Assistant + +on: + issue_comment: + types: [created] + pull_request_target: + types: [opened, synchronize] + +jobs: + CLA: + runs-on: ubuntu-latest + # This job only runs for pull request comments or pull request target events (not issue comments) + # It does not run for pull requests created by OSBotify + if: ${{ github.event.issue.pull_request || (github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'OSBotify') }} + steps: + - uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73 + id: sign + with: + text: ${{ github.event.comment.body }} + regex: '\s*I have read the CLA Document and I hereby sign the CLA\s*' + - uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73 + id: recheck + with: + text: ${{ github.event.comment.body }} + regex: '\s*recheck\s*' + - name: CLA Assistant + if: ${{ steps.recheck.outputs.match != '' || steps.sign.outputs.match != '' }} || github.event_name == 'pull_request_target' + # Version: 2.1.2-beta + uses: cla-assistant/github-action@948230deb0d44dd38957592f08c6bd934d96d0cf + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOTIFY_TOKEN }} + with: + path-to-signatures: '${{ github.repository }}/cla.json' + path-to-document: 'https://github.com/${{ github.repository }}/blob/main/contributingGuides/CLA.md' + branch: 'main' + remote-organization-name: 'Expensify' + remote-repository-name: 'CLA' + lock-pullrequest-aftermerge: false + allowlist: OSBotify,snyk-bot diff --git a/.github/workflows/contributorChecklists.yml b/.github/workflows/contributorChecklists.yml new file mode 100644 index 000000000000..632fd5355d92 --- /dev/null +++ b/.github/workflows/contributorChecklists.yml @@ -0,0 +1,14 @@ +name: PR Author Checklist + +on: pull_request + +jobs: + checklist: + runs-on: ubuntu-latest + if: github.actor != 'OSBotify' + steps: + - name: contributorChecklist.js + uses: Expensify/App/.github/actions/javascript/contributorChecklist@main + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CHECKLIST: 'contributor' diff --git a/.github/workflows/contributorPlusChecklists.yml b/.github/workflows/contributorPlusChecklists.yml new file mode 100644 index 000000000000..46dc8ae5a733 --- /dev/null +++ b/.github/workflows/contributorPlusChecklists.yml @@ -0,0 +1,14 @@ +name: PR Reviewer Checklist + +on: pull_request_review + +jobs: + checklist: + runs-on: ubuntu-latest + if: github.actor != 'OSBotify' + steps: + - name: contributorChecklist.js + uses: Expensify/App/.github/actions/javascript/contributorChecklist@main + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CHECKLIST: 'reviewer' diff --git a/.github/workflows/validateGithubActions.yml b/.github/workflows/validateGithubActions.yml new file mode 100644 index 000000000000..4e51d785d6b0 --- /dev/null +++ b/.github/workflows/validateGithubActions.yml @@ -0,0 +1,21 @@ +name: Validate Github Actions + +on: + pull_request: + types: [opened, synchronize] + branches-ignore: [staging, production] + +jobs: + verify: + if: github.actor != 'OSBotify' + runs-on: ubuntu-latest + steps: + - uses: Expensify/App/.github/actions/composite/setupNode@main + + # Rebuild all the actions on this branch and check for a diff. Fail if there is one, + # because that would be a sign that the PR author did not rebuild the Github Actions + - name: Verify Javascript Action Builds + run: ./.github/scripts/verifyActions.sh + + - name: Validate actions and workflows + run: npm run gh-actions-validate diff --git a/.github/workflows/verifyPodfile.yml b/.github/workflows/verifyPodfile.yml new file mode 100644 index 000000000000..17d80ca7e055 --- /dev/null +++ b/.github/workflows/verifyPodfile.yml @@ -0,0 +1,15 @@ +name: Verify Podfile + +on: + pull_request: + types: [opened, synchronize] + branches-ignore: [staging, production] + +jobs: + verify: + if: github.actor != 'OSBotify' + runs-on: ubuntu-latest + steps: + - uses: Expensify/App/.github/actions/composite/setupNode@main + + - run: ./.github/scripts/verifyPodfile.sh diff --git a/.github/workflows/verifySignedCommits.yml b/.github/workflows/verifySignedCommits.yml new file mode 100644 index 000000000000..e1068e71e041 --- /dev/null +++ b/.github/workflows/verifySignedCommits.yml @@ -0,0 +1,14 @@ +name: Verify signed commits + +on: + pull_request: + types: [opened, synchronize] + branches-ignore: [staging, production] + +jobs: + verifySignedCommits: + runs-on: ubuntu-latest + steps: + - uses: Expensify/App/.github/actions/javascript/verifySignedCommits@main + with: + GITHUB_TOKEN: ${{ github.token }} From 7c7cb99ae5d3805cc4259b45d1bd2fe3bbd899b5 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 11:40:57 -0700 Subject: [PATCH 068/185] Filter outliers via different method --- tests/e2e/compare/output/markdown.js | 2 +- tests/e2e/measure/math.js | 33 ++++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tests/e2e/compare/output/markdown.js b/tests/e2e/compare/output/markdown.js index 5f685550112d..b0563ac2c966 100644 --- a/tests/e2e/compare/output/markdown.js +++ b/tests/e2e/compare/output/markdown.js @@ -57,7 +57,7 @@ const buildSummaryTable = (entries, collapse = false) => { }; const buildMarkdown = (data) => { - let result = '# Performance Comparison Report'; + let result = '## Performance Comparison Report 📊'; if (data.errors && data.errors.length) { result += '\n\n### Errors\n'; diff --git a/tests/e2e/measure/math.js b/tests/e2e/measure/math.js index b6acc763255e..058b67548d79 100644 --- a/tests/e2e/measure/math.js +++ b/tests/e2e/measure/math.js @@ -1,15 +1,26 @@ const _ = require('underscore'); -const {DROP_WORST} = require('../config'); - -// Simple outlier removal, where we remove at the head and tail entries -const filterOutliers = (data) => { - // Copy the values, rather than operating on references to existing values - const values = [...data].sort(); - const removePerSide = Math.ceil(DROP_WORST / 2); - values.splice(0, removePerSide); - values.splice(values.length - removePerSide); - return values; + +const filterOutliersViaIQR = (data) => { + let q1; + let q3; + + const values = data.slice().sort((a, b) => a - b); + + if ((values.length / 4) % 1 === 0) { + q1 = (1 / 2) * (values[(values.length / 4)] + values[(values.length / 4) + 1]); + q3 = (1 / 2) * (values[(values.length * (3 / 4))] + values[(values.length * (3 / 4)) + 1]); + } else { + q1 = values[Math.floor((values.length / 4) + 1)]; + q3 = values[Math.ceil((values.length * (3 / 4)) + 1)]; + } + + const iqr = q3 - q1; + const maxValue = q3 + (iqr * 1.5); + const minValue = q1 - (iqr * 1.5); + + return _.filter(values, x => (x >= minValue) && (x <= maxValue)); }; + const mean = arr => _.reduce(arr, (a, b) => a + b, 0) / arr.length; const std = (arr) => { @@ -18,7 +29,7 @@ const std = (arr) => { }; const getStats = (entries) => { - const cleanedEntries = filterOutliers(entries); + const cleanedEntries = filterOutliersViaIQR(entries); const meanDuration = mean(cleanedEntries); const stdevDuration = std(cleanedEntries); From 769b8eda9edc344e22de7280f98f0bc51759f735 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 12:31:58 -0700 Subject: [PATCH 069/185] Bump formatting to 3 digits --- tests/e2e/compare/output/format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/compare/output/format.js b/tests/e2e/compare/output/format.js index e4668b38fa52..38a48984a2e7 100644 --- a/tests/e2e/compare/output/format.js +++ b/tests/e2e/compare/output/format.js @@ -17,7 +17,7 @@ const formatPercentChange = (value) => { return `${value >= 0 ? '+' : '-'}${formatPercent(absValue)}`; }; -const formatDuration = duration => `${duration.toFixed(1)} ms`; +const formatDuration = duration => `${duration.toFixed(3)} ms`; const formatDurationChange = (value) => { if (value > 0) { From b1d95caf9993cfd8c35837cc0f4edf14baa5d84a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 14:52:57 -0700 Subject: [PATCH 070/185] Reduce test runs by half, see how long it takes --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- tests/e2e/config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index f4b6a054b276..eee9b7013c61 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -52,7 +52,7 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-west-2 - - name: Schedule test run + - name: Schedule AWS Device Farm test run uses: AndrewGable/aws-devicefarm/test-application@andrew-upload with: name: App E2E Performance Regression Tests diff --git a/tests/e2e/config.js b/tests/e2e/config.js index faed4bd07081..62238fe14c04 100644 --- a/tests/e2e/config.js +++ b/tests/e2e/config.js @@ -17,7 +17,7 @@ module.exports = { SERVER_PORT: 4723, // The amount of times a test should be executed for average performance metrics - RUNS: 30, + RUNS: 15, DEFAULT_BASELINE_BRANCH: 'main', @@ -25,7 +25,7 @@ module.exports = { DROP_WORST: 8, // The amount of runs that should happen without counting test results - WARM_UP_RUNS: 3, + WARM_UP_RUNS: 0, OUTPUT_DIR, From 5e4f62baf64bbdadbcfd847b4d0e0f0c28d42b25 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 9 Nov 2022 15:52:04 -0700 Subject: [PATCH 071/185] Undo reducing number of runs --- tests/e2e/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/config.js b/tests/e2e/config.js index 62238fe14c04..faed4bd07081 100644 --- a/tests/e2e/config.js +++ b/tests/e2e/config.js @@ -17,7 +17,7 @@ module.exports = { SERVER_PORT: 4723, // The amount of times a test should be executed for average performance metrics - RUNS: 15, + RUNS: 30, DEFAULT_BASELINE_BRANCH: 'main', @@ -25,7 +25,7 @@ module.exports = { DROP_WORST: 8, // The amount of runs that should happen without counting test results - WARM_UP_RUNS: 0, + WARM_UP_RUNS: 3, OUTPUT_DIR, From 8bd22d8b620116c60c68e72127290532b226feb9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 10 Nov 2022 17:13:53 -0700 Subject: [PATCH 072/185] Use large runner --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index eee9b7013c61..d74aca2f4dda 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -6,7 +6,7 @@ on: jobs: e2e-tests: name: "Run e2e performance regression tests" - runs-on: ubuntu-latest + runs-on: ubuntu-20.04-64core steps: - uses: Expensify/App/.github/actions/composite/setupNode@main From dbdc9fd71b70ed730fd7c65e049a8fbcd94ab176 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 14 Nov 2022 12:30:21 -0700 Subject: [PATCH 073/185] Only zip up required e2e tests --- .../e2ePerformanceRegressionTests.yml | 22 +++++++++++++++---- tests/e2e/config.js | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index d74aca2f4dda..5696ea8e116a 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -23,7 +23,7 @@ jobs: run: npm run android-build-e2e - name: Copy "Compare" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-compare.apk + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk # TODO: Uncomment before merge # - name: Checkout "Baseline" @@ -37,13 +37,27 @@ jobs: run: npm run android-build-e2e - name: Copy "Baseline" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk app-e2eRelease-baseline.apk + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-baseline.apk - name: Checkout previous branch for source code to run on AWS Device farm run: git checkout - - - name: Zip everything up - run: zip -qr App.zip . + - name: debug + run: ls -lah + + - name: Copy e2e code into zip folder + run: cp e2e zip + + - name: Install underscore in zip folder + run: | + cd zip + npm install underscore + + - name: debug + run: ls -lah + + - name: Zip everything in the zip directory up + run: zip -qr App.zip ./zip - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 diff --git a/tests/e2e/config.js b/tests/e2e/config.js index faed4bd07081..aad6b742b582 100644 --- a/tests/e2e/config.js +++ b/tests/e2e/config.js @@ -1,4 +1,4 @@ -const OUTPUT_DIR = process.env.WORKING_DIRECTORY || 'tests/e2e/.results'; +const OUTPUT_DIR = process.env.WORKING_DIRECTORY || './results'; /** * @typedef TestConfig From ff9f04f82c41874c855d7dc41dc5cee7270cee0b Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 14 Nov 2022 12:31:37 -0700 Subject: [PATCH 074/185] Update TestSpec --- tests/e2e/TestSpec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index a91db73fb831..cbffbbaf28be 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -18,7 +18,7 @@ phases: test: commands: - - npm run test:e2e -- --skipInstallDeps --skipBuild + - node testRunner.js -- --skipInstallDeps --skipBuild artifacts: - $WORKING_DIRECTORY From 17c693eed5eb92bd209d3012ceb735da11da88b4 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 12:16:03 -0700 Subject: [PATCH 075/185] Make a zip directory --- .github/workflows/e2ePerformanceRegressionTests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 5696ea8e116a..263958988bca 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -19,6 +19,9 @@ jobs: - name: Gradle cache uses: gradle/gradle-build-action@v2 + - name: Make zip directory for everything to send to AWS Device Farm + run: mkdir zip + - name: Build "Compare" APK run: npm run android-build-e2e From 7b72a0880fa8dcdcb495989ff3ee6cea7dd28cd6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 12:36:10 -0700 Subject: [PATCH 076/185] fix path --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 263958988bca..12a9ca4bec14 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -49,7 +49,7 @@ jobs: run: ls -lah - name: Copy e2e code into zip folder - run: cp e2e zip + run: cp tests/e2e zip - name: Install underscore in zip folder run: | From 9a34e71101cd3324aa813ec7d185a0658827c98a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 12:56:19 -0700 Subject: [PATCH 077/185] Add recursive flag --- .github/workflows/e2ePerformanceRegressionTests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 12a9ca4bec14..7fe057abf0fe 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -49,12 +49,13 @@ jobs: run: ls -lah - name: Copy e2e code into zip folder - run: cp tests/e2e zip + run: cp -r tests/e2e zip - name: Install underscore in zip folder run: | cd zip npm install underscore + cd .. - name: debug run: ls -lah From ba07fed6ef14cf26bfe02b2b76b08357e2c60bd8 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 14:28:09 -0700 Subject: [PATCH 078/185] Fix another path --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 7fe057abf0fe..7e8c766a713b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -76,7 +76,7 @@ jobs: name: App E2E Performance Regression Tests project_arn: ${{ secrets.AWS_PROJECT_ARN }} device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} - app_file: app-e2eRelease-baseline.apk + app_file: zip/app-e2eRelease-baseline.apk app_type: ANDROID_APP test_type: APPIUM_NODE test_package_file: App.zip From 5cd62d9f6258538ab969cd54bacd88243de61da0 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 14:50:36 -0700 Subject: [PATCH 079/185] Tweak commands now that we have a stripped down test --- tests/e2e/TestSpec.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index cbffbbaf28be..4559f85a02a0 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -6,8 +6,8 @@ phases: # Install correct version of node - export NVM_DIR=$HOME/.nvm - . $NVM_DIR/nvm.sh - - nvm install "$(<.nvmrc)" - - nvm use "$(<.nvmrc)" + - nvm install 16.15.1 + - nvm use 16.15.1 # Reverse ports using AWS magic - PORT=4723 @@ -18,7 +18,8 @@ phases: test: commands: - - node testRunner.js -- --skipInstallDeps --skipBuild + - ls -lha + - node e2e/testRunner.js -- --skipInstallDeps --skipBuild artifacts: - $WORKING_DIRECTORY From 6e5853caaf2d732573fe42a1e4f5971524d04740 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 14:51:14 -0700 Subject: [PATCH 080/185] Remove fork --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 7e8c766a713b..ba7b6bc40e8f 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -71,7 +71,7 @@ jobs: aws-region: us-west-2 - name: Schedule AWS Device Farm test run - uses: AndrewGable/aws-devicefarm/test-application@andrew-upload + uses: realm/aws-devicefarm/test-application@master with: name: App E2E Performance Regression Tests project_arn: ${{ secrets.AWS_PROJECT_ARN }} From d1bc36b075a87b5ff8b0681880035f914e0974ba Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 15:09:15 -0700 Subject: [PATCH 081/185] Fix path again and more debug --- tests/e2e/TestSpec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 4559f85a02a0..cef6f468572a 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -19,7 +19,8 @@ phases: test: commands: - ls -lha - - node e2e/testRunner.js -- --skipInstallDeps --skipBuild + - find . + - node zip/e2e/testRunner.js -- --skipInstallDeps --skipBuild artifacts: - $WORKING_DIRECTORY From 8caab9a2e7df3a68b67482f54c965fef869ed9ff Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 15:32:20 -0700 Subject: [PATCH 082/185] Try to install underscore elsewhere --- .github/workflows/e2ePerformanceRegressionTests.yml | 1 + tests/e2e/TestSpec.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index ba7b6bc40e8f..17b3fec5071a 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -51,6 +51,7 @@ jobs: - name: Copy e2e code into zip folder run: cp -r tests/e2e zip + #TODO: This doesn't seem to work, have to install underscore on AWS side as well - name: Install underscore in zip folder run: | cd zip diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index cef6f468572a..92cd3c8af438 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -18,9 +18,10 @@ phases: test: commands: - - ls -lha + - cd zip + - npm install underscore - find . - - node zip/e2e/testRunner.js -- --skipInstallDeps --skipBuild + - node e2e/testRunner.js -- --skipInstallDeps --skipBuild artifacts: - $WORKING_DIRECTORY From d6700e69dd8a56b379f7f8bb3e4e8824119a075d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 16:05:53 -0700 Subject: [PATCH 083/185] Remove some debug lines --- .github/workflows/e2ePerformanceRegressionTests.yml | 13 ------------- tests/e2e/TestSpec.yml | 1 - 2 files changed, 14 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 17b3fec5071a..628d8797e3b6 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -45,22 +45,9 @@ jobs: - name: Checkout previous branch for source code to run on AWS Device farm run: git checkout - - - name: debug - run: ls -lah - - name: Copy e2e code into zip folder run: cp -r tests/e2e zip - #TODO: This doesn't seem to work, have to install underscore on AWS side as well - - name: Install underscore in zip folder - run: | - cd zip - npm install underscore - cd .. - - - name: debug - run: ls -lah - - name: Zip everything in the zip directory up run: zip -qr App.zip ./zip diff --git a/tests/e2e/TestSpec.yml b/tests/e2e/TestSpec.yml index 92cd3c8af438..36a6e784727b 100644 --- a/tests/e2e/TestSpec.yml +++ b/tests/e2e/TestSpec.yml @@ -20,7 +20,6 @@ phases: commands: - cd zip - npm install underscore - - find . - node e2e/testRunner.js -- --skipInstallDeps --skipBuild artifacts: From 46b2a1e287df6d74dcc5ef5e5a318c6990d1874a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 16:18:14 -0700 Subject: [PATCH 084/185] Fix lint --- .github/actionlint.yaml | 4 ++++ .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .github/actionlint.yaml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 000000000000..82b2b510aee5 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,4 @@ +# See https://github.com/rhysd/actionlint/blob/main/docs/config.md +self-hosted-runner: + labels: + - ubuntu-20.04-64core diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 628d8797e3b6..882ea4001ab4 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -80,9 +80,9 @@ jobs: - name: Set output of AWS Device Farm into GitHub ENV run: | - echo 'OUTPUT<> $GITHUB_ENV + echo "OUTPUT<> $GITHUB_ENV cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - name: Leave output of AWS Device Farm as a PR comment uses: mshick/add-pr-comment@v1 From 0255d3fc6346fe65cd4245acb662185ff6255e93 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 18:08:40 -0700 Subject: [PATCH 085/185] Fix lint --- .github/workflows/e2ePerformanceRegressionTests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 882ea4001ab4..00ee2f67335b 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -80,9 +80,9 @@ jobs: - name: Set output of AWS Device Farm into GitHub ENV run: | - echo "OUTPUT<> $GITHUB_ENV - cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV + echo 'OUTPUT<> "$GITHUB_ENV" + cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> "$GITHUB_ENV" + echo 'EOF' >> "$GITHUB_ENV" - name: Leave output of AWS Device Farm as a PR comment uses: mshick/add-pr-comment@v1 From 911864a559243ee817eb63d8e1481be654ce1142 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 18:14:25 -0700 Subject: [PATCH 086/185] Try to fix lint more --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 00ee2f67335b..65abec9e53fd 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -80,9 +80,7 @@ jobs: - name: Set output of AWS Device Farm into GitHub ENV run: | - echo 'OUTPUT<> "$GITHUB_ENV" - cat ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md >> "$GITHUB_ENV" - echo 'EOF' >> "$GITHUB_ENV" + { echo 'OUTPUT<> "$GITHUB_ENV" - name: Leave output of AWS Device Farm as a PR comment uses: mshick/add-pr-comment@v1 From 82cadee0f3d475e2eb3efaf2a7cc0974fc35a6ad Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 18:28:32 -0700 Subject: [PATCH 087/185] Try one last thing for linting --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 65abec9e53fd..6b08abbcd9e4 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -6,7 +6,7 @@ on: jobs: e2e-tests: name: "Run e2e performance regression tests" - runs-on: ubuntu-20.04-64core + runs-on: [self-hosted, ubuntu-20.04-64core] steps: - uses: Expensify/App/.github/actions/composite/setupNode@main From a4934654708e458b1acea6bc507f5d42dca942b9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 15 Nov 2022 19:15:44 -0700 Subject: [PATCH 088/185] Move back to runs-on --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 6b08abbcd9e4..65abec9e53fd 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -6,7 +6,7 @@ on: jobs: e2e-tests: name: "Run e2e performance regression tests" - runs-on: [self-hosted, ubuntu-20.04-64core] + runs-on: ubuntu-20.04-64core steps: - uses: Expensify/App/.github/actions/composite/setupNode@main From 1d7de1dace38af9a10aac980e61b7c94dd87e0bc Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 16 Nov 2022 11:41:35 -0700 Subject: [PATCH 089/185] Skip linting specific workflow due to bug --- .github/scripts/validateActionsAndWorkflows.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/scripts/validateActionsAndWorkflows.sh b/.github/scripts/validateActionsAndWorkflows.sh index 9ac61c2e23a5..923a2a572919 100755 --- a/.github/scripts/validateActionsAndWorkflows.sh +++ b/.github/scripts/validateActionsAndWorkflows.sh @@ -41,6 +41,12 @@ done for ((i=0; i < ${#WORKFLOWS[@]}; i++)); do WORKFLOW=${WORKFLOWS[$i]} + + # Skip linting e2e workflow due to bug here: https://github.com/SchemaStore/schemastore/issues/2579 + if [[ "WORKFLOW" == './workflows/e2ePerformanceRegressionTests.yml' ]]; then + continue + fi + ajv -s ./tempSchemas/github-workflow.json -d "$WORKFLOW" --strict=false & ASYNC_PROCESSES[${#ACTIONS[@]} + $i]=$! done From 11568bfb93ab7684adde29a91b7d7449ca2a8c00 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 16 Nov 2022 11:48:57 -0700 Subject: [PATCH 090/185] Forgot $ --- .github/scripts/validateActionsAndWorkflows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/validateActionsAndWorkflows.sh b/.github/scripts/validateActionsAndWorkflows.sh index 923a2a572919..a7a447b8422d 100755 --- a/.github/scripts/validateActionsAndWorkflows.sh +++ b/.github/scripts/validateActionsAndWorkflows.sh @@ -43,7 +43,7 @@ for ((i=0; i < ${#WORKFLOWS[@]}; i++)); do WORKFLOW=${WORKFLOWS[$i]} # Skip linting e2e workflow due to bug here: https://github.com/SchemaStore/schemastore/issues/2579 - if [[ "WORKFLOW" == './workflows/e2ePerformanceRegressionTests.yml' ]]; then + if [[ "$WORKFLOW" == './workflows/e2ePerformanceRegressionTests.yml' ]]; then continue fi From 33f9703383149e292a54c5c4b558c6ccfea8ca0a Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 22 Nov 2022 12:42:42 -0700 Subject: [PATCH 091/185] Refactor to include isLargeScreenWidth --- src/components/withWindowDimensions.js | 7 +++++++ src/pages/signin/SignInPageLayout/SignInPageContent.js | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/withWindowDimensions.js b/src/components/withWindowDimensions.js index 3cb1b0310734..d39da4b0316d 100644 --- a/src/components/withWindowDimensions.js +++ b/src/components/withWindowDimensions.js @@ -18,6 +18,9 @@ const windowDimensionsPropTypes = { // Is the window width narrow, like on a tablet device? isMediumScreenWidth: PropTypes.bool.isRequired, + + // Is the window width wide, like on a browser or desktop? + isLargeScreenWidth: PropTypes.bool.isRequired, }; const windowDimensionsProviderPropTypes = { @@ -35,6 +38,7 @@ class WindowDimensionsProvider extends React.Component { const isSmallScreenWidth = initialDimensions.width <= variables.mobileResponsiveWidthBreakpoint; const isMediumScreenWidth = initialDimensions.width > variables.mobileResponsiveWidthBreakpoint && initialDimensions.width <= variables.tabletResponsiveWidthBreakpoint; + const isLargeScreenWidth = !isMediumScreenWidth && !isMediumScreenWidth; this.dimensionsEventListener = null; @@ -43,6 +47,7 @@ class WindowDimensionsProvider extends React.Component { windowWidth: initialDimensions.width, isSmallScreenWidth, isMediumScreenWidth, + isLargeScreenWidth, }; } @@ -67,11 +72,13 @@ class WindowDimensionsProvider extends React.Component { const {window} = newDimensions; const isSmallScreenWidth = window.width <= variables.mobileResponsiveWidthBreakpoint; const isMediumScreenWidth = !isSmallScreenWidth && window.width <= variables.tabletResponsiveWidthBreakpoint; + const isLargeScreenWidth = !isSmallScreenWidth && !isMediumScreenWidth; this.setState({ windowHeight: window.height, windowWidth: window.width, isSmallScreenWidth, isMediumScreenWidth, + isLargeScreenWidth, }); } diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 466be16823c3..ae081144012f 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -31,7 +31,7 @@ const propTypes = { const SignInPageContent = (props) => { const dismissKeyboardWhenTappedOutsideOfInput = () => { - // This prop comes from with + // This prop comes from withKeyboardState if (!props.isShown) { return; } @@ -45,8 +45,8 @@ const SignInPageContent = (props) => { styles.flex1, styles.signInPageLeftContainer, - // Restrict the width if the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. - !props.isMediumScreenWidth && !props.isSmallScreenWidth && styles.signInPageWideLeftContainer, + // Restrict the width of the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. + props.isLargeScreenWidth && styles.signInPageWideLeftContainer, ]} > {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} From 1aaafa7bcc18b7bb39fb82f9ffcd0d1abf7da0c6 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 22 Nov 2022 12:46:46 -0700 Subject: [PATCH 092/185] Restrict the height of the spacer --- src/styles/styles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/styles.js b/src/styles/styles.js index c54efb37e9c2..444aa465934b 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -903,6 +903,7 @@ const styles = { signInPageContentTopSpacer: { maxHeight: 132, + minHeight: 24, }, signInPageLeftContainer: { From 8c917686faa601ef504c554c81819b4bd98f788f Mon Sep 17 00:00:00 2001 From: aimane-chnaif Date: Wed, 23 Nov 2022 08:46:21 +1000 Subject: [PATCH 093/185] keep focus on composer when expand/collapse button is clicked --- src/pages/home/report/ReportActionCompose.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 2335864f916f..b2d5790ff2c8 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -562,6 +562,9 @@ class ReportActionCompose extends React.Component { e.preventDefault(); Report.setIsComposerFullSize(this.props.reportID, false); }} + + // Keep focus on the composer when Collapse button is clicked. + onMouseDown={e => e.preventDefault()} style={styles.composerSizeButton} underlayColor={themeColors.componentBG} disabled={isBlockedFromConcierge} @@ -578,6 +581,9 @@ class ReportActionCompose extends React.Component { e.preventDefault(); Report.setIsComposerFullSize(this.props.reportID, true); }} + + // Keep focus on the composer when Expand button is clicked. + onMouseDown={e => e.preventDefault()} style={styles.composerSizeButton} underlayColor={themeColors.componentBG} disabled={isBlockedFromConcierge} From 85a4fc5999cc2eabf10f7bd86db47ebb85e3aa2f Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 22 Nov 2022 16:02:16 -0700 Subject: [PATCH 094/185] Make terms have a minimum width like the form --- src/pages/signin/SignInPageLayout/SignInPageContent.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index ae081144012f..4c9cfd244f60 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -52,13 +52,7 @@ const SignInPageContent = (props) => { {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} - + { {props.children} - + From 1ec72110c2f0a832db7400d09b9d2805d79da28c Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 15:37:16 +0100 Subject: [PATCH 095/185] Scroll to the right position when clicking error --- src/components/Form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Form.js b/src/components/Form.js index 74f3bbf12fed..f0c6b190e9f7 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -79,6 +79,7 @@ class Form extends React.Component { this.inputRefs = {}; this.touchedInputs = {}; + this.inputPositions = {}; this.setTouchedInput = this.setTouchedInput.bind(this); this.validate = this.validate.bind(this); @@ -217,6 +218,9 @@ class Form extends React.Component { this.setTouchedInput(inputID); this.validate(this.state.inputValues); }, + onLayout: (event) => { + this.inputPositions[inputID] = event.nativeEvent.layout.y; + }, onInputChange: (value, key) => { const inputKey = key || inputID; this.setState(prevState => ({ @@ -245,6 +249,7 @@ class Form extends React.Component { style={[styles.w100, styles.flex1]} contentContainerStyle={styles.flexGrow1} keyboardShouldPersistTaps="handled" + ref={el => this.form = el} > {this.childrenWrapperWithProps(this.props.children)} @@ -259,6 +264,7 @@ class Form extends React.Component { const errors = !_.isEmpty(this.state.errors) ? this.state.errors : this.props.formState.errorFields; const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); this.inputRefs[focusKey].focus(); + this.form.scrollTo({y: this.inputPositions[focusKey], animated: true}); }} containerStyles={[styles.mh0, styles.mt5]} enabledWhenOffline={this.props.enabledWhenOffline} From 51f22107bba60816974261e5f4e9a5c51eb024a5 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 15:38:16 +0100 Subject: [PATCH 096/185] use measure instead --- src/components/Form.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index f0c6b190e9f7..41bb9fe7d889 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -79,7 +79,7 @@ class Form extends React.Component { this.inputRefs = {}; this.touchedInputs = {}; - this.inputPositions = {}; + this.inputPosition = 0; this.setTouchedInput = this.setTouchedInput.bind(this); this.validate = this.validate.bind(this); @@ -218,9 +218,6 @@ class Form extends React.Component { this.setTouchedInput(inputID); this.validate(this.state.inputValues); }, - onLayout: (event) => { - this.inputPositions[inputID] = event.nativeEvent.layout.y; - }, onInputChange: (value, key) => { const inputKey = key || inputID; this.setState(prevState => ({ @@ -264,7 +261,9 @@ class Form extends React.Component { const errors = !_.isEmpty(this.state.errors) ? this.state.errors : this.props.formState.errorFields; const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); this.inputRefs[focusKey].focus(); - this.form.scrollTo({y: this.inputPositions[focusKey], animated: true}); + this.inputRefs[focusKey].measure((fx, fy, width, height, px, py) => { + this.form.scrollTo({y: py, animated: false}); + }) }} containerStyles={[styles.mh0, styles.mt5]} enabledWhenOffline={this.props.enabledWhenOffline} From d3802f6c62669fa78281957935aaa9de1b334a71 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 15:39:02 +0100 Subject: [PATCH 097/185] Use relative position --- src/components/Form.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Form.js b/src/components/Form.js index 41bb9fe7d889..a7320e96580b 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -247,6 +247,9 @@ class Form extends React.Component { contentContainerStyle={styles.flexGrow1} keyboardShouldPersistTaps="handled" ref={el => this.form = el} + onLayout={(event) => { + this.inputPosition = event.nativeEvent.layout.y + 1; + }} > {this.childrenWrapperWithProps(this.props.children)} @@ -262,7 +265,7 @@ class Form extends React.Component { const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); this.inputRefs[focusKey].focus(); this.inputRefs[focusKey].measure((fx, fy, width, height, px, py) => { - this.form.scrollTo({y: py, animated: false}); + this.form.scrollTo({y: py-this.inputPosition, animated: false}); }) }} containerStyles={[styles.mh0, styles.mt5]} From 3aa99f8935fa4152c2a011e7975e2a44b3007f9b Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 15:57:26 +0100 Subject: [PATCH 098/185] style --- src/components/Form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index a7320e96580b..c59e03aed58b 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -265,8 +265,8 @@ class Form extends React.Component { const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); this.inputRefs[focusKey].focus(); this.inputRefs[focusKey].measure((fx, fy, width, height, px, py) => { - this.form.scrollTo({y: py-this.inputPosition, animated: false}); - }) + this.form.scrollTo({y: py - this.inputPosition, animated: false}); + }); }} containerStyles={[styles.mh0, styles.mt5]} enabledWhenOffline={this.props.enabledWhenOffline} From 90104a5b2a335ad53e28a68a7ea8627f48434b22 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 16:53:45 +0100 Subject: [PATCH 099/185] add comment --- src/components/Form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Form.js b/src/components/Form.js index c59e03aed58b..a65f37756196 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -248,6 +248,8 @@ class Form extends React.Component { keyboardShouldPersistTaps="handled" ref={el => this.form = el} onLayout={(event) => { + // Store the parent component position to be used for scrolling. The +1 is to avoid covering + // the upper border of the element we scroll to this.inputPosition = event.nativeEvent.layout.y + 1; }} > From b7344e53d5a7b78eed3271f31b8af1219a03bb8f Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 16:56:47 +0100 Subject: [PATCH 100/185] rename variable --- src/components/Form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index a65f37756196..f376fdfccffc 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -79,7 +79,7 @@ class Form extends React.Component { this.inputRefs = {}; this.touchedInputs = {}; - this.inputPosition = 0; + this.viewPosition = 0; this.setTouchedInput = this.setTouchedInput.bind(this); this.validate = this.validate.bind(this); @@ -250,7 +250,7 @@ class Form extends React.Component { onLayout={(event) => { // Store the parent component position to be used for scrolling. The +1 is to avoid covering // the upper border of the element we scroll to - this.inputPosition = event.nativeEvent.layout.y + 1; + this.viewPosition = event.nativeEvent.layout.y + 1; }} > From b10456170c9d13da4104a09e69d0fb3fa3b42fbf Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 23 Nov 2022 16:57:10 +0100 Subject: [PATCH 101/185] typo --- src/components/Form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Form.js b/src/components/Form.js index f376fdfccffc..e02fa9460cef 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -267,7 +267,7 @@ class Form extends React.Component { const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); this.inputRefs[focusKey].focus(); this.inputRefs[focusKey].measure((fx, fy, width, height, px, py) => { - this.form.scrollTo({y: py - this.inputPosition, animated: false}); + this.form.scrollTo({y: py - this.viewPosition, animated: false}); }); }} containerStyles={[styles.mh0, styles.mt5]} From 66a4d627f40bd006e77000b52a8d03d6660be73e Mon Sep 17 00:00:00 2001 From: Alberto Date: Thu, 24 Nov 2022 09:47:18 +0100 Subject: [PATCH 102/185] Fix keyboard behavior --- src/components/Form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Form.js b/src/components/Form.js index e02fa9460cef..e2818ad86154 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -265,9 +265,9 @@ class Form extends React.Component { onFixTheErrorsLinkPressed={() => { const errors = !_.isEmpty(this.state.errors) ? this.state.errors : this.props.formState.errorFields; const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); - this.inputRefs[focusKey].focus(); this.inputRefs[focusKey].measure((fx, fy, width, height, px, py) => { this.form.scrollTo({y: py - this.viewPosition, animated: false}); + this.inputRefs[focusKey].focus(); }); }} containerStyles={[styles.mh0, styles.mt5]} From aa1036270aabba8205420f1f8cc99a9b3ec309a0 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 24 Nov 2022 22:28:54 +0000 Subject: [PATCH 103/185] Make sure to use dev if dev environment is defined --- src/libs/HttpUtils.js | 2 +- src/libs/shouldUseStagingServer/index.native.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index 3359abe01373..684b6265c0bc 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -10,7 +10,7 @@ import shouldUseStagingServer from './shouldUseStagingServer'; let stagingServerToggleState = false; Onyx.connect({ key: ONYXKEYS.USER, - callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', true), + callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', false), }); let shouldFailAllRequests = false; diff --git a/src/libs/shouldUseStagingServer/index.native.js b/src/libs/shouldUseStagingServer/index.native.js index 8c660f9089f7..533aef10a90d 100644 --- a/src/libs/shouldUseStagingServer/index.native.js +++ b/src/libs/shouldUseStagingServer/index.native.js @@ -1,7 +1,9 @@ +import * as Environment from '../Environment/Environment'; + /* * @param {Boolean} stagingServerToggleState * @returns {Boolean} */ export default function shouldUseStagingServer(stagingServerToggleState) { - return stagingServerToggleState; + return !Environment.isDevelopment() && stagingServerToggleState; } From ba9786c601b4c98164dbede48cbad4f9f3f6842a Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 24 Nov 2022 23:00:22 +0000 Subject: [PATCH 104/185] Default to true --- src/libs/HttpUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index 684b6265c0bc..3359abe01373 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -10,7 +10,7 @@ import shouldUseStagingServer from './shouldUseStagingServer'; let stagingServerToggleState = false; Onyx.connect({ key: ONYXKEYS.USER, - callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', false), + callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', true), }); let shouldFailAllRequests = false; From 49c1478076958bb47591ea36243c870ebc831a37 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 24 Nov 2022 23:05:01 +0000 Subject: [PATCH 105/185] Resolve merge conflict --- src/libs/shouldUseStagingServer/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/libs/shouldUseStagingServer/index.js diff --git a/src/libs/shouldUseStagingServer/index.js b/src/libs/shouldUseStagingServer/index.js new file mode 100644 index 000000000000..745dd03b4489 --- /dev/null +++ b/src/libs/shouldUseStagingServer/index.js @@ -0,0 +1,13 @@ +import CONFIG from '../../CONFIG'; + +/** + * Helper method used to decide which API endpoint to call + * + * @param {Boolean} stagingServerToggleState + * @returns {Boolean} + */ +function shouldUseStagingServer(stagingServerToggleState) { + return CONFIG.IS_IN_STAGING && stagingServerToggleState; +} + +export default shouldUseStagingServer; From b0cdfbf0b3f23c59aa88a93e7594bd65e435309f Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 24 Nov 2022 23:15:51 +0000 Subject: [PATCH 106/185] Default to production apu in staging --- src/components/TestToolMenu.js | 2 +- src/libs/HttpUtils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/TestToolMenu.js b/src/components/TestToolMenu.js index 908c0a8db8a1..33b85186bde3 100644 --- a/src/components/TestToolMenu.js +++ b/src/components/TestToolMenu.js @@ -42,7 +42,7 @@ const TestToolMenu = props => ( This enables QA and internal testers to take advantage of sandbox environments for 3rd party services like Plaid and Onfido. */} User.setShouldUseStagingServer(!lodashGet(props, 'user.shouldUseStagingServer', true))} /> diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index 4c8fe2ee6b30..68869a9dda08 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -9,7 +9,7 @@ import HttpsError from './Errors/HttpsError'; let shouldUseStagingServer = false; Onyx.connect({ key: ONYXKEYS.USER, - callback: val => shouldUseStagingServer = lodashGet(val, 'shouldUseStagingServer', true), + callback: val => shouldUseStagingServer = lodashGet(val, 'shouldUseStagingServer', false), }); let shouldFailAllRequests = false; From bf348307de43de19a205b1d7bc76f43665eb774f Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 25 Nov 2022 12:31:13 +0100 Subject: [PATCH 107/185] new approach --- src/components/Form.js | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index e2818ad86154..658fb3c9cea8 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -79,7 +79,7 @@ class Form extends React.Component { this.inputRefs = {}; this.touchedInputs = {}; - this.viewPosition = 0; + this.childPosition = {}; this.setTouchedInput = this.setTouchedInput.bind(this); this.validate = this.validate.bind(this); @@ -239,7 +239,18 @@ class Form extends React.Component { }); } + setPosition(element, position) { + if (!element.props.inputID && element.props.children) { + _.forEach(element.props.children, (child) => { + this.setPosition(child, position); + }); + } else { + this.childPosition[element.props.inputID] = position; + } + } + render() { + const children = this.childrenWrapperWithProps(this.props.children); return ( <> - {this.childrenWrapperWithProps(this.props.children)} + {_.map(children, child => ( + { + this.setPosition(child, event.nativeEvent.layout.y); + }} + > + {child} + + ))} {this.props.isSubmitButtonVisible && ( { const errors = !_.isEmpty(this.state.errors) ? this.state.errors : this.props.formState.errorFields; const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(errors).includes(key)); - this.inputRefs[focusKey].measure((fx, fy, width, height, px, py) => { - this.form.scrollTo({y: py - this.viewPosition, animated: false}); - this.inputRefs[focusKey].focus(); - }); + this.form.scrollTo({y: this.childPosition[focusKey], animated: false}); + this.inputRefs[focusKey].focus(); }} containerStyles={[styles.mh0, styles.mt5]} enabledWhenOffline={this.props.enabledWhenOffline} From 443d6868d949fcf684bccbc12829b07ac3f8b7a0 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 25 Nov 2022 12:31:43 +0100 Subject: [PATCH 108/185] cleanUp --- src/components/Form.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index 658fb3c9cea8..580cd99d0d37 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -258,11 +258,6 @@ class Form extends React.Component { contentContainerStyle={styles.flexGrow1} keyboardShouldPersistTaps="handled" ref={el => this.form = el} - onLayout={(event) => { - // Store the parent component position to be used for scrolling. The +1 is to avoid covering - // the upper border of the element we scroll to - this.viewPosition = event.nativeEvent.layout.y + 1; - }} > {_.map(children, child => ( From bf7d9b40c6ec5bf848eecfcd164f4627c94abbc2 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 25 Nov 2022 12:33:20 +0100 Subject: [PATCH 109/185] remove extra const --- src/components/Form.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index 580cd99d0d37..77e32939f466 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -250,7 +250,6 @@ class Form extends React.Component { } render() { - const children = this.childrenWrapperWithProps(this.props.children); return ( <> this.form = el} > - {_.map(children, child => ( + {_.map(this.childrenWrapperWithProps(this.props.children), child => ( { this.setPosition(child, event.nativeEvent.layout.y); From 868bfe83475b6296a52ceed0567ad668689af39f Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 25 Nov 2022 12:47:20 +0100 Subject: [PATCH 110/185] style --- src/components/Form.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index 77e32939f466..4cdeaac1f5db 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -109,6 +109,16 @@ class Form extends React.Component { return _.first(_.keys(hasStateErrors ? this.state.erorrs : this.props.formState.errorFields)); } + setPosition(element, position) { + if (!element.props.inputID && element.props.children) { + _.forEach(element.props.children, (child) => { + this.setPosition(child, position); + }); + } else { + this.childPosition[element.props.inputID] = position; + } + } + submit() { // Return early if the form is already submitting to avoid duplicate submission if (this.props.formState.isLoading) { @@ -239,16 +249,6 @@ class Form extends React.Component { }); } - setPosition(element, position) { - if (!element.props.inputID && element.props.children) { - _.forEach(element.props.children, (child) => { - this.setPosition(child, position); - }); - } else { - this.childPosition[element.props.inputID] = position; - } - } - render() { return ( <> From a17a2672c1c9ee1fc80881ab11fa32112ea26e35 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 28 Nov 2022 14:45:33 -0700 Subject: [PATCH 111/185] Fix conflicts from theme work --- .../SignInPageLayout/SignInPageContent.js | 20 +++++---- src/styles/styles.js | 42 ++----------------- src/styles/utilities/flex.js | 4 ++ 3 files changed, 19 insertions(+), 47 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index f0b426612d9d..66926132c1e6 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -1,5 +1,5 @@ import React from 'react'; -import {ScrollView, View, KeyboardAvoidingView} from 'react-native'; +import {View, TouchableWithoutFeedback, Keyboard} from 'react-native'; import PropTypes from 'prop-types'; import {withSafeAreaInsets} from 'react-native-safe-area-context'; import styles from '../../../styles/styles'; @@ -10,10 +10,8 @@ import TermsAndLicenses from '../TermsAndLicenses'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import SignInPageForm from '../../../components/SignInPageForm'; import compose from '../../../libs/compose'; -import scrollViewContentContainerStyles from './signInPageStyles'; import withKeyboardState from '../../../components/withKeyboardState'; import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; -import * as StyleUtils from '../../../styles/StyleUtils'; const propTypes = { /** The children to show inside the layout */ @@ -53,7 +51,13 @@ const SignInPageContent = (props) => { {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} - + { {props.children} - + - - -); + + ); +}; SignInPageContent.propTypes = propTypes; SignInPageContent.displayName = 'SignInPageContent'; diff --git a/src/styles/styles.js b/src/styles/styles.js index c54517794e89..43b96e63398b 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -893,11 +893,6 @@ const styles = { flex: 1, }, - signInPageLogo: { - height: variables.componentSizeLarge, - marginBottom: 24, - }, - signInPageInner: { marginLeft: 'auto', marginRight: 'auto', @@ -910,44 +905,13 @@ const styles = { minHeight: 24, }, - signInPageHeroHeading: { - fontFamily: fontFamily.GTA, - fontWeight: fontWeightBold, - fontSize: variables.fontSizeHero, - color: themeColors.appBG, - lineHeight: variables.lineHeightHero, - }, - - signInPageHeroDescription: { - fontFamily: fontFamily.GTA, - fontSize: variables.fontSizeNormal, - color: themeColors.appBG, - }, - - signInPageFormContainer: { - maxWidth: 295, - width: '100%', - }, - - signInPageNarrowContentContainer: { - maxWidth: 335, - }, - - signInPageNarrowContentMargin: { - marginTop: '40%', - }, - signInPageWideLeftContainer: { - width: 375, maxWidth: 375, }, - signInPageWideLeftContentMargin: { - marginTop: '44.5%', - }, - - signInPageWideHeroContent: { - maxWidth: 400, + signInPageLeftContainer: { + paddingLeft: 40, + paddingRight: 40, }, changeExpensifyLoginLinkContainer: { diff --git a/src/styles/utilities/flex.js b/src/styles/utilities/flex.js index 22acb5cba4ff..bdba4238a2fc 100644 --- a/src/styles/utilities/flex.js +++ b/src/styles/utilities/flex.js @@ -108,6 +108,10 @@ export default { flexGrow: 1, }, + flexGrow2: { + flexGrow: 2, + }, + flexGrow4: { flexGrow: 4, }, From 17e8d3166fe0ff3e6f3eeb53bfbcb2c5ca6a865a Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 28 Nov 2022 15:27:28 -0700 Subject: [PATCH 112/185] Get layout working on web and android --- src/components/FormAlertWithSubmitButton.js | 2 +- src/components/withWindowDimensions.js | 2 +- src/pages/signin/ResendValidationForm.js | 2 +- .../signin/SignInPageLayout/SignInPageContent.js | 11 ++++------- src/styles/styles.js | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/FormAlertWithSubmitButton.js b/src/components/FormAlertWithSubmitButton.js index f611a18e16ef..fdace1fcc40f 100644 --- a/src/components/FormAlertWithSubmitButton.js +++ b/src/components/FormAlertWithSubmitButton.js @@ -53,7 +53,7 @@ const defaultProps = { const FormAlertWithSubmitButton = props => ( variables.mobileResponsiveWidthBreakpoint && initialDimensions.width <= variables.tabletResponsiveWidthBreakpoint; - const isLargeScreenWidth = !isMediumScreenWidth && !isMediumScreenWidth; + const isLargeScreenWidth = !isSmallScreenWidth && !isMediumScreenWidth; this.dimensionsEventListener = null; diff --git a/src/pages/signin/ResendValidationForm.js b/src/pages/signin/ResendValidationForm.js index 4c52df0121a0..8854905a47e8 100755 --- a/src/pages/signin/ResendValidationForm.js +++ b/src/pages/signin/ResendValidationForm.js @@ -73,7 +73,7 @@ const ResendValidationForm = (props) => { {!_.isEmpty(props.account.message) && ( // DotIndicatorMessage mostly expects onyxData errors so we need to mock an object so that the messages looks similar to prop.account.errors - + )} {!_.isEmpty(props.account.errors) && ( diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 66926132c1e6..5b750b191ba7 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -45,7 +45,7 @@ const SignInPageContent = (props) => { styles.signInPageLeftContainer, // Restrict the width of the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. - props.isLargeScreenWidth && styles.signInPageWideLeftContainer, + props.isLargeScreenWidth && styles.signInPageLeftContainerLargeScreen, ]} > {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} @@ -55,13 +55,10 @@ const SignInPageContent = (props) => { style={[ styles.flexGrow2, styles.alignSelfCenter, - styles.signInPageWideLeftContainer, + styles.signInPageLeftContainerLargeScreen, ]} > - + { {props.children} - + diff --git a/src/styles/styles.js b/src/styles/styles.js index 43b96e63398b..f88d28f90001 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -905,7 +905,7 @@ const styles = { minHeight: 24, }, - signInPageWideLeftContainer: { + signInPageLeftContainerLargeScreen: { maxWidth: 375, }, From 1bb4d4ba281079e925b46c781966cdb90136f5c1 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 28 Nov 2022 15:30:35 -0700 Subject: [PATCH 113/185] Remove medium screen layout --- src/pages/signin/SignInPageLayout/index.js | 10 +--------- src/styles/utilities/flex.js | 4 ---- src/styles/variables.js | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/index.js b/src/pages/signin/SignInPageLayout/index.js index 42fdd6de8ade..216a6a2bdf8b 100644 --- a/src/pages/signin/SignInPageLayout/index.js +++ b/src/pages/signin/SignInPageLayout/index.js @@ -25,21 +25,13 @@ const SignInPageLayout = (props) => { let containerStyles = [styles.flex1, styles.signInPageInner]; let contentContainerStyles = [styles.flex1, styles.flexRow]; - const isLongMediumScreenWidth = props.isMediumScreenWidth && props.windowHeight >= variables.minHeightToShowGraphics; - if (props.isSmallScreenWidth) { containerStyles = [styles.flex1]; contentContainerStyles = [styles.flex1]; - } else if (isLongMediumScreenWidth) { - containerStyles = [styles.dFlex, styles.signInPageInner, styles.flexColumnReverse, styles.justifyContentBetween]; - contentContainerStyles = [styles.flex1]; } return ( - {isLongMediumScreenWidth && ( - - )} { > {props.children} - {!props.isSmallScreenWidth && !isLongMediumScreenWidth && ( + {!props.isSmallScreenWidth && ( )} diff --git a/src/styles/utilities/flex.js b/src/styles/utilities/flex.js index bdba4238a2fc..4de3409948a4 100644 --- a/src/styles/utilities/flex.js +++ b/src/styles/utilities/flex.js @@ -36,10 +36,6 @@ export default { flexDirection: 'column', }, - flexColumnReverse: { - flexDirection: 'column-reverse', - }, - justifyContentCenter: { justifyContent: 'center', }, diff --git a/src/styles/variables.js b/src/styles/variables.js index 409c9be576f2..ef57ec32acd5 100644 --- a/src/styles/variables.js +++ b/src/styles/variables.js @@ -49,7 +49,6 @@ export default { tooltipzIndex: 10050, gutterWidth: 16, popoverMenuShadow: '0px 4px 12px 0px rgba(0, 0, 0, 0.06)', - minHeightToShowGraphics: 854, // Login form layout breaks below this height due to insufficient space to show the form and graphics optionRowHeight: 64, optionRowHeightCompact: 52, optionsListSectionHeaderHeight: 54, From 391fd42d4c20b352ea053230252c8cdbb8959417 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 28 Nov 2022 15:37:57 -0700 Subject: [PATCH 114/185] Remove medium screen styles --- src/pages/signin/SignInPageLayout/SignInPageContent.js | 4 ++-- src/pages/signin/SignInPageLayout/index.js | 1 - src/styles/styles.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 5b750b191ba7..175c7636bec5 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -45,7 +45,7 @@ const SignInPageContent = (props) => { styles.signInPageLeftContainer, // Restrict the width of the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. - props.isLargeScreenWidth && styles.signInPageLeftContainerLargeScreen, + !props.isSmallScreenWidth && styles.signInPageLeftContainerMediumScreen, ]} > {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} @@ -55,7 +55,7 @@ const SignInPageContent = (props) => { style={[ styles.flexGrow2, styles.alignSelfCenter, - styles.signInPageLeftContainerLargeScreen, + styles.signInPageLeftContainerMediumScreen, ]} > diff --git a/src/pages/signin/SignInPageLayout/index.js b/src/pages/signin/SignInPageLayout/index.js index 216a6a2bdf8b..c165b336bb3d 100644 --- a/src/pages/signin/SignInPageLayout/index.js +++ b/src/pages/signin/SignInPageLayout/index.js @@ -4,7 +4,6 @@ import PropTypes from 'prop-types'; import SignInPageContent from './SignInPageContent'; import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; import styles from '../../../styles/styles'; -import variables from '../../../styles/variables'; import SignInPageGraphics from './SignInPageGraphics'; const propTypes = { diff --git a/src/styles/styles.js b/src/styles/styles.js index f88d28f90001..de2832c6f32c 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -905,7 +905,7 @@ const styles = { minHeight: 24, }, - signInPageLeftContainerLargeScreen: { + signInPageLeftContainerMediumScreen: { maxWidth: 375, }, From 32e12b87aedad593ac4437c2773a4725ba939b64 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 17:03:35 -0700 Subject: [PATCH 115/185] Re-add checkout --- .github/actions/composite/setupNode/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index d475acf5380f..95e187ff4d3a 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -4,6 +4,10 @@ description: Set up Node runs: using: composite steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: node-version-file: '.nvmrc' From a9ca824b6d2c5895f26ae037c504c6835e52dac2 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 17:05:02 -0700 Subject: [PATCH 116/185] Use my branch --- .github/workflows/e2ePerformanceRegressionTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 65abec9e53fd..c0b689cb2ec9 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -8,7 +8,7 @@ jobs: name: "Run e2e performance regression tests" runs-on: ubuntu-20.04-64core steps: - - uses: Expensify/App/.github/actions/composite/setupNode@main + - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 with: From 5381ce129e7e8887e1907138e08c2943cabc0026 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 18:11:41 -0700 Subject: [PATCH 117/185] Add test for fail/pass --- .../e2ePerformanceRegressionTests.yml | 9 ++ .github/workflows/preDeploy.yml | 93 +++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index c0b689cb2ec9..3a3b92817dea 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -89,3 +89,12 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token-user-login: 'github-actions[bot]' + - name: Test passed + if: !contains(env.OUTPUT, 'There are no entries') + run: | + echo "Test passed" + + - name: Test failed + if: contains(env.OUTPUT, 'There are no entries') + run: | + echo "Test failed" diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 045187c396e1..ef3db0d0f65c 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -222,3 +222,96 @@ jobs: 3. Once your PR is deployed to _production_, we start a 7-day timer :alarm_clock:. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job. :moneybag: So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! :blush: + + e2e-tests: + name: "Run e2e performance regression tests" + runs-on: ubuntu-20.04-64core + steps: + - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df + + - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 + with: + ruby-version: '2.7' + bundler-cache: true + + - name: Get merged pull request + id: getMergedPullRequest + # TODO: Point back action actions-ecosystem after https://github.com/actions-ecosystem/action-get-merged-pull-request/pull/223 is merged + uses: roryabraham/action-get-merged-pull-request@7a7a194f6ff8f3eef58c822083695a97314ebec1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + # Cache gradle to improve Android build time + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: Make zip directory for everything to send to AWS Device Farm + run: mkdir zip + + - name: Checkout "Compare" commit + # TODO: Figure out previous PR last commit + run: git checkout ${{ inputs.compare-commit }} + + - name: Build "Compare" APK + run: npm run android-build-e2e + + - name: Copy "Compare" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk + + - name: Checkout "Baseline" commit + run: git checkout main + + - name: Build "Baseline" APK + run: npm run android-build-e2e + + - name: Copy "Baseline" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-baseline.apk + + - name: Checkout previous branch for source code to run on AWS Device farm + run: git checkout - + + - name: Copy e2e code into zip folder + run: cp -r tests/e2e zip + + - name: Zip everything in the zip directory up + run: zip -qr App.zip ./zip + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Schedule AWS Device Farm test run + uses: realm/aws-devicefarm/test-application@master + with: + name: App E2E Performance Regression Tests + project_arn: ${{ secrets.AWS_PROJECT_ARN }} + device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} + app_file: zip/app-e2eRelease-baseline.apk + app_type: ANDROID_APP + test_type: APPIUM_NODE + test_package_file: App.zip + test_package_type: APPIUM_NODE_TEST_PACKAGE + test_spec_file: tests/e2e/TestSpec.yml + test_spec_type: APPIUM_NODE_TEST_SPEC + remote_src: false + file_artifacts: Customer Artifacts.zip + cleanup: true + + - name: Unzip AWS Device Farm results + run: unzip Customer\ Artifacts.zip + + - name: Set output of AWS Device Farm into GitHub ENV + run: | + { echo 'OUTPUT<> "$GITHUB_ENV" + + - name: Leave output of AWS Device Farm as a PR comment + uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac + with: + github_token: ${{ secrets.OS_BOTIFY_TOKEN }} + number: ${{ steps.getMergedPullRequest.outputs.number }} + body: ${{ env.OUTPUT }} + + # TODO: Leave deploy blocker label if 'Significant Changes To Duration' From 08202e42f2ee6bbe5445aadae9d3f8e65e120265 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 18:17:23 -0700 Subject: [PATCH 118/185] Tweak syntax --- .github/workflows/e2ePerformanceRegressionTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 3a3b92817dea..1327d7148814 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -90,11 +90,11 @@ jobs: repo-token-user-login: 'github-actions[bot]' - name: Test passed - if: !contains(env.OUTPUT, 'There are no entries') + if: ${{ !contains(env.OUTPUT, 'There are no entries') }} run: | echo "Test passed" - name: Test failed - if: contains(env.OUTPUT, 'There are no entries') + if: ${{ contains(env.OUTPUT, 'There are no entries') }} run: | echo "Test failed" From e333c47912d51577725053b7689e71afa46c5cb7 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 18:31:18 -0700 Subject: [PATCH 119/185] Adjust test --- .../e2ePerformanceRegressionTests.yml | 15 +++++-------- .github/workflows/preDeploy.yml | 22 ++++++++++--------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 1327d7148814..766ef2403403 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -83,18 +83,15 @@ jobs: { echo 'OUTPUT<> "$GITHUB_ENV" - name: Leave output of AWS Device Farm as a PR comment - uses: mshick/add-pr-comment@v1 - with: - message: ${{ env.OUTPUT }} - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: 'github-actions[bot]' + run: | + gh pr comment -b ${{ env.OUTPUT }} - name: Test passed - if: ${{ !contains(env.OUTPUT, 'There are no entries') }} + if: ${{ contains(env.OUTPUT, 'There are no entries') }} run: | - echo "Test passed" + gh pr comment -b "Test passed" - name: Test failed - if: ${{ contains(env.OUTPUT, 'There are no entries') }} + if: ${{ !contains(env.OUTPUT, 'There are no entries') }} run: | - echo "Test failed" + gh pr comment -b "Test failed" diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index ef3db0d0f65c..40034bb27e7c 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -234,13 +234,6 @@ jobs: ruby-version: '2.7' bundler-cache: true - - name: Get merged pull request - id: getMergedPullRequest - # TODO: Point back action actions-ecosystem after https://github.com/actions-ecosystem/action-get-merged-pull-request/pull/223 is merged - uses: roryabraham/action-get-merged-pull-request@7a7a194f6ff8f3eef58c822083695a97314ebec1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Cache gradle to improve Android build time - name: Gradle cache uses: gradle/gradle-build-action@v2 @@ -249,8 +242,7 @@ jobs: run: mkdir zip - name: Checkout "Compare" commit - # TODO: Figure out previous PR last commit - run: git checkout ${{ inputs.compare-commit }} + run: git checkout ${{ github.event.before }} - name: Build "Compare" APK run: npm run android-build-e2e @@ -307,6 +299,13 @@ jobs: run: | { echo 'OUTPUT<> "$GITHUB_ENV" + - name: Get merged pull request + id: getMergedPullRequest + # TODO: Point back action actions-ecosystem after https://github.com/actions-ecosystem/action-get-merged-pull-request/pull/223 is merged + uses: roryabraham/action-get-merged-pull-request@7a7a194f6ff8f3eef58c822083695a97314ebec1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Leave output of AWS Device Farm as a PR comment uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac with: @@ -314,4 +313,7 @@ jobs: number: ${{ steps.getMergedPullRequest.outputs.number }} body: ${{ env.OUTPUT }} - # TODO: Leave deploy blocker label if 'Significant Changes To Duration' + - name: Check if test failed, if so leave a deploy blocker label + if: ${{ !contains(env.OUTPUT, 'There are no entries') }} + run: | + gh pr edit ${{ steps.getMergedPullRequest.outputs.number }} --add-label 'DeployBlockerCash' From 5d6314782d350228ac5d0b150d47cdaaff4dfff9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 18:39:13 -0700 Subject: [PATCH 120/185] Fix lint and remove unused file --- .../scripts/validateActionsAndWorkflows.sh | 2 +- .../e2ePerformanceRegressionTests.yml | 97 ------------------- .github/workflows/preDeploy.yml | 8 +- 3 files changed, 4 insertions(+), 103 deletions(-) delete mode 100644 .github/workflows/e2ePerformanceRegressionTests.yml diff --git a/.github/scripts/validateActionsAndWorkflows.sh b/.github/scripts/validateActionsAndWorkflows.sh index a7a447b8422d..0c373a0a247a 100755 --- a/.github/scripts/validateActionsAndWorkflows.sh +++ b/.github/scripts/validateActionsAndWorkflows.sh @@ -43,7 +43,7 @@ for ((i=0; i < ${#WORKFLOWS[@]}; i++)); do WORKFLOW=${WORKFLOWS[$i]} # Skip linting e2e workflow due to bug here: https://github.com/SchemaStore/schemastore/issues/2579 - if [[ "$WORKFLOW" == './workflows/e2ePerformanceRegressionTests.yml' ]]; then + if [[ "$WORKFLOW" == './workflows/preDeploy.yml' ]]; then continue fi diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml deleted file mode 100644 index 766ef2403403..000000000000 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Run e2e performance regression tests - -on: - push: - -jobs: - e2e-tests: - name: "Run e2e performance regression tests" - runs-on: ubuntu-20.04-64core - steps: - - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df - - - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 - with: - ruby-version: '2.7' - bundler-cache: true - - # Cache gradle to improve Android build time - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - - - name: Make zip directory for everything to send to AWS Device Farm - run: mkdir zip - - - name: Build "Compare" APK - run: npm run android-build-e2e - - - name: Copy "Compare" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk - -# TODO: Uncomment before merge -# - name: Checkout "Baseline" -# run: git checkout main - -# TODO: Delete before merge - - name: Checkout "Baseline" - run: git checkout andrew-baseline - - - name: Build "Baseline" APK - run: npm run android-build-e2e - - - name: Copy "Baseline" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-baseline.apk - - - name: Checkout previous branch for source code to run on AWS Device farm - run: git checkout - - - - name: Copy e2e code into zip folder - run: cp -r tests/e2e zip - - - name: Zip everything in the zip directory up - run: zip -qr App.zip ./zip - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Schedule AWS Device Farm test run - uses: realm/aws-devicefarm/test-application@master - with: - name: App E2E Performance Regression Tests - project_arn: ${{ secrets.AWS_PROJECT_ARN }} - device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} - app_file: zip/app-e2eRelease-baseline.apk - app_type: ANDROID_APP - test_type: APPIUM_NODE - test_package_file: App.zip - test_package_type: APPIUM_NODE_TEST_PACKAGE - test_spec_file: tests/e2e/TestSpec.yml - test_spec_type: APPIUM_NODE_TEST_SPEC - remote_src: false - file_artifacts: Customer Artifacts.zip - cleanup: true - - - name: Unzip AWS Device Farm results - run: unzip Customer\ Artifacts.zip - - - name: Set output of AWS Device Farm into GitHub ENV - run: | - { echo 'OUTPUT<> "$GITHUB_ENV" - - - name: Leave output of AWS Device Farm as a PR comment - run: | - gh pr comment -b ${{ env.OUTPUT }} - - - name: Test passed - if: ${{ contains(env.OUTPUT, 'There are no entries') }} - run: | - gh pr comment -b "Test passed" - - - name: Test failed - if: ${{ !contains(env.OUTPUT, 'There are no entries') }} - run: | - gh pr comment -b "Test failed" diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 40034bb27e7c..01227cffaeff 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -307,13 +307,11 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} - name: Leave output of AWS Device Farm as a PR comment - uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac - with: - github_token: ${{ secrets.OS_BOTIFY_TOKEN }} - number: ${{ steps.getMergedPullRequest.outputs.number }} - body: ${{ env.OUTPUT }} + run: | + gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -b ${{ env.OUTPUT }} - name: Check if test failed, if so leave a deploy blocker label if: ${{ !contains(env.OUTPUT, 'There are no entries') }} run: | gh pr edit ${{ steps.getMergedPullRequest.outputs.number }} --add-label 'DeployBlockerCash' + gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -b "@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker." From 98e836f18ee1d50903cf001f33594318a51d61e9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 18:49:19 -0700 Subject: [PATCH 121/185] Checkout latest release as baseline --- .github/workflows/preDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 01227cffaeff..0240ef3f0224 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -250,8 +250,8 @@ jobs: - name: Copy "Compare" APK run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk - - name: Checkout "Baseline" commit - run: git checkout main + - name: Checkout "Baseline" commit (last release) + run: git checkout $(gh release list --limit 1 | awk '{ print $1 }') - name: Build "Baseline" APK run: npm run android-build-e2e From 1db38a8ffc61dc1212a8f3e8c81090dad6f3d474 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 18:55:45 -0700 Subject: [PATCH 122/185] Add " --- .github/workflows/preDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 0240ef3f0224..87cfdfb9857e 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -251,7 +251,7 @@ jobs: run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk - name: Checkout "Baseline" commit (last release) - run: git checkout $(gh release list --limit 1 | awk '{ print $1 }') + run: git checkout "$(gh release list --limit 1 | awk '{ print $1 }')" - name: Build "Baseline" APK run: npm run android-build-e2e From 92a52adf947a6e2f680fc16e6f24540b893fc2f9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 19:08:50 -0700 Subject: [PATCH 123/185] One more test --- .../e2ePerformanceRegressionTests.yml | 97 +++++++++++++++++++ .github/workflows/preDeploy.yml | 2 +- 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2ePerformanceRegressionTests.yml diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml new file mode 100644 index 000000000000..3118cb52a83a --- /dev/null +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -0,0 +1,97 @@ +name: Run e2e performance regression tests + +on: + push: + +jobs: + e2e-tests: + name: "Run e2e performance regression tests" + runs-on: ubuntu-20.04-64core + steps: + - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df + + - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 + with: + ruby-version: '2.7' + bundler-cache: true + + # Cache gradle to improve Android build time + - name: Gradle cache + uses: gradle/gradle-build-action@v2 + + - name: Make zip directory for everything to send to AWS Device Farm + run: mkdir zip + + - name: Build "Compare" APK + run: npm run android-build-e2e + + - name: Copy "Compare" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk + + # TODO: Uncomment before merge + # - name: Checkout "Baseline" + # run: git checkout main + + # TODO: Delete before merge + - name: Checkout "Baseline" + run: git checkout andrew-baseline + + - name: Build "Baseline" APK + run: npm run android-build-e2e + + - name: Copy "Baseline" APK + run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-baseline.apk + + - name: Checkout previous branch for source code to run on AWS Device farm + run: git checkout - + + - name: Copy e2e code into zip folder + run: cp -r tests/e2e zip + + - name: Zip everything in the zip directory up + run: zip -qr App.zip ./zip + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Schedule AWS Device Farm test run + uses: realm/aws-devicefarm/test-application@master + with: + name: App E2E Performance Regression Tests + project_arn: ${{ secrets.AWS_PROJECT_ARN }} + device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} + app_file: zip/app-e2eRelease-baseline.apk + app_type: ANDROID_APP + test_type: APPIUM_NODE + test_package_file: App.zip + test_package_type: APPIUM_NODE_TEST_PACKAGE + test_spec_file: tests/e2e/TestSpec.yml + test_spec_type: APPIUM_NODE_TEST_SPEC + remote_src: false + file_artifacts: Customer Artifacts.zip + cleanup: true + + - name: Unzip AWS Device Farm results + run: unzip Customer\ Artifacts.zip + + - name: Set output of AWS Device Farm into GitHub ENV + run: | + { echo 'OUTPUT<> "$GITHUB_ENV" + + - name: Leave output of AWS Device Farm as a PR comment + run: | + gh pr comment -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md + + - name: Test passed + if: ${{ contains(env.OUTPUT, 'There are no entries') }} + run: | + gh pr comment -b "Test passed" + + - name: Test failed + if: ${{ !contains(env.OUTPUT, 'There are no entries') }} + run: | + gh pr comment -b "Test failed" diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 87cfdfb9857e..1c2cdf44cea4 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -308,7 +308,7 @@ jobs: - name: Leave output of AWS Device Farm as a PR comment run: | - gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -b ${{ env.OUTPUT }} + gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - name: Check if test failed, if so leave a deploy blocker label if: ${{ !contains(env.OUTPUT, 'There are no entries') }} From 90b9ed92b9b057f3616b72a2aa2dbaa1d252b486 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 19:34:54 -0700 Subject: [PATCH 124/185] More testing --- .github/workflows/e2ePerformanceRegressionTests.yml | 6 ++++++ .github/workflows/preDeploy.yml | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml index 3118cb52a83a..8f3354fb2fdf 100644 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ b/.github/workflows/e2ePerformanceRegressionTests.yml @@ -85,13 +85,19 @@ jobs: - name: Leave output of AWS Device Farm as a PR comment run: | gh pr comment -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Test passed if: ${{ contains(env.OUTPUT, 'There are no entries') }} run: | gh pr comment -b "Test passed" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Test failed if: ${{ !contains(env.OUTPUT, 'There are no entries') }} run: | gh pr comment -b "Test failed" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 1c2cdf44cea4..2d853d45b707 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -308,10 +308,14 @@ jobs: - name: Leave output of AWS Device Farm as a PR comment run: | - gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md + gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check if test failed, if so leave a deploy blocker label if: ${{ !contains(env.OUTPUT, 'There are no entries') }} run: | gh pr edit ${{ steps.getMergedPullRequest.outputs.number }} --add-label 'DeployBlockerCash' gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} -b "@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker." + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 372aa2e9fca7ee495638ba1a253269a428885718 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 28 Nov 2022 19:59:33 -0700 Subject: [PATCH 125/185] Remove test file --- .../e2ePerformanceRegressionTests.yml | 103 ------------------ 1 file changed, 103 deletions(-) delete mode 100644 .github/workflows/e2ePerformanceRegressionTests.yml diff --git a/.github/workflows/e2ePerformanceRegressionTests.yml b/.github/workflows/e2ePerformanceRegressionTests.yml deleted file mode 100644 index 8f3354fb2fdf..000000000000 --- a/.github/workflows/e2ePerformanceRegressionTests.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Run e2e performance regression tests - -on: - push: - -jobs: - e2e-tests: - name: "Run e2e performance regression tests" - runs-on: ubuntu-20.04-64core - steps: - - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df - - - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 - with: - ruby-version: '2.7' - bundler-cache: true - - # Cache gradle to improve Android build time - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - - - name: Make zip directory for everything to send to AWS Device Farm - run: mkdir zip - - - name: Build "Compare" APK - run: npm run android-build-e2e - - - name: Copy "Compare" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-compare.apk - - # TODO: Uncomment before merge - # - name: Checkout "Baseline" - # run: git checkout main - - # TODO: Delete before merge - - name: Checkout "Baseline" - run: git checkout andrew-baseline - - - name: Build "Baseline" APK - run: npm run android-build-e2e - - - name: Copy "Baseline" APK - run: cp android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk zip/app-e2eRelease-baseline.apk - - - name: Checkout previous branch for source code to run on AWS Device farm - run: git checkout - - - - name: Copy e2e code into zip folder - run: cp -r tests/e2e zip - - - name: Zip everything in the zip directory up - run: zip -qr App.zip ./zip - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Schedule AWS Device Farm test run - uses: realm/aws-devicefarm/test-application@master - with: - name: App E2E Performance Regression Tests - project_arn: ${{ secrets.AWS_PROJECT_ARN }} - device_pool_arn: ${{ secrets.AWS_DEVICE_POOL_ARN }} - app_file: zip/app-e2eRelease-baseline.apk - app_type: ANDROID_APP - test_type: APPIUM_NODE - test_package_file: App.zip - test_package_type: APPIUM_NODE_TEST_PACKAGE - test_spec_file: tests/e2e/TestSpec.yml - test_spec_type: APPIUM_NODE_TEST_SPEC - remote_src: false - file_artifacts: Customer Artifacts.zip - cleanup: true - - - name: Unzip AWS Device Farm results - run: unzip Customer\ Artifacts.zip - - - name: Set output of AWS Device Farm into GitHub ENV - run: | - { echo 'OUTPUT<> "$GITHUB_ENV" - - - name: Leave output of AWS Device Farm as a PR comment - run: | - gh pr comment -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Test passed - if: ${{ contains(env.OUTPUT, 'There are no entries') }} - run: | - gh pr comment -b "Test passed" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Test failed - if: ${{ !contains(env.OUTPUT, 'There are no entries') }} - run: | - gh pr comment -b "Test failed" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e679eef02c3d99e19678d713c9b423d7968df966 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 29 Nov 2022 11:39:42 -0700 Subject: [PATCH 126/185] Move checkout back --- .github/actions/composite/setupNode/action.yml | 4 ---- .github/workflows/preDeploy.yml | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/composite/setupNode/action.yml b/.github/actions/composite/setupNode/action.yml index 95e187ff4d3a..d475acf5380f 100644 --- a/.github/actions/composite/setupNode/action.yml +++ b/.github/actions/composite/setupNode/action.yml @@ -4,10 +4,6 @@ description: Set up Node runs: using: composite steps: - - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - with: - fetch-depth: 0 - - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 with: node-version-file: '.nvmrc' diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 2d853d45b707..a3c49ec381f2 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -227,7 +227,11 @@ jobs: name: "Run e2e performance regression tests" runs-on: ubuntu-20.04-64core steps: - - uses: Expensify/App/.github/actions/composite/setupNode@andrew-aws-df + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + with: + fetch-depth: 0 + + - uses: Expensify/App/.github/actions/composite/setupNode@main - uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7 with: From 19f654f9c06a961a0880089cdb9367c9fb1635f7 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Wed, 30 Nov 2022 06:38:47 -0700 Subject: [PATCH 127/185] Removed unused import --- src/pages/signin/SignInPageLayout/SignInPageContent.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 295823801c9f..175c7636bec5 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -4,7 +4,6 @@ import PropTypes from 'prop-types'; import {withSafeAreaInsets} from 'react-native-safe-area-context'; import styles from '../../../styles/styles'; import variables from '../../../styles/variables'; -import KeyboardAvoidingView from '../../../components/KeyboardAvoidingView'; import ExpensifyCashLogo from '../../../components/ExpensifyCashLogo'; import Text from '../../../components/Text'; import TermsAndLicenses from '../TermsAndLicenses'; From c351516a0a98b61d1f05fa359e9035f1cd95091b Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Wed, 30 Nov 2022 07:24:40 -0700 Subject: [PATCH 128/185] Make sure the padding is the same on the password form --- src/pages/signin/SignInPageLayout/SignInPageContent.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 175c7636bec5..491c8fcc0794 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -51,13 +51,7 @@ const SignInPageContent = (props) => { {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} - + Date: Wed, 30 Nov 2022 07:34:36 -0700 Subject: [PATCH 129/185] Add a little vertical mergin --- src/pages/signin/SignInPageLayout/SignInPageContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 491c8fcc0794..852d99a6c9fd 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -71,7 +71,7 @@ const SignInPageContent = (props) => { {props.children} - + From 8ffc298033e65b6d1fcf32bf10b934c0878603b9 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Wed, 30 Nov 2022 18:23:47 -0700 Subject: [PATCH 130/185] Keep the form a fixed width on small to medium screens --- src/pages/signin/SignInPageLayout/SignInPageContent.js | 4 +--- src/styles/styles.js | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index 852d99a6c9fd..ee5c858eae84 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -43,9 +43,7 @@ const SignInPageContent = (props) => { style={[ styles.flex1, styles.signInPageLeftContainer, - - // Restrict the width of the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. - !props.isSmallScreenWidth && styles.signInPageLeftContainerMediumScreen, + styles.signInPageLeftContainerMediumScreen, ]} > {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} diff --git a/src/styles/styles.js b/src/styles/styles.js index 6d6255ad419c..0c34ff1eb69c 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -906,7 +906,9 @@ const styles = { }, signInPageLeftContainerMediumScreen: { - maxWidth: 375, + maxWidth: 400, + marginLeft: 'auto', + marginRight: 'auto', }, signInPageLeftContainer: { From 3a2bae4882b9e0019d837876df320f811de8362e Mon Sep 17 00:00:00 2001 From: miroslav Date: Thu, 1 Dec 2022 05:38:09 +0100 Subject: [PATCH 131/185] fix "FAB menu and sidebar can be opened at the same time" --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index 465902df23d0..6fe0447ef495 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -147,8 +147,7 @@ class FloatingActionButtonAndPopover extends React.Component { * - Selecting an item on CreateMenu or closing it by clicking outside of the modal component */ hideCreateMenu() { - if (this.isScreenInactive()) { - // Prevent showing menu when click FAB icon quickly after opening other pages + if (!this.state.isCreateMenuActive) { return; } this.props.onHideCreateMenu(); From 35b1d98a4106c3fb9eb576e100efe7c4b18d80c7 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Thu, 1 Dec 2022 11:39:37 +0200 Subject: [PATCH 132/185] Webpack - extract separate vendors chunk for better caching --- config/webpack/webpack.common.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config/webpack/webpack.common.js b/config/webpack/webpack.common.js index 0b555105300a..0963a699b68c 100644 --- a/config/webpack/webpack.common.js +++ b/config/webpack/webpack.common.js @@ -212,6 +212,26 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({ 'process/browser': require.resolve('process/browser'), }, }, + optimization: { + runtimeChunk: 'single', + splitChunks: { + cacheGroups: { + // Extract all 3rd party dependencies (~75% of App) to separate js file + // This gives a more efficient caching - 3rd party deps don't change as often as main source + // When dependencies don't change webpack would produce the same js file (and content hash) + // After App update end users would download just the main source and resolve the rest from cache + // When dependencies do change cache is invalidated and users download everything - same as before + vendor: { + test: /[\\/]node_modules[\\/]/, + name: 'vendors', + + // Capture only the scripts needed for the initial load, so any async imports + // would be grouped (and lazy loaded) separately + chunks: 'initial', + }, + }, + }, + }, }); module.exports = webpackConfig; From efd0738eed9d3af43f5fda2df9f5b0ed3322d900 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Thu, 1 Dec 2022 10:15:35 -0700 Subject: [PATCH 133/185] Center the form better and fix iphone SE --- .../SignInPageLayout/SignInPageContent.js | 54 ++++++++++--------- src/styles/styles.js | 18 ++++--- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/SignInPageContent.js b/src/pages/signin/SignInPageLayout/SignInPageContent.js index ee5c858eae84..1206a0f01823 100755 --- a/src/pages/signin/SignInPageLayout/SignInPageContent.js +++ b/src/pages/signin/SignInPageLayout/SignInPageContent.js @@ -43,34 +43,38 @@ const SignInPageContent = (props) => { style={[ styles.flex1, styles.signInPageLeftContainer, - styles.signInPageLeftContainerMediumScreen, + !props.isSmallScreenWidth && styles.signInPageLeftContainerWide, ]} > - {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} - + + {/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */} + - - - - - - {props.shouldShowWelcomeText && ( - - {props.welcomeText} - - )} - {props.children} - - - - + + + + + + {props.shouldShowWelcomeText && ( + + + {props.welcomeText} + + + )} + {props.children} + + + + + diff --git a/src/styles/styles.js b/src/styles/styles.js index 0c34ff1eb69c..3ceb69b8acb7 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -905,17 +905,23 @@ const styles = { minHeight: 24, }, - signInPageLeftContainerMediumScreen: { - maxWidth: 400, - marginLeft: 'auto', - marginRight: 'auto', - }, - signInPageLeftContainer: { paddingLeft: 40, paddingRight: 40, }, + signInPageLeftContainerWide: { + maxWidth: 375, + }, + + signInPageWelcomeFormContainer: { + maxWidth: 400, + }, + + signInPageWelcomeTextContainer: { + width: 300, + }, + changeExpensifyLoginLinkContainer: { flexDirection: 'row', flexWrap: 'wrap', From 7208991eb65c619870ca7ce2a60522a4ab604ff2 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Thu, 1 Dec 2022 10:21:18 -0700 Subject: [PATCH 134/185] Always keep the form the same width --- src/styles/styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 3ceb69b8acb7..eb733fad72d5 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -911,11 +911,11 @@ const styles = { }, signInPageLeftContainerWide: { - maxWidth: 375, + maxWidth: 360, }, signInPageWelcomeFormContainer: { - maxWidth: 400, + maxWidth: 300, }, signInPageWelcomeTextContainer: { From 5dd2d95c9f97613c840dc2a9e29ae4ffe125434e Mon Sep 17 00:00:00 2001 From: Huzaifa Rasheed Date: Thu, 1 Dec 2022 23:31:21 +0500 Subject: [PATCH 135/185] blur login page input only when transitioned to magic link page --- src/pages/signin/SignInPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index 574e96e6cac1..60788b07210c 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -83,7 +83,7 @@ class SignInPage extends Component { > {/* LoginForm and PasswordForm must use the isVisible prop. This keeps them mounted, but visually hidden so that password managers can access the values. Conditionally rendering these components will break this feature. */} - + {shouldShowResendValidationLinkForm && } From 83c9322b354d32dc08810771aa06fa2e6a18a278 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Thu, 1 Dec 2022 20:52:36 +0100 Subject: [PATCH 136/185] Updated react-native-image-picker to 4.10.2 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70c9e462d442..29cd4ab8f291 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,7 +65,7 @@ "react-native-google-places-autocomplete": "git+https://github.com/Expensify/react-native-google-places-autocomplete.git#3bbd17d63e6c38d38d857b50f6037c1c0376ff06", "react-native-haptic-feedback": "^1.13.0", "react-native-image-pan-zoom": "^2.1.12", - "react-native-image-picker": "^4.10.1", + "react-native-image-picker": "^4.10.2", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", "react-native-onyx": "1.0.29", @@ -35419,9 +35419,9 @@ } }, "node_modules/react-native-image-picker": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.1.tgz", - "integrity": "sha512-tPA9UtboEsZ8qtm7pX9WInlo9sf0J2ArJgP4uVgKw1QNrwkRX/kZQ6uzOSN747Dhj9WS42ce4RN+rFK86J13DQ==", + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.2.tgz", + "integrity": "sha512-3h9PrA1dQ84rVeipzQE4eWTELvflSHNtJZN6rz7NkZyaxo9YZV8H/TswBpHwiS5YWlyu+zlLzSoWVa1opSu7GA==", "peerDependencies": { "react": "*", "react-native": "*" @@ -69780,9 +69780,9 @@ "requires": {} }, "react-native-image-picker": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.1.tgz", - "integrity": "sha512-tPA9UtboEsZ8qtm7pX9WInlo9sf0J2ArJgP4uVgKw1QNrwkRX/kZQ6uzOSN747Dhj9WS42ce4RN+rFK86J13DQ==", + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/react-native-image-picker/-/react-native-image-picker-4.10.2.tgz", + "integrity": "sha512-3h9PrA1dQ84rVeipzQE4eWTELvflSHNtJZN6rz7NkZyaxo9YZV8H/TswBpHwiS5YWlyu+zlLzSoWVa1opSu7GA==", "requires": {} }, "react-native-image-size": { diff --git a/package.json b/package.json index 849ee69d722d..ef14c28a0951 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "react-native-google-places-autocomplete": "git+https://github.com/Expensify/react-native-google-places-autocomplete.git#3bbd17d63e6c38d38d857b50f6037c1c0376ff06", "react-native-haptic-feedback": "^1.13.0", "react-native-image-pan-zoom": "^2.1.12", - "react-native-image-picker": "^4.10.1", + "react-native-image-picker": "^4.10.2", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", "react-native-onyx": "1.0.29", From 2c4b9c9287dee45b54dd5ea94aefc01a15186ca3 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Thu, 1 Dec 2022 15:25:10 -0500 Subject: [PATCH 137/185] set context menu active immediately so message stays highlighted --- src/pages/home/report/ReportActionItem.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 5223f50b1637..d751c6ea4add 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -112,6 +112,8 @@ class ReportActionItem extends Component { if (this.props.draftMessage) { return; } + + this.setState({isContextMenuActive: true}); const selection = SelectionScraper.getCurrentSelection(); ReportActionContextMenu.showContextMenu( ContextMenuActions.CONTEXT_MENU_TYPES.REPORT_ACTION, @@ -121,7 +123,7 @@ class ReportActionItem extends Component { this.props.report.reportID, this.props.action, this.props.draftMessage, - this.checkIfContextMenuActive, + undefined, this.checkIfContextMenuActive, ); } From 6d9c8e821d9ba8a93790a2e4d59e76f1d8322c3f Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Fri, 2 Dec 2022 10:49:36 -0700 Subject: [PATCH 138/185] Correct the logic for when bill split particpants can be selected --- src/components/IOUConfirmationList.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 4f4eb415ed4b..36cfa27f644e 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -275,7 +275,11 @@ class IOUConfirmationList extends Component { const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND; const shouldDisableButton = selectedParticipants.length === 0; const recipient = this.state.participants[0]; - const canModifyParticipants = !this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; + + // The participants can only be modified when: + // 1. The action is initiated from directly within a group chat and not the floating-action-button (eg. this.props.isIOUAttachedToExistingChatReport === true) + // 2. There are multiple participants (eg. this.props.hasMultipleParticipants === true) + const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; return ( Date: Fri, 2 Dec 2022 10:49:36 -0700 Subject: [PATCH 139/185] Correct the logic for when bill split particpants can be selected --- src/components/IOUConfirmationList.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 4f4eb415ed4b..06e8b132c943 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -275,7 +275,13 @@ class IOUConfirmationList extends Component { const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND; const shouldDisableButton = selectedParticipants.length === 0; const recipient = this.state.participants[0]; - const canModifyParticipants = !this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; + + // The participants can only be modified when: + // 1. The action is initiated from directly within a group chat and not the floating-action-button (eg. this.props.isIOUAttachedToExistingChatReport === true). This is because when + // there is a group of people, say they are on a trip, and you have some shared expenses with some of the people, but not all of them (maybe someone skipped out on dinner). Then + // it's nice to be able to select/deselect people from the group chat bill split rather than forcing the user to create a new group, just for that expense. + // 2. There are multiple participants (eg. this.props.hasMultipleParticipants === true). This is because splitting a bill with one person isn't a thing :D + const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; return ( Date: Fri, 2 Dec 2022 10:54:17 -0700 Subject: [PATCH 140/185] Add more context to the comment in props --- src/components/IOUConfirmationList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 06e8b132c943..67bb596f3449 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -57,7 +57,8 @@ const propTypes = { phoneNumber: PropTypes.string, })).isRequired, - /** Is this IOU associated with existing report */ + /** Is this IOU associated with existing report. This is true when the action is initiated from inside a group chat and it's false when the action is initiated from the + * floating-action-button */ isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, ...windowDimensionsPropTypes, From df5905f0e92fa9e93708ae2fc5bb7eccfee1dbde Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 2 Dec 2022 13:04:53 -0700 Subject: [PATCH 141/185] Apply peer review --- .../composite/configureAwsCredentials/action.yml | 6 +++++- .github/workflows/preDeploy.yml | 14 +++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/actions/composite/configureAwsCredentials/action.yml b/.github/actions/composite/configureAwsCredentials/action.yml index aec147b8cc77..f092478962c8 100644 --- a/.github/actions/composite/configureAwsCredentials/action.yml +++ b/.github/actions/composite/configureAwsCredentials/action.yml @@ -8,6 +8,10 @@ inputs: AWS_SECRET_ACCESS_KEY: description: 'Secret Access Key to AWS' required: true + AWS_REGION: + description: 'Region for AWS' + required: true + default: 'us-east-1' runs: using: composite @@ -18,4 +22,4 @@ runs: with: aws-access-key-id: ${{ inputs.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ inputs.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + aws-region: ${{ inputs.AWS_REGION }} diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index a28565cb5043..62117c5b676a 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -239,7 +239,7 @@ jobs: # Cache gradle to improve Android build time - name: Gradle cache - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef - name: Make zip directory for everything to send to AWS Device Farm run: mkdir zip @@ -271,15 +271,15 @@ jobs: - name: Zip everything in the zip directory up run: zip -qr App.zip ./zip - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + - name: Configure AWS Credentials + uses: Expensify/App/.github/actions/composite/configureAwsCredentials@main with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: us-west-2 - name: Schedule AWS Device Farm test run - uses: realm/aws-devicefarm/test-application@master + uses: realm/aws-devicefarm/test-application@7b9a91236c456c97e28d384c9e476035d5ea686b with: name: App E2E Performance Regression Tests project_arn: ${{ secrets.AWS_PROJECT_ARN }} From 9f630d7402454246e4564308462cef49299e6ef6 Mon Sep 17 00:00:00 2001 From: Puneet Date: Sat, 3 Dec 2022 02:07:32 +0530 Subject: [PATCH 142/185] make emoji button hover background round --- src/styles/styles.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 382804ac0e08..094300374939 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1503,9 +1503,10 @@ const styles = { chatItemEmojiButton: { alignSelf: 'flex-end', - borderRadius: 6, + borderRadius: variables.buttonBorderRadius, height: 32, - margin: 3, + marginVertical: 3, + paddingHorizontal: 6, justifyContent: 'center', }, From 8771b4dae9759b9376b7da9835c35bebdab15f12 Mon Sep 17 00:00:00 2001 From: neil-marcellini Date: Fri, 2 Dec 2022 12:57:55 -0800 Subject: [PATCH 143/185] Only add the pusher suffix when using the dev api --- scripts/set-pusher-suffix.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/set-pusher-suffix.sh b/scripts/set-pusher-suffix.sh index 4f59e3f87cb6..c7a4fc03595f 100755 --- a/scripts/set-pusher-suffix.sh +++ b/scripts/set-pusher-suffix.sh @@ -4,8 +4,17 @@ # config file to be parsed for the suffix (relative to current project root) CONFIG_FILE="../Web-Expensify/_config.local.php" +# Export vars from the .env file +export $(grep -v '^#' .env | xargs) + # use the suffix only when the config file can be found if [ -f "$CONFIG_FILE" ]; then + # If we are pointing to the staging or production api don't add the suffix + if [[ $EXPENSIFY_URL == "https://www.expensify.com/" ]]; then + echo "Ignoring the PUSHER_DEV_SUFFIX since we are not pointing to the dev API" + exit 0 + fi + echo "Using PUSHER_DEV_SUFFIX from $CONFIG_FILE" PATTERN="PUSHER_DEV_SUFFIX.*'(.+)'" From c846829d89b4b629d5387153ce56d417250070b0 Mon Sep 17 00:00:00 2001 From: neil-marcellini Date: Fri, 2 Dec 2022 13:03:32 -0800 Subject: [PATCH 144/185] Export vars from the .env file only if it exists --- scripts/set-pusher-suffix.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/set-pusher-suffix.sh b/scripts/set-pusher-suffix.sh index c7a4fc03595f..673d61c59d4b 100755 --- a/scripts/set-pusher-suffix.sh +++ b/scripts/set-pusher-suffix.sh @@ -4,8 +4,10 @@ # config file to be parsed for the suffix (relative to current project root) CONFIG_FILE="../Web-Expensify/_config.local.php" -# Export vars from the .env file -export $(grep -v '^#' .env | xargs) +if [ -f ".env" ]; then + # Export vars from the .env file to access the $EXPENSIFY_URL + export $(grep -v '^#' .env | xargs) +fi # use the suffix only when the config file can be found if [ -f "$CONFIG_FILE" ]; then From d9f5666eee766e5cbd7a96b1f2e7f6e4a73ebed5 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Fri, 2 Dec 2022 16:30:18 -0500 Subject: [PATCH 145/185] Address comments from original PR --- src/components/Picker/index.js | 32 ++++++++++++++------------------ src/styles/variables.js | 1 + 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/components/Picker/index.js b/src/components/Picker/index.js index 3aaab0e0188b..28bfea282ddd 100644 --- a/src/components/Picker/index.js +++ b/src/components/Picker/index.js @@ -9,6 +9,7 @@ import FormHelpMessage from '../FormHelpMessage'; import Text from '../Text'; import CONST from '../../CONST'; import styles from '../../styles/styles'; +import variables from '../../styles/variables'; import pickerStyles from './pickerStyles'; import getOperatingSystem from '../../libs/getOperatingSystem'; @@ -104,28 +105,23 @@ class Picker extends PureComponent { }; this.onInputChange = this.onInputChange.bind(this); - this.placeholder = this.props.placeholder; - this.items = this.props.items; + + // Windows will reuse the text color of the select for each one of the options + // so we might need to color accordingly so it doesn't blend with the background. + this.placeholder = _.isEmpty(this.placeholder) ? {} : { + ...this.props.placeholder, + color: variables.pickerOptionsTextColor, + }; + this.items = _.map(this.items, item => ( + { + ...item, + color: variables.pickerOptionsTextColor, + } + )); } componentDidMount() { this.setDefaultValue(); - - // Windows will reuse the text color of the select for each one of the options - // so we might need to color accordingly so it doesn't blend with the background. - if (getOperatingSystem() === CONST.OS.WINDOWS) { - this.placeholder = _.isEmpty(this.placeholder) ? {} : { - ...this.placeholder, - color: '#002140', - }; - - this.items = _.map(this.items, item => ( - { - ...item, - color: '#002140', - } - )); - } } componentDidUpdate(prevProps) { diff --git a/src/styles/variables.js b/src/styles/variables.js index 4cf4740749c7..ba72ff3ff77e 100644 --- a/src/styles/variables.js +++ b/src/styles/variables.js @@ -81,4 +81,5 @@ export default { INACTIVE_LABEL_TRANSLATE_Y: getValueUsingPixelRatio(16, 21), sliderBarHeight: 8, sliderKnobSize: 26, + pickerOptionsTextColor: '#002140', }; From ebfdc1eb24c13c10d06b400c8b033c88aa84294c Mon Sep 17 00:00:00 2001 From: Puneet Date: Sat, 3 Dec 2022 04:21:02 +0530 Subject: [PATCH 146/185] make emoji button centered --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 094300374939..8bee752a5cd6 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1505,7 +1505,7 @@ const styles = { alignSelf: 'flex-end', borderRadius: variables.buttonBorderRadius, height: 32, - marginVertical: 3, + marginVertical: 4, paddingHorizontal: 6, justifyContent: 'center', }, From f40212841cbf05d5385443ad0cf44743c7c0e644 Mon Sep 17 00:00:00 2001 From: Luke Donahue Date: Fri, 2 Dec 2022 15:01:33 -0800 Subject: [PATCH 147/185] changed border style --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index f492b7cf0b19..9ebf61b65873 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -611,7 +611,7 @@ const styles = { border: { borderWidth: 1, - borderRadius: variables.buttonBorderRadius, + borderRadius: variables.componentBorderRadius, borderColor: themeColors.border, }, From 952b1ff3430ddb3979fda4e14f5c333bc5a458e1 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Fri, 2 Dec 2022 18:57:16 -0500 Subject: [PATCH 148/185] Watch the drawer is ready before loading the navigation --- src/libs/actions/App.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 1faeae4bb97a..850f30c4d03e 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -211,19 +211,10 @@ function setUpPoliciesAndNavigate(session) { return; } if (!isLoggingInAsNewUser && exitTo) { - if (Navigation.isDrawerRoute(exitTo)) { - // The drawer navigation is only created after we have fetched reports from the server. - // Thus, if we use the standard navigation and try to navigate to a drawer route before - // the reports have been fetched, we will fail to navigate. - Navigation.isDrawerReady() - .then(() => { - // We must call dismissModal() to remove the /transition route from history - Navigation.dismissModal(); - Navigation.navigate(exitTo); - }); - return; - } - Navigation.isNavigationReady() + // The drawer navigation is only created after we have fetched reports from the server. + // Thus, if we use the standard navigation and try to navigate to a drawer route before + // the reports have been fetched, we will fail to navigate. + Navigation.isDrawerReady() .then(() => { // We must call dismissModal() to remove the /transition route from history Navigation.dismissModal(); From d6d049dd23f7df78f6bedd2b2c064b184f29a895 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 5 Dec 2022 11:46:51 +0100 Subject: [PATCH 149/185] fix comment --- .github/workflows/testBuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index 839df9e758b4..e2af94a00472 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -193,7 +193,7 @@ jobs: ":test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube: | android :robot: | iOS :apple: | desktop :computer: | | ------------- | ------------- | ------------- | - | ${{fromJson(steps.set_var.outputs.android_paths).html_path}} | ${{fromJson(steps.set_var.outputs.ios_paths).html_path}} | https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/${{github.event.number}}/NewExpensify.dmg - | ![Android](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.android_paths).html_path}}) | ![iOS](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.ios_paths).html_path}}) | ![desktop](https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/${{github.event.number}}/NewExpensify.dmg)" + | ${{fromJson(steps.set_var.outputs.android_paths).html_path}} | ${{fromJson(steps.set_var.outputs.ios_paths).html_path}} | https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/${{github.event.number}}/NewExpensify.dmg | + | ![Android](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.android_paths).html_path}}) | ![iOS](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.ios_paths).html_path}}) | ![desktop](https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/${{github.event.number}}/NewExpensify.dmg) |" env: GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} From ae22db568c6fed21e71e0915442d15414d6132cf Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 5 Dec 2022 11:51:38 +0100 Subject: [PATCH 150/185] throw on invalid ELECTRON_ENV --- config/electronBuilder.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js index db642e00008e..a23d942167ec 100644 --- a/config/electronBuilder.config.js +++ b/config/electronBuilder.config.js @@ -23,6 +23,14 @@ const macIcon = { internal: './desktop/icon-stg.png', }; +const isCorrectElectronEnv = ['production', 'staging', 'internal'].includes( + process.env.ELECTRON_ENV, +); + +if (!isCorrectElectronEnv) { + throw new Error('Invalid ELECTRON_ENV!'); +} + /** * The configuration for the production and staging Electron builds. * It can be used to create local builds of the same, by omitting the `--publish` flag From 0e3048e7cc433dd50216ca380ae0ede41d6b00d1 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 5 Dec 2022 13:31:13 +0000 Subject: [PATCH 151/185] Update comment --- src/libs/shouldUseStagingServer/index.native.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/shouldUseStagingServer/index.native.js b/src/libs/shouldUseStagingServer/index.native.js index 533aef10a90d..92baff89c835 100644 --- a/src/libs/shouldUseStagingServer/index.native.js +++ b/src/libs/shouldUseStagingServer/index.native.js @@ -1,6 +1,10 @@ import * as Environment from '../Environment/Environment'; -/* +/** + * Helper method used to decide which API endpoint to call in the Native apps. + * We build the staging native apps with production env config so we cannot rely on those values, + * hence we will decide solely on the value of the shouldUseStagingServer value (always false in production). + * * @param {Boolean} stagingServerToggleState * @returns {Boolean} */ From 56e5c32594e328596cd29d6358a93b273378faf8 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 5 Dec 2022 14:11:36 +0000 Subject: [PATCH 152/185] Default to staging on web and dektop --- src/libs/HttpUtils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index 519ad04ad42f..c7b0066ee556 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -5,11 +5,15 @@ import CONFIG from '../CONFIG'; import CONST from '../CONST'; import ONYXKEYS from '../ONYXKEYS'; import HttpsError from './Errors/HttpsError'; +import shouldUseStagingServer from './shouldUseStagingServer'; +import getPlatform from './getPlatform'; -let shouldUseStagingServer = false; +// Desktop and web use staging config too so we we should default to staging API endpoint if on those platforms +const canDefaultToStaging = _.contains([CONST.PLATFORM.WEB, CONST.PLATFORM.DESKTOP], getPlatform()); +let stagingServerToggleState = false; Onyx.connect({ key: ONYXKEYS.USER, - callback: val => shouldUseStagingServer = lodashGet(val, 'shouldUseStagingServer', false), + callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', canDefaultToStaging), }); let shouldFailAllRequests = false; @@ -105,7 +109,7 @@ function xhr(command, data, type = CONST.NETWORK.METHOD.POST, shouldUseSecure = let apiRoot = shouldUseSecure ? CONFIG.EXPENSIFY.SECURE_EXPENSIFY_URL : CONFIG.EXPENSIFY.URL_API_ROOT; - if (CONFIG.IS_IN_STAGING && shouldUseStagingServer) { + if (shouldUseStagingServer(stagingServerToggleState)) { apiRoot = shouldUseSecure ? CONFIG.EXPENSIFY.STAGING_SECURE_EXPENSIFY_URL : CONFIG.EXPENSIFY.STAGING_EXPENSIFY_URL; } From 18ae34f5b833f8561bed2bcf9f002eba4d6dafe5 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 5 Dec 2022 07:57:55 -0700 Subject: [PATCH 153/185] Move comment and rename prop --- src/components/IOUConfirmationList.js | 14 ++++---------- src/pages/iou/IOUModal.js | 8 +++++++- src/pages/iou/steps/IOUConfirmPage.js | 7 ++++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 67bb596f3449..7e2de32e502d 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -57,9 +57,8 @@ const propTypes = { phoneNumber: PropTypes.string, })).isRequired, - /** Is this IOU associated with existing report. This is true when the action is initiated from inside a group chat and it's false when the action is initiated from the - * floating-action-button */ - isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, + /** Can the participants be modified or not */ + canModifyParticipants: PropTypes.bool, ...windowDimensionsPropTypes, @@ -92,6 +91,7 @@ const defaultProps = { onUpdateComment: null, comment: '', iouType: CONST.IOU.IOU_TYPE.REQUEST, + canModifyParticipants: false, ...withCurrentUserPersonalDetailsDefaultProps, }; @@ -276,13 +276,7 @@ class IOUConfirmationList extends Component { const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND; const shouldDisableButton = selectedParticipants.length === 0; const recipient = this.state.participants[0]; - - // The participants can only be modified when: - // 1. The action is initiated from directly within a group chat and not the floating-action-button (eg. this.props.isIOUAttachedToExistingChatReport === true). This is because when - // there is a group of people, say they are on a trip, and you have some shared expenses with some of the people, but not all of them (maybe someone skipped out on dinner). Then - // it's nice to be able to select/deselect people from the group chat bill split rather than forcing the user to create a new group, just for that expense. - // 2. There are multiple participants (eg. this.props.hasMultipleParticipants === true). This is because splitting a bill with one person isn't a thing :D - const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; + const canModifyParticipants = this.props.canModifyParticipants && this.props.hasMultipleParticipants; return ( )} diff --git a/src/pages/iou/steps/IOUConfirmPage.js b/src/pages/iou/steps/IOUConfirmPage.js index c14626399f2c..7f69fc7ef9a1 100644 --- a/src/pages/iou/steps/IOUConfirmPage.js +++ b/src/pages/iou/steps/IOUConfirmPage.js @@ -43,14 +43,15 @@ const propTypes = { /** IOU type */ iouType: PropTypes.string, - /** Is this IOU associated with existing report */ - isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, + /** Can the participants be modified or not */ + canModifyParticipants: PropTypes.bool, }; const defaultProps = { onUpdateComment: null, comment: '', iouType: CONST.IOU.IOU_TYPE.REQUEST, + canModifyParticipants: false, }; const IOUConfirmPage = props => ( @@ -63,7 +64,7 @@ const IOUConfirmPage = props => ( onConfirm={props.onConfirm} onSendMoney={props.onSendMoney} iouType={props.iouType} - isIOUAttachedToExistingChatReport={props.isIOUAttachedToExistingChatReport} + canModifyParticipants={props.canModifyParticipants} /> ); From 8aeeb5a30b0eacfa271fec934de57eb37cabc469 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 5 Dec 2022 14:59:08 +0000 Subject: [PATCH 154/185] Use the correct default for staging server toggle --- src/components/TestToolMenu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/TestToolMenu.js b/src/components/TestToolMenu.js index 8bbaae557570..226c5a9897ce 100644 --- a/src/components/TestToolMenu.js +++ b/src/components/TestToolMenu.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import _ from 'underscore'; import {withOnyx} from 'react-native-onyx'; import lodashGet from 'lodash/get'; import styles from '../styles/styles'; @@ -14,6 +15,8 @@ import TestToolRow from './TestToolRow'; import networkPropTypes from './networkPropTypes'; import compose from '../libs/compose'; import {withNetwork} from './OnyxProvider'; +import getPlatform from '../libs/getPlatform'; +import CONST from '../CONST'; const propTypes = { /** User object in Onyx */ @@ -42,7 +45,7 @@ const TestToolMenu = props => ( This enables QA and internal testers to take advantage of sandbox environments for 3rd party services like Plaid and Onfido. */} User.setShouldUseStagingServer(!lodashGet(props, 'user.shouldUseStagingServer', true))} /> From 7c53f31913c0b6369852f9dcca9aab6e88a6fedf Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 5 Dec 2022 15:17:53 +0000 Subject: [PATCH 155/185] Rename variable --- src/libs/HttpUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/HttpUtils.js b/src/libs/HttpUtils.js index c7b0066ee556..5fedc22f4d56 100644 --- a/src/libs/HttpUtils.js +++ b/src/libs/HttpUtils.js @@ -9,11 +9,11 @@ import shouldUseStagingServer from './shouldUseStagingServer'; import getPlatform from './getPlatform'; // Desktop and web use staging config too so we we should default to staging API endpoint if on those platforms -const canDefaultToStaging = _.contains([CONST.PLATFORM.WEB, CONST.PLATFORM.DESKTOP], getPlatform()); +const shouldDefaultToStaging = _.contains([CONST.PLATFORM.WEB, CONST.PLATFORM.DESKTOP], getPlatform()); let stagingServerToggleState = false; Onyx.connect({ key: ONYXKEYS.USER, - callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', canDefaultToStaging), + callback: val => stagingServerToggleState = lodashGet(val, 'shouldUseStagingServer', shouldDefaultToStaging), }); let shouldFailAllRequests = false; From df72dc2fd315adf551e78fcc5841c094d8c05aa4 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Mon, 5 Dec 2022 17:05:49 +0000 Subject: [PATCH 156/185] let's start with this change, and see if it needs anymore --- web/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/index.html b/web/index.html index 4c173ababa7c..ece594d76713 100644 --- a/web/index.html +++ b/web/index.html @@ -34,11 +34,11 @@ } :focus-visible { outline: 0; - box-shadow: inset 0px 0px 0px 1px #0185ff; + box-shadow: inset 0px 0px 0px 1px #5AB0FF; } :focus[data-focusvisible-polyfill] { outline: 0; - box-shadow: inset 0px 0px 0px 1px #0185ff; + box-shadow: inset 0px 0px 0px 1px #5AB0FF; } input:focus-visible, input:focus[data-focusvisible-polyfill], select:focus-visible, select:focus[data-focusvisible-polyfill] { From 18490e516d3c5aa69bc6c7d00b1b81132072d3e2 Mon Sep 17 00:00:00 2001 From: Srikar Parsi Date: Mon, 5 Dec 2022 12:55:19 -0500 Subject: [PATCH 157/185] change display name color to gray --- src/components/DisplayNames/index.js | 2 +- src/styles/styles.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DisplayNames/index.js b/src/components/DisplayNames/index.js index 07e71e25a44f..060a49d73d28 100644 --- a/src/components/DisplayNames/index.js +++ b/src/components/DisplayNames/index.js @@ -100,7 +100,7 @@ class DisplayNames extends PureComponent { > {/* // We need to get the refs to all the names which will be used to correct the horizontal position of the tooltip */} - this.childRefs[index] = el}> + this.childRefs[index] = el} style={[...this.props.textStyles, styles.pRelative]}> {displayName} diff --git a/src/styles/styles.js b/src/styles/styles.js index ef429a66b8d8..92e1838a5d06 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1123,7 +1123,7 @@ const styles = { }, sidebarLinkText: { - color: themeColors.text, + color: themeColors.textSupporting, fontSize: variables.fontSizeNormal, textDecorationLine: 'none', overflow: 'hidden', @@ -1144,7 +1144,7 @@ const styles = { }, sidebarLinkActiveText: { - color: themeColors.text, + color: themeColors.textSupporting, fontSize: variables.fontSizeNormal, textDecorationLine: 'none', overflow: 'hidden', From db8de3e161c9771206d471795e878430fe733395 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 5 Dec 2022 19:24:55 +0000 Subject: [PATCH 158/185] Update version to 1.2.36-2 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 62303fef6a80..1e0938a288fe 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001023601 - versionName "1.2.36-1" + versionCode 1001023602 + versionName "1.2.36-2" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index ba2aefa9279f..dd5b332dffc5 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.36.1 + 1.2.36.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 1fb5af250556..55d7bc5bbc2e 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.36.1 + 1.2.36.2 diff --git a/package-lock.json b/package-lock.json index 9c3cafee7368..eba4fce4a2e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.36-1", + "version": "1.2.36-2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.36-1", + "version": "1.2.36-2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 368118f97925..42330cec607b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.36-1", + "version": "1.2.36-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From cc072f75eb722382d8d7f3412ecd5b529bcb3958 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Mon, 5 Dec 2022 15:02:52 -0500 Subject: [PATCH 159/185] Remove unused imports --- src/components/Picker/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/Picker/index.js b/src/components/Picker/index.js index 28bfea282ddd..b707fac06dc8 100644 --- a/src/components/Picker/index.js +++ b/src/components/Picker/index.js @@ -7,11 +7,9 @@ import Icon from '../Icon'; import * as Expensicons from '../Icon/Expensicons'; import FormHelpMessage from '../FormHelpMessage'; import Text from '../Text'; -import CONST from '../../CONST'; import styles from '../../styles/styles'; import variables from '../../styles/variables'; import pickerStyles from './pickerStyles'; -import getOperatingSystem from '../../libs/getOperatingSystem'; const propTypes = { /** Picker label */ From 3024576d39933707cafdae1a97ca356f7fd74a02 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Mon, 5 Dec 2022 15:17:00 -0500 Subject: [PATCH 160/185] Fix after testing --- src/components/Picker/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Picker/index.js b/src/components/Picker/index.js index b707fac06dc8..e49abef260c2 100644 --- a/src/components/Picker/index.js +++ b/src/components/Picker/index.js @@ -106,11 +106,11 @@ class Picker extends PureComponent { // Windows will reuse the text color of the select for each one of the options // so we might need to color accordingly so it doesn't blend with the background. - this.placeholder = _.isEmpty(this.placeholder) ? {} : { + this.placeholder = _.isEmpty(this.props.placeholder) ? {} : { ...this.props.placeholder, color: variables.pickerOptionsTextColor, }; - this.items = _.map(this.items, item => ( + this.items = _.map(this.props.items, item => ( { ...item, color: variables.pickerOptionsTextColor, From 547772762e3a2e125eda4f90217c731d32742ef4 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Mon, 5 Dec 2022 16:41:04 -0500 Subject: [PATCH 161/185] Try new approach --- src/libs/actions/App.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 850f30c4d03e..2b0c1e278415 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -215,11 +215,14 @@ function setUpPoliciesAndNavigate(session) { // Thus, if we use the standard navigation and try to navigate to a drawer route before // the reports have been fetched, we will fail to navigate. Navigation.isDrawerReady() + .then(() => { + Navigation.isDrawerReady() .then(() => { // We must call dismissModal() to remove the /transition route from history Navigation.dismissModal(); Navigation.navigate(exitTo); }); + }); } } From f48adf5a059bd5a9c0ed231d35e41a2a2cebdad4 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Mon, 5 Dec 2022 16:58:42 -0500 Subject: [PATCH 162/185] Style --- src/libs/actions/App.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 2b0c1e278415..6f8ec7895f3b 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -215,14 +215,14 @@ function setUpPoliciesAndNavigate(session) { // Thus, if we use the standard navigation and try to navigate to a drawer route before // the reports have been fetched, we will fail to navigate. Navigation.isDrawerReady() - .then(() => { - Navigation.isDrawerReady() .then(() => { - // We must call dismissModal() to remove the /transition route from history - Navigation.dismissModal(); - Navigation.navigate(exitTo); + Navigation.isDrawerReady() + .then(() => { + // We must call dismissModal() to remove the /transition route from history + Navigation.dismissModal(); + Navigation.navigate(exitTo); + }); }); - }); } } From 58ff44ff5627aadec9f37b5d7610032446dda2e3 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 15:03:45 -0700 Subject: [PATCH 163/185] fix prop type --- src/pages/settings/Payments/AddDebitCardPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Payments/AddDebitCardPage.js b/src/pages/settings/Payments/AddDebitCardPage.js index 6de7b44bf259..dd5f394163c3 100644 --- a/src/pages/settings/Payments/AddDebitCardPage.js +++ b/src/pages/settings/Payments/AddDebitCardPage.js @@ -25,7 +25,7 @@ import Form from '../../../components/Form'; const propTypes = { /* Onyx Props */ formData: PropTypes.shape({ - setupComplete: PropTypes.boolean, + setupComplete: PropTypes.bool, }), ...withLocalizePropTypes, From 3797879628c25b398a3ce8623f2a97d0f3788872 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 15:09:18 -0700 Subject: [PATCH 164/185] fix children key --- src/components/Form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Form.js b/src/components/Form.js index dfdfc24a7eae..b287403eacc2 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -265,6 +265,7 @@ class Form extends React.Component { {_.map(this.childrenWrapperWithProps(this.props.children), child => ( { this.setPosition(child, event.nativeEvent.layout.y); }} From 1b35f937d09a3236921dc4f05ff85c669e5ad859 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 15:55:14 -0700 Subject: [PATCH 165/185] fix key --- src/components/Form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Form.js b/src/components/Form.js index b287403eacc2..b450cecebe01 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -265,7 +265,7 @@ class Form extends React.Component { {_.map(this.childrenWrapperWithProps(this.props.children), child => ( { this.setPosition(child, event.nativeEvent.layout.y); }} From c6be1233fa8358f14af264002d5f7dfca33970e0 Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Mon, 5 Dec 2022 17:58:06 -0500 Subject: [PATCH 166/185] Copy/paste mistake --- src/libs/actions/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 6f8ec7895f3b..b2118d58cdf8 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -214,7 +214,7 @@ function setUpPoliciesAndNavigate(session) { // The drawer navigation is only created after we have fetched reports from the server. // Thus, if we use the standard navigation and try to navigate to a drawer route before // the reports have been fetched, we will fail to navigate. - Navigation.isDrawerReady() + Navigation.isNavigationReady() .then(() => { Navigation.isDrawerReady() .then(() => { From c814071a8ae085ee210ba47abc8057d9203369df Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 16:11:59 -0700 Subject: [PATCH 167/185] add accessibility role --- src/components/Form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Form.js b/src/components/Form.js index b450cecebe01..1ffee99ea505 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -261,6 +261,7 @@ class Form extends React.Component { contentContainerStyle={styles.flexGrow1} keyboardShouldPersistTaps="handled" ref={el => this.form = el} + accessibilityRole="form" > {_.map(this.childrenWrapperWithProps(this.props.children), child => ( From 7b01db648c4ff983efec2bea09f5d8ff50eeb241 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 16:19:30 -0700 Subject: [PATCH 168/185] rm accessibility role --- src/components/Form.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Form.js b/src/components/Form.js index 1ffee99ea505..b450cecebe01 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -261,7 +261,6 @@ class Form extends React.Component { contentContainerStyle={styles.flexGrow1} keyboardShouldPersistTaps="handled" ref={el => this.form = el} - accessibilityRole="form" > {_.map(this.childrenWrapperWithProps(this.props.children), child => ( From d2cd488cb0901e98d256ea6d911953bf6d838c86 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 16:44:24 -0700 Subject: [PATCH 169/185] fix console error --- src/components/Form.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Form.js b/src/components/Form.js index dfdfc24a7eae..d6a52f151f10 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -110,6 +110,10 @@ class Form extends React.Component { } setPosition(element, position) { + if (!element.props) { + return; + } + if (!element.props.inputID && element.props.children) { _.forEach(element.props.children, (child) => { this.setPosition(child, position); From 3d09435b1a618742bfa0a56939899f74d5d22b71 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 5 Dec 2022 16:57:29 -0700 Subject: [PATCH 170/185] add comment --- src/components/Form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Form.js b/src/components/Form.js index d6a52f151f10..7042e296cd5e 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -110,6 +110,7 @@ class Form extends React.Component { } setPosition(element, position) { + // Some elements might not have props defined, e.g. Text if (!element.props) { return; } From aeb41e700ebb7a4e6c7046a3a15d38e3eb672523 Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 12:46:41 +0000 Subject: [PATCH 171/185] [TEST] just for QA https://github.com/Expensify/Web-Expensify/pull/35675 --- contributingGuides/test.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 contributingGuides/test.md diff --git a/contributingGuides/test.md b/contributingGuides/test.md new file mode 100644 index 000000000000..408d46bf35e7 --- /dev/null +++ b/contributingGuides/test.md @@ -0,0 +1 @@ +Just for QA From f76c740c4e9d9b297092d82c5544abeebdbaffa6 Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 12:58:38 +0000 Subject: [PATCH 172/185] QA for https://github.com/Expensify/Web-Expensify/pull/35675 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index 408d46bf35e7..8f87422ec1b9 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA +Just for QA2 From a7fa5ae1aeabd9fda524e06eb249ef308538b342 Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:05:09 +0000 Subject: [PATCH 173/185] Internal QA 3 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index 8f87422ec1b9..2c9470452683 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA2 +Just for QA3 From 5f0b025ae83ab524fd4a679a1e9dd1d02983d4c5 Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:20:12 +0000 Subject: [PATCH 174/185] Internal QA 4 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index 2c9470452683..66149699c9d8 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA3 +Just for QA4 From bfa6dffd6409f1b24c2b71a2f5207ec2758ace5d Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:29:55 +0000 Subject: [PATCH 175/185] Internal QA 5 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index 66149699c9d8..b351a001841b 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA4 +Just for QA5 From 44c832c51fe284120769b6b80416402cef119c99 Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:36:47 +0000 Subject: [PATCH 176/185] Internal QA 6 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index b351a001841b..8fb42898b420 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA5 +Just for QA6 From 879441b3e055a4d95d8d5a7825eaed91df78a549 Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:55:45 +0000 Subject: [PATCH 177/185] Internal QA 7 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index 8fb42898b420..e3bb5945fec8 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA6 +Just for QA7 From cf663f1927c15f6d6639cdf7b9103419e571e66a Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 14:00:42 +0000 Subject: [PATCH 178/185] Internal QA 8 --- contributingGuides/test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/test.md b/contributingGuides/test.md index e3bb5945fec8..e4f6341da9ee 100644 --- a/contributingGuides/test.md +++ b/contributingGuides/test.md @@ -1 +1 @@ -Just for QA7 +Just for QA8 From 76517fd0e376f43182ca59285347af737d00bb7b Mon Sep 17 00:00:00 2001 From: FAKE Vit Horacek <87368841+vitHoracek@users.noreply.github.com> Date: Tue, 6 Dec 2022 14:08:08 +0000 Subject: [PATCH 179/185] Internal QA 9 --- contributingGuides/test.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 contributingGuides/test.md diff --git a/contributingGuides/test.md b/contributingGuides/test.md deleted file mode 100644 index e4f6341da9ee..000000000000 --- a/contributingGuides/test.md +++ /dev/null @@ -1 +0,0 @@ -Just for QA8 From c2b7ebdead983a15a8fdb764e2667c4a1129609d Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Tue, 6 Dec 2022 17:30:29 +0000 Subject: [PATCH 180/185] add airship properties file to internalRelease Android build flavor --- .../src/internalRelease/assets/airshipconfig.properties | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 android/app/src/internalRelease/assets/airshipconfig.properties diff --git a/android/app/src/internalRelease/assets/airshipconfig.properties b/android/app/src/internalRelease/assets/airshipconfig.properties new file mode 100644 index 000000000000..194c4577de8b --- /dev/null +++ b/android/app/src/internalRelease/assets/airshipconfig.properties @@ -0,0 +1,7 @@ +appKey = 55vypj0ARc6cN09MX7ogtQ +appSecret = EsSaqbdLSvmyC6kSBFJCtQ +inProduction = true + +# Notification Customization +notificationIcon = ic_notification +notificationAccentColor = #2EAAE2 \ No newline at end of file From a092573f25aa7505b692807d6dc6ee569e6cf0d4 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 6 Dec 2022 10:48:54 -0700 Subject: [PATCH 181/185] Add missing token --- .github/workflows/preDeploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 62117c5b676a..268be481caae 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -255,6 +255,8 @@ jobs: - name: Checkout "Baseline" commit (last release) run: git checkout "$(gh release list --limit 1 | awk '{ print $1 }')" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build "Baseline" APK run: npm run android-build-e2e From ff737117a9ac9aefebecaa7a518295605a3822f0 Mon Sep 17 00:00:00 2001 From: Srikar Parsi Date: Tue, 6 Dec 2022 13:19:02 -0500 Subject: [PATCH 182/185] remove pRelative from inner text --- src/components/DisplayNames/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DisplayNames/index.js b/src/components/DisplayNames/index.js index 060a49d73d28..f6d207ecd8f1 100644 --- a/src/components/DisplayNames/index.js +++ b/src/components/DisplayNames/index.js @@ -100,7 +100,7 @@ class DisplayNames extends PureComponent { > {/* // We need to get the refs to all the names which will be used to correct the horizontal position of the tooltip */} - this.childRefs[index] = el} style={[...this.props.textStyles, styles.pRelative]}> + this.childRefs[index] = el} style={this.props.textStyles}> {displayName} From 2ed9539939ac5e2c4a100560d291d3c007ccca7a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 6 Dec 2022 12:19:50 -0700 Subject: [PATCH 183/185] Run `npm install` before building each build --- .github/workflows/preDeploy.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 268be481caae..21f7265f009c 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -244,6 +244,13 @@ jobs: - name: Make zip directory for everything to send to AWS Device Farm run: mkdir zip + - name: Install node packages + uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 + with: + timeout_minutes: 10 + max_attempts: 5 + command: npm ci + - name: Checkout "Compare" commit run: git checkout ${{ github.event.before }} @@ -258,6 +265,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install node packages + uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 + with: + timeout_minutes: 10 + max_attempts: 5 + command: npm ci + - name: Build "Baseline" APK run: npm run android-build-e2e From cdad438fc18120e97a91a17a2449dd3b368a3d70 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 6 Dec 2022 12:21:50 -0700 Subject: [PATCH 184/185] Move npm ci --- .github/workflows/preDeploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 21f7265f009c..b86a94532396 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -244,6 +244,9 @@ jobs: - name: Make zip directory for everything to send to AWS Device Farm run: mkdir zip + - name: Checkout "Compare" commit + run: git checkout ${{ github.event.before }} + - name: Install node packages uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350 with: @@ -251,9 +254,6 @@ jobs: max_attempts: 5 command: npm ci - - name: Checkout "Compare" commit - run: git checkout ${{ github.event.before }} - - name: Build "Compare" APK run: npm run android-build-e2e From 4c1f22827170a039ce9cf0cb03a11295da3529be Mon Sep 17 00:00:00 2001 From: Rocio Perez-Cano Date: Tue, 6 Dec 2022 14:29:16 -0500 Subject: [PATCH 185/185] Move comment --- src/libs/actions/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index b2118d58cdf8..1e3afedb3566 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -211,11 +211,11 @@ function setUpPoliciesAndNavigate(session) { return; } if (!isLoggingInAsNewUser && exitTo) { - // The drawer navigation is only created after we have fetched reports from the server. - // Thus, if we use the standard navigation and try to navigate to a drawer route before - // the reports have been fetched, we will fail to navigate. Navigation.isNavigationReady() .then(() => { + // The drawer navigation is only created after we have fetched reports from the server. + // Thus, if we use the standard navigation and try to navigate to a drawer route before + // the reports have been fetched, we will fail to navigate. Navigation.isDrawerReady() .then(() => { // We must call dismissModal() to remove the /transition route from history