Skip to content

Commit cd76242

Browse files
Merge branch 'Expensify:main' into fix/55864-move-expense-to-selfDM-message
2 parents 53e148a + 4bfb82c commit cd76242

File tree

166 files changed

+2940
-1892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+2940
-1892
lines changed

.env.staging

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
66
PUSHER_APP_KEY=268df511a204fbb60884
77
USE_WEB_PROXY=false
88
ENVIRONMENT=staging
9-
SEND_CRASH_REPORTS=true
9+
SEND_CRASH_REPORTS=true

.github/scripts/checkParser.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
ROOT_DIR=$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")
6+
cd "$ROOT_DIR" || exit 1
7+
8+
autocomplete_parser_backup="src/libs/SearchParser/autocompleteParser.js.bak"
9+
search_parser_backup="src/libs/SearchParser/searchParser.js.bak"
10+
11+
#Copying the current .js parser files
12+
cp src/libs/SearchParser/autocompleteParser.js "$autocomplete_parser_backup" 2>/dev/null
13+
cp src/libs/SearchParser/searchParser.js "$search_parser_backup" 2>/dev/null
14+
15+
#Running the scripts that generate the .js parser files
16+
npm run generate-search-parser
17+
npm run generate-autocomplete-parser
18+
19+
#Checking if the saved files differ from the newly generated
20+
if ! diff -q "$autocomplete_parser_backup" src/libs/SearchParser/autocompleteParser.js >/dev/null ||
21+
! diff -q "$search_parser_backup" src/libs/SearchParser/searchParser.js >/dev/null; then
22+
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."
23+
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."
24+
exit 1
25+
else
26+
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."
27+
exit 0
28+
fi

.github/workflows/cherryPick.yml

+25-6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
with:
4040
ref: staging
4141
token: ${{ secrets.OS_BOTIFY_TOKEN }}
42+
submodules: true
4243

