Skip to content

Commit

Permalink
merge main into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetlath committed Feb 7, 2024
2 parents dc9c6ef + 82e93b8 commit 910bdee
Show file tree
Hide file tree
Showing 787 changed files with 19,358 additions and 51,151 deletions.
16 changes: 5 additions & 11 deletions .github/actions/composite/buildAndroidE2EAPK/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,15 @@ runs:
- name: Append environment variables to env file
shell: bash
run: |
echo "EXPENSIFY_PARTNER_NAME=${EXPENSIFY_PARTNER_NAME}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD=${EXPENSIFY_PARTNER_PASSWORD}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_ID=${EXPENSIFY_PARTNER_USER_ID}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_SECRET=${EXPENSIFY_PARTNER_USER_SECRET}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD_EMAIL=${EXPENSIFY_PARTNER_PASSWORD_EMAIL}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_NAME=${{ inputs.EXPENSIFY_PARTNER_NAME }}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD=${{ inputs.EXPENSIFY_PARTNER_PASSWORD }}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_ID=${{ inputs.EXPENSIFY_PARTNER_USER_ID }}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_SECRET=${{ inputs.EXPENSIFY_PARTNER_USER_SECRET }}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD_EMAIL=${{ inputs.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}" >> ${{ inputs.PATH_ENV_FILE }}
- name: Build APK
run: npm run ${{ inputs.PACKAGE_SCRIPT_NAME }}
shell: bash
env:
EXPENSIFY_PARTNER_NAME: ${{ inputs.EXPENSIFY_PARTNER_NAME }}
EXPENSIFY_PARTNER_PASSWORD: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD }}
EXPENSIFY_PARTNER_USER_ID: ${{ inputs.EXPENSIFY_PARTNER_USER_ID }}
EXPENSIFY_PARTNER_USER_SECRET: ${{ inputs.EXPENSIFY_PARTNER_USER_SECRET }}
EXPENSIFY_PARTNER_PASSWORD_EMAIL: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}

- name: Upload APK
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/createHelpRedirects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function checkCloudflareResult {

if ! [[ "$RESULT_MESSAGE" == "true" ]]; then
ERROR_MESSAGE=$(echo "$RESULTS" | jq .errors)
error "Error calling Cloudfalre API: $ERROR_MESSAGE"
error "Error calling Cloudflare API: $ERROR_MESSAGE"
exit 1
fi
}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
git fetch origin tag ${{ steps.getMostRecentRelease.outputs.VERSION }} --no-tags --depth=1
git switch --detach ${{ steps.getMostRecentRelease.outputs.VERSION }}
- uses: ./.github/actions/composite/buildAndroidE2EAPK
- uses: Expensify/App/.github/actions/composite/buildAndroidE2EAPK@main
with:
ARTIFACT_NAME: baseline-apk-${{ steps.getMostRecentRelease.outputs.VERSION }}
PACKAGE_SCRIPT_NAME: android-build-e2e
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- name: Checkout "delta ref"
run: git checkout ${{ steps.getDeltaRef.outputs.DELTA_REF }}

- uses: ./.github/actions/composite/buildAndroidE2EAPK
- uses: Expensify/App/.github/actions/composite/buildAndroidE2EAPK@main
with:
ARTIFACT_NAME: delta-apk-${{ steps.getDeltaRef.outputs.DELTA_REF }}
PACKAGE_SCRIPT_NAME: android-build-e2edelta
Expand Down Expand Up @@ -200,9 +200,10 @@ jobs:
if: failure()
run: |
echo ${{ steps.schedule-awsdf-main.outputs.data }}
cat "./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/Test spec output.txt"
unzip "Customer Artifacts.zip" -d mainResults
cat ./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/debug.log
cat "./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/logcat.txt" || true
cat ./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/debug.log || true
cat "./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/Test spec output.txt" || true
- name: Unzip AWS Device Farm results
if: ${{ always() }}
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/failureNotifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Notify on Workflow Failure

on:
workflow_run:
workflows: ["Process new code merged to main"]
types:
- completed

permissions:
issues: write

