Skip to content

Commit

Permalink
Merge branch 'main' into CortneyOfstad-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
lakchote committed Jan 31, 2025
2 parents 437ec2b + 49128c8 commit 8f00a15
Show file tree
Hide file tree
Showing 704 changed files with 19,445 additions and 12,507 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ EXPENSIFY_ACCOUNT_ID_RECEIPTS=-1
EXPENSIFY_ACCOUNT_ID_REWARDS=-1
EXPENSIFY_ACCOUNT_ID_STUDENT_AMBASSADOR=-1
EXPENSIFY_ACCOUNT_ID_SVFG=-1
EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST=-1

FB_API_KEY=YOUR_API_KEY
FB_APP_ID=YOUR_APP_ID
Expand Down
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
12 changes: 0 additions & 12 deletions .eslintrc.changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ module.exports = {
],
},
overrides: [
{
files: [
'src/libs/actions/IOU.ts',
'src/libs/actions/Report.ts',
'src/pages/workspace/WorkspaceInitialPage.tsx',
'src/pages/home/report/PureReportActionItem.tsx',
'src/libs/SidebarUtils.ts',
],
rules: {
'rulesdir/no-default-id-values': 'off',
},
},
{
files: ['**/libs/**/*.{ts,tsx}'],
rules: {
Expand Down
22 changes: 21 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ const path = require('path');
const restrictedImportPaths = [
{
name: 'react-native',
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', 'Text', 'ScrollView'],
importNames: [
'useWindowDimensions',
'StatusBar',
'TouchableOpacity',
'TouchableWithoutFeedback',
'TouchableNativeFeedback',
'TouchableHighlight',
'Pressable',
'Text',
'ScrollView',
'Animated',
],
message: [
'',
"For 'useWindowDimensions', please use '@src/hooks/useWindowDimensions' instead.",
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from '@components/Pressable' instead.",
"For 'StatusBar', please use '@libs/StatusBar' instead.",
"For 'Text', please use '@components/Text' instead.",
"For 'ScrollView', please use '@components/ScrollView' instead.",
"For 'Animated', please use 'Animated' from 'react-native-reanimated' instead.",
].join('\n'),
},
{
Expand Down Expand Up @@ -75,6 +87,10 @@ const restrictedImportPaths = [
importNames: ['memoize'],
message: "Please use '@src/libs/memoize' instead.",
},
{
name: 'react-native-animatable',
message: "Please use 'react-native-reanimated' instead.",
},
];

const restrictedImportPatterns = [
Expand Down Expand Up @@ -134,6 +150,10 @@ module.exports = {
{
selector: ['variable', 'property'],
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
filter: {
regex: '^private_[a-z][a-zA-Z0-9]+$',
match: false,
},
},
{
selector: 'function',
Expand Down
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/TooltipsTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: 'Tooltips Template'
about: Create this issue when adding a new tooltip to New Expensify
labels: Daily, Design, WaitingForCopy
title: 'Tooltips Template'
---
Refer to https://stackoverflowteams.com/c/expensify/questions/20762 for the full process to add a tooltip.

### Problem
Enter the problem that currently exists without the tooltip.

### Solution
Enter the solution that implementing the tooltip will achieve.

### What is the purpose of the tooltip?
Enter the purpose.

### How should the tooltip look
Add the Figma Mock Up that Design builds.

### Condition
We should show this tooltip to:

### Decide the prioritisation

Priority score:

NOTE: Only one tooltip is shown at a time.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ $
PROPOSAL:


<!---
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please specify it like follows:
MOBILE-EXPENSIFY: PR number
--->

### Tests
<!---
Add a numbered list of manual tests you performed that validates your changes work on all platforms, and that there are no regressions present.
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ runs:
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json', 'patches/**') }}

key: ${{ inputs.IS_HYBRID_BUILD == 'true' && format('{0}-node-modules-{1}', runner.os, hashFiles('package-lock.json', 'patches/**', 'Mobile-Expensify/patches/**')) || format('{0}-node-modules-{1}', runner.os, hashFiles('package-lock.json', 'patches/**'))}}
- id: cache-old-dot-node-modules
if: inputs.IS_HYBRID_BUILD == 'true'
uses: actions/cache@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/javascript/proposalPoliceComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18007,6 +18007,11 @@ async function run() {
console.log('Comment body is either empty or doesn\'t contain the keyword "Proposal": ', payload.comment?.body);
return;
}
// If event is `edited` and comment was already edited by the bot, return early
if (isCommentEditedEvent(payload) && payload.comment?.body.trim().includes('Edited by **proposal-police**')) {
console.log('Comment was already edited by proposal-police once.\n', payload.comment?.body);
return;
}
console.log('ProposalPolice™ Action triggered for comment:', payload.comment?.body);
console.log('-> GitHub Action Type: ', payload.action?.toUpperCase());
if (!isCommentCreatedEvent(payload) && !isCommentEditedEvent(payload)) {
Expand All @@ -18033,12 +18038,7 @@ async function run() {
if (isCommentCreatedEvent(payload) && isActionRequired) {
const formattedResponse = message
// replace {user} from response template with @username
.replaceAll('{user}', `@${payload.comment?.user.login}`)
// replace {proposalLink} from response template with the link to the comment
.replaceAll('{proposalLink}', payload.comment?.html_url)
// remove any double quotes from the final comment because sometimes the assistant's
// response contains double quotes / sometimes it doesn't
.replaceAll('"', '');
.replaceAll('{user}', `@${payload.comment?.user.login}`);
// Create a comment with the assistant's response
console.log('ProposalPolice™ commenting on issue...');
await GithubUtils_1.default.createComment(CONST_1.default.APP_REPO, github_1.context.issue.number, formattedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ async function run() {
return;
}

// If event is `edited` and comment was already edited by the bot, return early
if (isCommentEditedEvent(payload) && payload.comment?.body.trim().includes('Edited by **proposal-police**')) {
console.log('Comment was already edited by proposal-police once.\n', payload.comment?.body);
return;
}

console.log('ProposalPolice™ Action triggered for comment:', payload.comment?.body);
console.log('-> GitHub Action Type: ', payload.action?.toUpperCase());

Expand Down Expand Up @@ -73,14 +79,7 @@ async function run() {
if (isCommentCreatedEvent(payload) && isActionRequired) {
const formattedResponse = message
// replace {user} from response template with @username
.replaceAll('{user}', `@${payload.comment?.user.login}`)

// replace {proposalLink} from response template with the link to the comment
.replaceAll('{proposalLink}', payload.comment?.html_url)

// remove any double quotes from the final comment because sometimes the assistant's
// response contains double quotes / sometimes it doesn't
.replaceAll('"', '');
.replaceAll('{user}', `@${payload.comment?.user.login}`);

// Create a comment with the assistant's response
console.log('ProposalPolice™ commenting on issue...');
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ The GitHub workflows require a large list of secrets to deploy, notify and test
1. `CSC_LINK` - Required to be set for desktop code signing: https://www.electron.build/code-signing.html#travis-appveyor-and-other-ci-servers
1. `CSC_KEY_PASSWORD` - Required to be set for desktop code signing: https://www.electron.build/code-signing.html#travis-appveyor-and-other-ci-servers
1. `APPLE_ID` - Required for notarizing desktop code in `desktop/notarize.js`
1. `APPLE_TEAM_ID` - Required for notarizing desktop code in `desktop/notarize.js`
1. `APPLE_ID_PASSWORD` - Required for notarizing desktop code in `desktop/notarize.js`
1. `AWS_ACCESS_KEY_ID` - Required for hosting website and desktop compiled code
1. `AWS_SECRET_ACCESS_KEY` - Required for hosting website and desktop compiled code
Expand Down
1 change: 1 addition & 0 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
27 changes: 0 additions & 27 deletions .github/workflows/commentOnNativeFileChanged.yml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/compareNDandODbuilds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Build and profile Android apps

on:
workflow_dispatch:

jobs:
buildHybridAppAndroid:
name: Build HybridApp Android
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Update submodule to match main
run: |
git submodule update --init --remote
cd Mobile-Expensify
git fetch
git checkout main
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

- name: Setup Node
id: setup-node
uses: ./.github/actions/composite/setupNode
with:
IS_HYBRID_BUILD: 'true'

- name: Run grunt build
run: |
cd Mobile-Expensify
npm run grunt:build:shared
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'

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

- name: Install New Expensify Gems
run: bundle install

- name: Install 1Password CLI
uses: 1password/install-cli-action@v1

- name: Load files from 1Password
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
run: |
op document get --output ./upload-key.keystore upload-key.keystore
op document get --output ./android-fastlane-json-key.json android-fastlane-json-key.json
# Copy the keystore to the Android directory for Fullstory
cp ./upload-key.keystore Mobile-Expensify/Android
- name: Load Android upload keystore credentials from 1Password
id: load-credentials
uses: 1password/load-secrets-action@v2
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
ANDROID_UPLOAD_KEYSTORE_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_PASSWORD
ANDROID_UPLOAD_KEYSTORE_ALIAS: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_ALIAS
ANDROID_UPLOAD_KEY_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEY_PASSWORD

- name: Build Android Release
working-directory: Mobile-Expensify/Android
run: |
./gradlew --profile assembleRelease \
-Pandroid.injected.signing.store.file="./upload-key.keystore" \
-Pandroid.injected.signing.store.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} \
-Pandroid.injected.signing.key.alias=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} \
-Pandroid.injected.signing.key.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }}
echo "Printing Gradle profile report:"
# Print the latest generated profile report
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
cat "$PROFILE_REPORT"
buildStandaloneAndroid:
name: Build Standalone Android
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

- name: Setup Node
id: setup-node
uses: ./.github/actions/composite/setupNode
with:
IS_HYBRID_BUILD: 'false'

- name: Decrypt keystore to sign the APK/AAB
run: gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output my-upload-key.keystore my-upload-key.keystore.gpg
working-directory: android/app

- name: Build Android Release
working-directory: android
env:
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
run: |
./gradlew --profile assembleProductionRelease
echo "Printing Gradle profile report:"
# Print the latest generated profile report
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
cat "$PROFILE_REPORT"
Loading

0 comments on commit 8f00a15

Please sign in to comment.