Skip to content

Commit

Permalink
Merge branch 'main' into @zfurtak/search-chat-header
Browse files Browse the repository at this point in the history
  • Loading branch information
zfurtak committed Feb 4, 2025
2 parents 55c9e7e + bfb97c5 commit a2c62e9
Show file tree
Hide file tree
Showing 207 changed files with 2,566 additions and 1,564 deletions.
2 changes: 1 addition & 1 deletion .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
PUSHER_APP_KEY=268df511a204fbb60884
USE_WEB_PROXY=false
ENVIRONMENT=staging
SEND_CRASH_REPORTS=true
SEND_CRASH_REPORTS=true
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ PROPOSAL:


<!---
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please specify it like follows:
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please link it like this:
MOBILE-EXPENSIFY: PR number
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/<PR-number>
--->

Expand Down
28 changes: 28 additions & 0 deletions .github/scripts/checkParser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e

ROOT_DIR=$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")
cd "$ROOT_DIR" || exit 1

autocomplete_parser_backup="src/libs/SearchParser/autocompleteParser.js.bak"
search_parser_backup="src/libs/SearchParser/searchParser.js.bak"

#Copying the current .js parser files
cp src/libs/SearchParser/autocompleteParser.js "$autocomplete_parser_backup" 2>/dev/null
cp src/libs/SearchParser/searchParser.js "$search_parser_backup" 2>/dev/null

#Running the scripts that generate the .js parser files
npm run generate-search-parser
npm run generate-autocomplete-parser

#Checking if the saved files differ from the newly generated
if ! diff -q "$autocomplete_parser_backup" src/libs/SearchParser/autocompleteParser.js >/dev/null ||
! diff -q "$search_parser_backup" src/libs/SearchParser/searchParser.js >/dev/null; then
echo "The files generated from the .peggy files using the commands: generate-search-parser and generate-autocomplete-parser are not identical to those currently on this branch."
echo "The parser .js files should never be edited manually. Make sure you’ve run locally: npm run generate-search-parser and npm run generate-autocomplete-parser, and committed the changes."
exit 1
else
echo "The files generated from the .peggy files using the commands: generate-search-parser and generate-autocomplete-parser are identical to those currently on this branch."
exit 0
fi
31 changes: 25 additions & 6 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}
submodules: true