jobs:
notifyFailure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Fetch Workflow Run Jobs
id: fetch-workflow-jobs
uses: actions/github-script@v7
with:
script: |
const runId = "${{ github.event.workflow_run.id }}";
const jobsData = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runId,
});
return jobsData.data;
- name: Process Each Failed Job
uses: actions/github-script@v7
with:
script: |
const jobs = ${{ steps.fetch-workflow-jobs.outputs.result }};
const headCommit = "${{ github.event.workflow_run.head_commit.id }}";
const prData = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: headCommit,
});
const pr = prData.data[0];
const prLink = pr.html_url;
const prAuthor = pr.user.login;
const prMerger = "${{ github.event.workflow_run.actor.login }}";
const failureLabel = 'Workflow Failure';
for (let i = 0; i < jobs.total_count; i++) {
if (jobs.jobs[i].conclusion == 'failure') {
const jobName = jobs.jobs[i].name;
const jobLink = jobs.jobs[i].html_url;
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: failureLabel,
state: 'open'
});
const existingIssue = issues.data.find(issue => issue.title.includes(jobName));
if (!existingIssue) {
const annotations = await github.rest.checks.listAnnotations({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: jobs.jobs[i].id,
});
let errorMessage = "";
for(let j = 0; j < annotations.data.length; j++) {
errorMessage += annotations.data[j].annotation_level + ": ";
errorMessage += annotations.data[j].message + "\n";
}
const issueTitle = `Investigate workflow job failing on main: ${ jobName }`;
const issueBody = `🚨 **Failure Summary** 🚨:\n\n` +
`- **📋 Job Name**: [${ jobName }](${ jobLink })\n` +
`- **🔧 Failure in Workflow**: Process new code merged to main\n` +
`- **🔗 Triggered by PR**: [PR Link](${ prLink })\n` +
`- **👤 PR Author**: @${ prAuthor }\n` +
`- **🤝 Merged by**: @${ prMerger }\n` +
`- **🐛 Error Message**: \n ${errorMessage}\n\n` +
`⚠️ **Action Required** ⚠️:\n\n` +
`🛠️ A recent merge appears to have caused a failure in the job named [${ jobName }](${ jobLink }).\n` +
`This issue has been automatically created and labeled with \`${ failureLabel }\` for investigation. \n\n` +
`👀 **Please look into the following**:\n` +
`1. **Why the PR caused the job to fail?**\n` +
`2. **Address any underlying issues.**\n\n` +
`🐛 We appreciate your help in squashing this bug!`;
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: issueTitle,
body: issueBody,
labels: [failureLabel, 'Daily'],
assignees: [prMerger, prAuthor]
});
}
}
}
1 change: 1 addition & 0 deletions .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Reminder: If this workflow's name changes, update the name in the dependent workflow at .github/workflows/failureNotifier.yml.
name: Process new code merged to main

on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
npx reassure --baseline
git switch --force --detach -
git merge --no-commit --allow-unrelated-histories "$BASELINE_BRANCH" -X ours
git checkout --ours .
npm install --force
npx reassure --branch
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.9.0
20.10.0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ If you're using another operating system, you will need to ensure `mkcert` is in
## Running the iOS app 📱
For an M1 Mac, read this [SO](https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1) for installing cocoapods.

* If you haven't already, install Xcode tools and make sure to install the optional "iOS Platform" package as well. This installation may take awhile.
* Install project gems, including cocoapods, using bundler to ensure everyone uses the same versions. In the project root, run: `bundle install`
* If you get the error `Could not find 'bundler'`, install the bundler gem first: `gem install bundler` and try again.
* If you are using MacOS and get the error `Gem::FilePermissionError` when trying to install the bundler gem, you're likely using system Ruby, which requires administrator permission to modify. To get around this, install another version of Ruby with a version manager like [rbenv](https://github.com/rbenv/rbenv#installation).
Expand Down
5 changes: 0 additions & 5 deletions __mocks__/@react-native-community/push-notification-ios.js

This file was deleted.

1 change: 0 additions & 1 deletion __mocks__/@react-native-firebase/perf.js

This file was deleted.

5 changes: 5 additions & 0 deletions __mocks__/@react-native-firebase/perf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type PerfMock = () => void;

const perfMock: PerfMock = () => {};

export default perfMock;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useIsFocused as realUseIsFocused} from '@react-navigation/native';

// We only want this mocked for storybook, not jest
const useIsFocused = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true;
const useIsFocused: typeof realUseIsFocused = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true;

export * from '@react-navigation/core';
export * from '@react-navigation/native';
Expand Down
5 changes: 0 additions & 5 deletions __mocks__/push-notification-ios.js

This file was deleted.

4 changes: 0 additions & 4 deletions __mocks__/rn-fetch-blob.js

This file was deleted.

4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001043202
versionName "1.4.32-2"
versionCode 1001043801
versionName "1.4.38-1"
}

flavorDimensions "default"
Expand Down
9 changes: 9 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
-keep class com.expensify.chat.BuildConfig { *; }
-keep, allowoptimization, allowobfuscation class expo.modules.** { *; }

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# Added from auto-generated missingrules.txt to allow build to succeed
-dontwarn com.onfido.javax.inject.Inject
-dontwarn javax.lang.model.element.Element
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<!-- If these colors are changed, we must add them to HybridApp also -->
<color name="bootsplash_background">#03D47C</color>
<color name="white">#FFFFFF</color>
<color name="accent">#03D47C</color>
Expand Down
Binary file added assets/animations/Update.lottie
Binary file not shown.
5 changes: 5 additions & 0 deletions assets/images/cards-and-domains.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/images/eReceiptIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/images/new-expensify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 910bdee

Please sign in to comment.