4344
- name: Set up git for OSBotify
4445
id: setupGitForOSBotify
@@ -85,14 +86,13 @@ jobs:
8586
if git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}; then
8687
echo "🎉 No conflicts! CP was a success, PR can be automerged 🎉"
8788
echo "HAS_CONFLICTS=false" >> "$GITHUB_OUTPUT"
89+
git commit --amend -m "$(git log -1 --pretty=%B)" -m "(CP triggered by ${{ github.actor }})"
8890
else
8991
echo "😞 PR can't be automerged, there are merge conflicts in the following files:"
9092
git --no-pager diff --name-only --diff-filter=U
91-
git add .
92-
GIT_MERGE_AUTOEDIT=no git cherry-pick --continue
93+
git cherry-pick --abort
9394
echo "HAS_CONFLICTS=true" >> "$GITHUB_OUTPUT"
9495
fi
95-
git commit --amend -m "$(git log -1 --pretty=%B)" -m "(CP triggered by ${{ github.actor }})"
9696
9797
- name: Push changes
9898
run: |
@@ -109,19 +109,38 @@ jobs:
109109
run: |
110110
gh pr create \
111111
--title "🍒 Cherry pick PR #${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
112-
--body "🍒 Cherry pick https://github.com/Expensify/App/pull/${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒" \
112+
--body \
113+
"🍒 Cherry pick https://github.com/Expensify/App/pull/${{ github.event.inputs.PULL_REQUEST_NUMBER }} to staging 🍒
114+
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:
115+
116+
\`\`\`bash
117+
git fetch
118+
git checkout ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}
119+
git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }}
120+
\`\`\`
121+
122+
Then manually resolve conflicts, and commit the change with \`git cherry-pick --continue\`. Lastly, please run:
123+
124+
\`\`\`bash
125+
git commit --amend -m \"$(git log -1 --pretty=%B)\" -m \"(CP triggered by ${{ github.actor }})\"
126+
\`\`\`
127+
128+
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.
129+
130+
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." \
113131
--label "Engineering,Hourly" \
114132
--base "staging"
115133
sleep 5
116134
gh pr comment --body \
117135
"This pull request has merge conflicts and can not be automatically merged. :disappointed:
118136
Please manually resolve the conflicts, push your changes, and then request another reviewer to review and merge.
119137
**Important:** There may be conflicts that GitHub is not able to detect, so please _carefully_ review this pull request before approving."
120-
gh pr edit --add-assignee "${{ github.actor }},${{ steps.getCPMergeCommit.outputs.MERGE_ACTOR }}"
138+
ORIGINAL_PR_AUTHOR="$(gh pr view ${{ github.event.inputs.PULL_REQUEST_NUMBER }} --json author --jq .author.login)"
139+
gh pr edit --add-assignee "${{ github.actor }},${{ steps.getCPMergeCommit.outputs.MERGE_ACTOR }},$ORIGINAL_PR_AUTHOR"
121140
env:
122141
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
123142

124-
- name: Label PR with CP Staging
143+
- name: Label original PR with CP Staging
125144
run: gh pr edit ${{ inputs.PULL_REQUEST_NUMBER }} --add-label 'CP Staging'
126145
env:
127146
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/compareNDandODbuilds.yml

+67-22
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
buildHybridAppAndroid:
88
name: Build HybridApp Android
9-
runs-on: macos-15-xlarge
9+
runs-on: ubuntu-latest-xl
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
@@ -30,23 +30,65 @@ jobs:
3030
with:
3131
IS_HYBRID_BUILD: 'true'
3232

33+
- name: Run grunt build
34+
run: |
35+
cd Mobile-Expensify
36+
npm run grunt:build:shared
37+
38+
- name: Setup Java
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: 'oracle'
42+
java-version: '17'
43+
44+
- name: Setup Ruby
45+
uses: ruby/setup-ruby@v1.190.0
46+
with:
47+
bundler-cache: true
48+
49+
- name: Install New Expensify Gems
50+
run: bundle install
51+
52+
- name: Install 1Password CLI
53+
uses: 1password/install-cli-action@v1
54+
55+
- name: Load files from 1Password
56+
env:
57+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
58+
run: |
59+
op document get --output ./upload-key.keystore upload-key.keystore
60+
op document get --output ./android-fastlane-json-key.json android-fastlane-json-key.json
61+
# Copy the keystore to the Android directory for Fullstory
62+
cp ./upload-key.keystore Mobile-Expensify/Android
63+
64+
- name: Load Android upload keystore credentials from 1Password
65+
id: load-credentials
66+
uses: 1password/load-secrets-action@v2
67+
with:
68+
export-env: false
69+
env:
70+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
71+
ANDROID_UPLOAD_KEYSTORE_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_PASSWORD
72+
ANDROID_UPLOAD_KEYSTORE_ALIAS: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_ALIAS
73+
ANDROID_UPLOAD_KEY_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEY_PASSWORD
74+
3375
- name: Build Android Release
3476
working-directory: Mobile-Expensify/Android
3577
run: |
36-
if ! ./gradlew --profile assembleRelease
37-
then
38-
echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
39-
exit 1
40-
else
41-
echo "✅ Build succeeded. Printing Gradle profile report:"
42-
# Print the latest generated profile report
43-
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
44-
cat "$PROFILE_REPORT"
45-
fi
78+
./gradlew --profile assembleRelease \
79+
-Pandroid.injected.signing.store.file="./upload-key.keystore" \
80+
-Pandroid.injected.signing.store.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} \
81+
-Pandroid.injected.signing.key.alias=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} \
82+
-Pandroid.injected.signing.key.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }}
83+
84+
echo "Printing Gradle profile report:"
85+
# Print the latest generated profile report
86+
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
87+
cat "$PROFILE_REPORT"
4688
4789
buildStandaloneAndroid:
4890
name: Build Standalone Android
49-
runs-on: macos-15-xlarge
91+
runs-on: ubuntu-latest-xl
5092
steps:
5193
- name: Checkout
5294
uses: actions/checkout@v4
@@ -62,16 +104,19 @@ jobs:
62104
with:
63105
IS_HYBRID_BUILD: 'false'
64106

107+
- name: Decrypt keystore to sign the APK/AAB
108+
run: gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output my-upload-key.keystore my-upload-key.keystore.gpg
109+
working-directory: android/app
110+
65111
- name: Build Android Release
66112
working-directory: android
113+
env:
114+
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
115+
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
67116
run: |
68-
if ! ./gradlew --profile assembleProductionRelease
69-
then
70-
echo "❌ Android Standalone failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
71-
exit 1
72-
else
73-
echo "✅ Build succeeded. Printing Gradle profile report:"
74-
# Print the latest generated profile report
75-
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
76-
cat "$PROFILE_REPORT"
77-
fi
117+
./gradlew --profile assembleProductionRelease
118+
119+
echo "Printing Gradle profile report:"
120+
# Print the latest generated profile report
121+
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
122+
cat "$PROFILE_REPORT"

.github/workflows/createNewVersion.yml

+24-60
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
uses: actions/checkout@v4
6666
with:
6767
ref: main
68+
submodules: true
6869
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
6970
# This is a workaround to allow pushes to a protected branch
7071
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
@@ -75,70 +76,24 @@ jobs:
7576
with:
7677
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
7778

78-
- name: Generate version
79+
- name: Generate new E/App version
7980
id: bumpVersion
8081
uses: ./.github/actions/javascript/bumpVersion
8182
with:
8283
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
8384
SEMVER_LEVEL: ${{ inputs.SEMVER_LEVEL }}
8485

85-
- name: Commit new version
86-
run: |
87-
git add \
88-
./package.json \
89-
./package-lock.json \
90-
./android/app/build.gradle \
91-
./ios/NewExpensify/Info.plist \
92-
./ios/NewExpensifyTests/Info.plist \
93-
./ios/NotificationServiceExtension/Info.plist
94-
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
95-
96-
- name: Update main branch
97-
run: git push origin main
98-
99-
- name: Announce failed workflow in Slack
100-
if: ${{ failure() }}
101-
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
102-
with:
103-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
104-
105-
createNewHybridVersion:
106-
runs-on: macos-latest
107-
needs: [validateActor, createNewVersion]
108-
if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}
109-
steps:
110-
- name: Run turnstyle
111-
uses: softprops/turnstyle@49108bdfa571e62371bd2c3094893c547ab3fc03
112-
with:
113-
poll-interval-seconds: 10
114-
env:
115-
GITHUB_TOKEN: ${{ github.token }}
116-
117-
- name: Check out `App` repo
118-
uses: actions/checkout@v4
119-
with:
120-
ref: main
121-
submodules: true
122-
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
123-
# This is a workaround to allow pushes to a protected branch
124-
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
125-
126-
- name: Update submodule and checkout the main branch
86+
- name: Update Mobile-Expensify submodule with the latest state of the Mobile-Expensify main branch
12787
run: |
128-
git submodule update --init
12988
cd Mobile-Expensify
89+
git fetch --depth=1 origin main
13090
git checkout main
131-
git pull origin main
132-
133-
- name: Setup git for OSBotify
134-
uses: ./.github/actions/composite/setupGitForOSBotify
135-
id: setupGitForOSBotify
136-
with:
137-
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
91+
git reset --hard origin/main
13892
13993
- name: Generate HybridApp version
14094
run: |
14195
cd Mobile-Expensify
96+
14297
# Generate all flavors of the version
14398
SHORT_APP_VERSION=$(echo "$NEW_VERSION" | awk -F'-' '{print $1}')
14499
BUILD_NUMBER=$(echo "$NEW_VERSION" | awk -F'-' '{print $2}')
@@ -167,9 +122,9 @@ jobs:
167122
# Update JS HybridApp Version
168123
sed -i .bak -E "s/\"version\": \"([0-9\.]*)\"/\"version\": \"$FULL_APP_VERSION\"/" $JS_CONFIG_FILE
169124
env:
170-
NEW_VERSION: ${{ needs.createNewVersion.outputs.NEW_VERSION }}
125+
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}
171126

172-
- name: Commit new version
127+
- name: Commit new Mobile-Expensify version
173128
run: |
174129
cd Mobile-Expensify
175130
git add \
@@ -178,16 +133,25 @@ jobs:
178133
./iOS/Expensify/Expensify-Info.plist\
179134
./iOS/SmartScanExtension/Info.plist \
180135
./iOS/NotificationServiceExtension/Info.plist
181-
git commit -m "Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
136+
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
137+
git push origin main
182138
183-
- name: Update main branch on Mobile-Expensify and App
139+
- name: Commit new E/App version
140+
run: |
141+
git add \
142+
./package.json \
143+
./package-lock.json \
144+
./android/app/build.gradle \
145+
./ios/NewExpensify/Info.plist \
146+
./ios/NewExpensifyTests/Info.plist \
147+
./ios/NotificationServiceExtension/Info.plist
148+
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
149+
150+
- name: Update Mobile-Expensify submodule in E/App
184151
run: |
185-
cd Mobile-Expensify
186-
git push origin main
187-
cd ..
188152
git add Mobile-Expensify
189-
git commit -m "Update Mobile-Expensify to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
190-
git push origin main
153+
git commit -m "Update Mobile-Expensify submodule version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
154+
git push origin main
191155
192156
- name: Announce failed workflow in Slack
193157
if: ${{ failure() }}

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
323323
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
324324
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
325-
GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }}
325+
GCP_GEOLOCATION_API_KEY: ${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }}
326326

327327
- name: Upload desktop sourcemaps artifact
328328
uses: actions/upload-artifact@v4

.github/workflows/testBuild.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ jobs:
270270
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
271271
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
272272
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
273-
GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_STAGING }}
273+
GCP_GEOLOCATION_API_KEY: ${{ secrets.GCP_GEOLOCATION_API_KEY_STAGING }}
274274

275275
web:
276276
name: Build and deploy Web
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check consistency of search parser files
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches-ignore: [staging, production]
7+
paths:
8+
- "src/libs/SearchParser/**"
9+
10+
jobs:
11+
verify:
12+
if: github.actor != 'OSBotify' && github.actor != 'imgbot[bot]'
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: ./.github/actions/composite/setupNode
20+
21+
- name: Verify parser files consistency
22+
run: ./.github/scripts/checkParser.sh

Mobile-Expensify

0 commit comments

Comments
 (0)