Skip to content

Commit

Permalink
Merge branch 'main' into fix/50786
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Nov 5, 2024
2 parents df49b8a + 10454f0 commit 7359f17
Show file tree
Hide file tree
Showing 470 changed files with 8,183 additions and 7,723 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ USE_WEB_PROXY=false
USE_WDYR=false
CAPTURE_METRICS=false
ONYX_METRICS=false
USE_THIRD_PARTY_SCRIPTS=false

EXPENSIFY_ACCOUNT_ID_ACCOUNTING=-1
EXPENSIFY_ACCOUNT_ID_ADMIN=-1
Expand Down
6 changes: 3 additions & 3 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ USE_WEB_PROXY=false
ENVIRONMENT=production
SEND_CRASH_REPORTS=true

FB_API_KEY=AIzaSyDxzigVLZl4G8MP7jACQ0qpmADMzmrrON0
FB_APP_ID=1:921154746561:web:1583e882584cf151027c40
FB_PROJECT_ID=expensify-chat
FB_API_KEY=AIzaSyBrLKgCuo6Vem6Xi5RPokdumssW8HaWBow
FB_APP_ID=1:1008697809946:web:08de4ecb7656b7235445a3
FB_PROJECT_ID=expensify-mobile-app
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ module.exports = {
files: ['*.ts', '*.tsx'],
rules: {
'rulesdir/prefer-at': 'error',
'rulesdir/boolean-conditional-rendering': 'error',
},
},
],
Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/Internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Open an internal issue for a backend fix
about: Use this template to report a backend issue that an internal Expensify employee needs to fix
labels: Hot Pick, Daily, Internal, AutoAssignerNewDotQuality
---

<!-- Please link the original GH where the problem was reported -->
**Original GH:**

## Action Performed:
Break down in numbered steps

## Expected Result:
Describe what you think the backend _SHOULD_ have done

## Actual Result:
Describe what the backend _ACTUALLY_ did

## Screenshots/Videos

<details>
<summary>Add any screenshot/video evidence</summary>


</details>
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ___
**Logs:** https://stackoverflow.com/c/expensify/questions/4856
**Expensify/Expensify Issue URL:**
**Issue reported by:**
**Slack conversation:**
**Slack conversation** (hyperlinked to channel name):

## Action Performed:
Break down in numbered steps
Expand Down
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit. -->

### Details
<!-- Explanation of the change or anything fishy that is going on -->
### Explanation of Change
<!-- Explain what your change does and how it addresses the linked issue -->

### Fixed Issues
<!---
Expand Down Expand Up @@ -79,7 +79,6 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
- [ ] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. `toggleReport` and not `onIconClick`)
- [ ] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. `myBool && <MyComponent />`.
- [ ] I verified that comments were added to code that is not self explanatory
- [ ] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
- [ ] I verified any copy / text shown in the product is localized by adding it to `src/languages/*` files and using the [translation method](https://github.com/Expensify/App/blob/4bd99402cebdf4d7394e0d1f260879ea238197eb/src/components/withLocalize.js#L60)
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/enforceRedirect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ declare -r REDIRECTS_FILE="docs/redirects.csv"
hasRenamedOrDeletedArticle=false
hasModifiedRedirect=false

if git log origin/main..HEAD --name-status --pretty=format: $ARTICLES_DIRECTORY | grep -q -E "^(R|D)"
if git diff origin/main..HEAD --name-status --pretty=format: $ARTICLES_DIRECTORY | grep -q -E "^(R|D)"
then
echo "Articles have been renamed/moved/deleted"
hasRenamedOrDeletedArticle=true
fi

if git log origin/main..HEAD --name-status --pretty=format: $REDIRECTS_FILE | grep -q -E "^(M)"
if git diff origin/main..HEAD --name-status --pretty=format: $REDIRECTS_FILE | grep -q -E "^(M)"
then
echo "Redirects.csv has been modified"
hasModifiedRedirect=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildAndroid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
echo "APK_PATH=$apkPath"
echo "APK_FILE_NAME=$(basename "$apkPath")"
echo "SHOULD_UPLOAD_SOURCEMAPS=$SHOULD_UPLOAD_SOURCEMAPS"
echo "APK_ARTIFACT_NAME=${{ inputs.artifact-prefix }}android-artifact-apk" >> "$GITHUB_OUTPUT"
echo "APK_ARTIFACT_NAME=${{ inputs.artifact-prefix }}android-apk-artifact" >> "$GITHUB_OUTPUT"
} >> "$GITHUB_OUTPUT"
- name: Upload Android AAB artifact
Expand Down
87 changes: 69 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,15 @@ jobs:
submodules: true
path: 'Mobile-Expensify'
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule
run: |
git submodule update --init
# Update submodule to latest on staging
git fetch
git checkout staging
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
Expand All @@ -200,6 +205,9 @@ jobs:
run: |
npm install
cd .. && npm install
# Fixes https://github.com/Expensify/App/issues/51682
npm run grunt:build:shared
- name: Setup Java
uses: actions/setup-java@v4
Expand Down Expand Up @@ -269,6 +277,13 @@ jobs:
name: android-hybrid-build-artifact
path: ${{ env.aabPath }}