- name: Set up git for OSBotify
id: setupGitForOSBotify
Expand Down Expand Up @@ -85,14 +86,13 @@ jobs:
if git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}; then
echo "🎉 No conflicts! CP was a success, PR can be automerged 🎉"
echo "HAS_CONFLICTS=false" >> "$GITHUB_OUTPUT"
git commit --amend -m "$(git log -1 --pretty=%B)" -m "(CP triggered by ${{ github.actor }})"
else
echo "😞 PR can't be automerged, there are merge conflicts in the following files:"
git --no-pager diff --name-only --diff-filter=U
git add .
GIT_MERGE_AUTOEDIT=no git cherry-pick --continue
git cherry-pick --abort
echo "HAS_CONFLICTS=true" >> "$GITHUB_OUTPUT"
fi
git commit --amend -m "$(git log -1 --pretty=%B)" -m "(CP triggered by ${{ github.actor }})"
- name: Push changes
run: |
Expand All @@ -109,19 +109,38 @@ jobs:
run: |
gh pr create \
--title "🍒 Cherry pick PR #${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
--body "🍒 Cherry pick https://github.com/Expensify/App/pull/${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
--body \
"🍒 Cherry pick https://github.com/Expensify/App/pull/${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒
This PR had conflicts when we tried to cherry-pick it to staging. You'll need to manually perform the cherry-pick, using the following steps:
\`\`\`bash
git fetch
git checkout ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}
git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}
\`\`\`
Then manually resolve conflicts, and commit the change with \`git cherry-pick --continue\`. Lastly, please run:
\`\`\`bash
git commit --amend -m \"$(git log -1 --pretty=%B)\" -m \"(CP triggered by ${{ github.actor }})\"
\`\`\`
That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}\`, and then open this PR for review.
Note that you **must** test this PR, and both the author and reviewer checklist should be completed, just as if you were merging the PR to main." \
--label "Engineering,Hourly" \
--base "staging"
sleep 5
gh pr comment --body \
"This pull request has merge conflicts and can not be automatically merged. :disappointed:
Please manually resolve the conflicts, push your changes, and then request another reviewer to review and merge.
**Important:** There may be conflicts that GitHub is not able to detect, so please _carefully_ review this pull request before approving."
gh pr edit --add-assignee "${{ github.actor }},${{ steps.getCPMergeCommit.outputs.MERGE_ACTOR }}"
ORIGINAL_PR_AUTHOR="$(gh pr view ${{ github.event.inputs.PULL_REQUEST_NUMBER }} --json author --jq .author.login)"
gh pr edit --add-assignee "${{ github.actor }},${{ steps.getCPMergeCommit.outputs.MERGE_ACTOR }},$ORIGINAL_PR_AUTHOR"
env:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

- name: Label PR with CP Staging
- name: Label original PR with CP Staging
run: gh pr edit ${{ inputs.PULL_REQUEST_NUMBER }} --add-label 'CP Staging'
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
run: |
cd Mobile-Expensify
git fetch --depth=1 origin main
git checkout main
git reset --hard origin/main
- name: Generate HybridApp version
Expand Down Expand Up @@ -138,14 +139,18 @@ jobs:
- name: Commit new E/App version
run: |
git add \
./Mobile-Expensify
./package.json \
./package-lock.json \
./android/app/build.gradle \
./ios/NewExpensify/Info.plist \
./ios/NewExpensifyTests/Info.plist \
./ios/NotificationServiceExtension/Info.plist
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
- name: Update Mobile-Expensify submodule in E/App
run: |
git add Mobile-Expensify
git commit -m "Update Mobile-Expensify submodule version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
git push origin main
- name: Announce failed workflow in Slack
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ jobs:
name: android-hybrid-apk-artifact
path: Expensify.apk

- name: Upload Android build to Firebase distribution
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane android upload_firebase_distribution

- name: Upload Android build artifact
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -322,7 +318,7 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }}
GCP_GEOLOCATION_API_KEY: ${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }}

- name: Upload desktop sourcemaps artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -577,10 +573,6 @@ jobs:
env:
BROWSERSTACK: ${{ secrets.BROWSERSTACK }}

- name: Upload iOS build to Firebase distribution
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: bundle exec fastlane ios upload_firebase_distribution

- name: Upload iOS build artifact
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_STAGING }}
GCP_GEOLOCATION_API_KEY: ${{ secrets.GCP_GEOLOCATION_API_KEY_STAGING }}

web:
name: Build and deploy Web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testBuildHybrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
});
const body = pullRequest.data.body;
const regex = /MOBILE-EXPENSIFY:(?<prNumber>\d+)/;
const regex = /MOBILE-EXPENSIFY:\s*https:\/\/github.com\/Expensify\/Mobile-Expensify\/pull\/(?<prNumber>\d+)/;
const found = body.match(regex)?.groups?.prNumber || "";
return found.trim();
Expand Down
51 changes: 27 additions & 24 deletions .github/workflows/verifyHybridApp.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Verify HybridApp build

on:
workflow_call:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
Expand All @@ -24,23 +23,35 @@ concurrency:
cancel-in-progress: true

jobs:
comment_on_fork:
name: Comment on all PRs that are forks
# Only run on pull requests that *are* a fork
if: ${{ github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- name: Comment on forks
run: |
gh pr comment ${{github.event.pull_request.html_url }} --body \
":warning: This PR is possibly changing native code, it may cause problems with HybridApp. Please run an AdHoc build to verify that HybridApp will not break. :warning:"
env:
GITHUB_TOKEN: ${{ github.token }}
verify_android:
name: Verify Android HybridApp builds on main
runs-on: ubuntu-latest-xl
# Only run on pull requests that are *not* on a fork
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule to match main
run: |
git submodule update --init --remote
git fetch
git submodule update --init --remote --depth 1
cd Mobile-Expensify
git checkout main
- name: Configure MapBox SDK
Expand All @@ -52,10 +63,14 @@ jobs:
with:
IS_HYBRID_BUILD: 'true'

- name: Setup Ruby
uses: ruby/[email protected]
with:
bundler-cache: true

- name: Build Android Debug
working-directory: Mobile-Expensify/Android
run: |
if ! ./gradlew assembleDebug
if ! npm run android-hybrid-build
then
echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
exit 1
Expand All @@ -64,20 +79,20 @@ jobs:
verify_ios:
name: Verify iOS HybridApp builds on main
runs-on: macos-15-xlarge
# Only run on pull requests that are *not* on a fork
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.OS_BOTIFY_TOKEN }}
# fetch-depth: 0 is required in order to fetch the correct submodule branch
fetch-depth: 0

- name: Update submodule to match main
run: |
git submodule update --init --remote
git fetch
git submodule update --init --remote --depth 1
cd Mobile-Expensify
git checkout main
- name: Configure MapBox SDK
Expand All @@ -94,9 +109,6 @@ jobs:
with:
bundler-cache: true

- name: Install New Expensify Gems
run: bundle install

- name: Cache Pod dependencies
uses: actions/cache@v4
id: pods-cache
Expand Down Expand Up @@ -125,16 +137,7 @@ jobs:
export RCT_NO_LAUNCH_PACKAGER=1
# Build iOS using xcodebuild
if ! xcodebuild \
-workspace Mobile-Expensify/iOS/Expensify.xcworkspace \
-scheme Expensify \
-configuration Debug \
-sdk iphonesimulator \
-arch x86_64 \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
build | xcpretty
if ! npm run ios-hybrid-build
then
echo "❌ iOS HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
exit 1
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/verifyParserFiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check consistency of search parser files

on:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths:
- "src/libs/SearchParser/**"

jobs:
verify:
if: github.actor != 'OSBotify' && github.actor != 'imgbot[bot]'
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Verify parser files consistency
run: ./.github/scripts/checkParser.sh
2 changes: 1 addition & 1 deletion Mobile-Expensify
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [Running The Tests](#running-the-tests)
* [Debugging](#debugging)
* [App Structure and Conventions](#app-structure-and-conventions)
* [HybridApp](#HybridApp)
* [Philosophy](#Philosophy)
* [Security](#Security)
* [Internationalization](#Internationalization)
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009009202
versionName "9.0.92-2"
versionCode 1009009401
versionName "9.0.94-1"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
14 changes: 14 additions & 0 deletions assets/images/customEmoji/global-create.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 a2c62e9

Please sign in to comment.