- name: Upload Android sourcemap artifact
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: actions/upload-artifact@v4
with:
name: android-hybrid-sourcemap-artifact
path: /home/runner/work/App/App/Mobile-Expensify/Android/build/generated/sourcemaps/react/release/index.android.bundle.map

- name: Set current App version in Env
run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"

Expand Down Expand Up @@ -475,10 +490,15 @@ jobs:
submodules: true
path: 'Mobile-Expensify'
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule
run: |
git submodule update --init
# Update submodule to latest on staging
git fetch
git checkout staging
- name: Configure MapBox SDK
run: |
Expand Down Expand Up @@ -586,6 +606,13 @@ jobs:
name: ios-hybrid-build-artifact
path: ${{ env.ipaPath }}

- name: Upload iOS sourcemap artifact
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: actions/upload-artifact@v4
with:
name: ios-hybrid-sourcemap-artifact
path: /Users/runner/work/App/App/Mobile-Expensify/main.jsbundle.map

- name: Warn deployers if iOS production deploy failed
if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: 8398a7/action-slack@v3
Expand Down Expand Up @@ -786,18 +813,31 @@ jobs:
- name: Upload artifacts to GitHub Release
continue-on-error: true
run: |
gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber \
./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./android-aab-artifact/app-production-release.aab \
./android-hybrid-build-artifact/Expensify-release.aab#Android-HybridApp.aab \
./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./desktop-staging-build-artifact/NewExpensify.dmg#NewExpensifyStaging.dmg \
./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./ios-build-artifact/New\ Expensify.ipa \
./ios-hybrid-build-artifact/Expensify.ipa#iOS-HybridApp.ipa \
./web-staging-sourcemaps-artifact/web-staging-merged-source-map.js.map#web-staging-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./web-staging-build-tar-gz-artifact/webBuild.tar.gz#stagingWebBuild.tar.gz \
./web-staging-build-zip-artifact/webBuild.zip#stagingWebBuild.zip
# Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension]
files=(
"./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map"
"./android-aab-artifact/app-production-release.aab#android.aab"
"./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab"
"./android-hybrid-sourcemap-artifact/index.android.bundle.map#android-hybrid-sourcemap.js.map"
"./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map"
"./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg"
"./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map"
"./ios-build-artifact/New Expensify.ipa#ios.ipa"
"./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa"
"./ios-hybrid-sourcemap-artifact/main.jsbundle.map#ios-hybrid-sourcemap.js.map"
"./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map"
"./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz"
"./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip"
)
# Loop through each file and upload individually (so if one fails, we still have other platforms uploaded)
for file_entry in "${files[@]}"; do
gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" || {
echo "Failed to upload $file_entry. Continuing with the next file."
continue
}
echo "Successfully uploaded $file_entry."
done
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -844,12 +884,23 @@ jobs:
- name: Upload artifacts to GitHub Release
continue-on-error: true
run: |
gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber \
./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./desktop-build-artifact/NewExpensify.dmg \
./web-sourcemaps-artifact/web-merged-source-map.js.map#web-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./web-build-tar-gz-artifact/webBuild.tar.gz \
./web-build-zip-artifact/webBuild.zip
# Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension]
files=(
"./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map"
"./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg"
"./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map"
"./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz"
"./web-build-zip-artifact/webBuild.zip#web-production.zip"
)
# Loop through each file and upload individually (so if one fails, we still have other platforms uploaded)
for file_entry in "${files[@]}"; do
gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" || {
echo "Failed to upload $file_entry. Continuing with the next file."
continue
}
echo "Successfully uploaded $file_entry."
done
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployNewHelp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Install Node for _scripts/*.js
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.18.0'

Expand Down
73 changes: 53 additions & 20 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
previous_merge=$(git rev-list --merges HEAD~1 | head -n 1)
else
# On a feature branch, find the common ancestor of the current branch and main
git fetch origin main:main
previous_merge=$(git merge-base HEAD main)
fi
echo "$previous_merge"
Expand All @@ -60,7 +61,7 @@ jobs:
id: getDeltaRef
run: |
if [ '${{ steps.getPullRequestDetails.outputs.IS_MERGED }}' == 'true' ]; then
echo "DELTA_REF=${{ steps.getPullRequestDetails.outputs.HEAD_COMMIT_SHA }}" >> "$GITHUB_OUTPUT"
echo "DELTA_REF=${{ steps.getPullRequestDetails.outputs.MERGE_COMMIT_SHA }}" >> "$GITHUB_OUTPUT"
else
# Set dummy git credentials
git config --global user.email "[email protected]"
Expand Down Expand Up @@ -157,26 +158,28 @@ jobs:
aws-region: us-west-2

- name: Schedule AWS Device Farm test run on main branch
uses: realm/aws-devicefarm/test-application@7b9a91236c456c97e28d384c9e476035d5ea686b
uses: Wandalen/[email protected]
id: schedule-awsdf-main
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.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
Test spec output.txt
log_artifacts: debug.log
cleanup: true
timeout: 7200
action: realm/aws-devicefarm/test-application@7b9a91236c456c97e28d384c9e476035d5ea686b
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.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
Test spec output.txt
log_artifacts: debug.log
cleanup: true
timeout: 7200
- name: Print logs if run failed
if: failure()
Expand Down Expand Up @@ -229,14 +232,44 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Check if test has skipped tests
id: checkIfSkippedTestsDetected
run: |
if grep -q '⚠️' "./Host_Machine_Files/\$WORKING_DIRECTORY/output.md"; then
# Create an output to the GH action that the tests were skipped:
echo "skippedTestsDetected=true" >> "$GITHUB_OUTPUT"
else
echo "skippedTestsDetected=false" >> "$GITHUB_OUTPUT"
echo '✅ no skipped tests detected'
fi
env:
GITHUB_TOKEN: ${{ github.token }}

- name: 'Announce skipped tests in Slack'
if: ${{ steps.checkIfSkippedTestsDetected.outputs.skippedTestsDetected == 'true' }}
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
{
channel: '#e2e-announce',
attachments: [{
color: 'danger',
text: `⚠️ ${process.env.AS_REPO} Some of E2E tests were skipped on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}> workflow ⚠️`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: 'Announce regression in Slack'
if: ${{ steps.checkIfRegressionDetected.outputs.performanceRegressionDetected == 'true' }}
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
{
channel: '#newdot-quality',
channel: '#quality',
attachments: [{
color: 'danger',
text: `🔴 Performance regression detected in PR ${{ inputs.PR_NUMBER }}\nDetected in <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}> workflow.`,
Expand Down
Loading

0 comments on commit 7359f17

Please sign in to comment.