Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/gijoe0295/App into gijoe/49093
Browse files Browse the repository at this point in the history
  • Loading branch information
gijoe0295 committed Nov 7, 2024
2 parents b382b17 + 5fa03b9 commit 93d97d1
Show file tree
Hide file tree
Showing 1,096 changed files with 33,840 additions and 16,967 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 .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ docs/assets/**
web/gtm.js
**/.expo/**
src/libs/SearchParser/searchParser.js
src/libs/SearchParser/autocompleteParser.js
help/_scripts/**
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ module.exports = {
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library', 'eslint-plugin-react-compiler', 'lodash', 'deprecation'],
ignorePatterns: ['lib/**'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: path.resolve(__dirname, './tsconfig.json'),
Expand Down Expand Up @@ -295,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>
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/Standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ ___
**Version Number:**
**Reproducible in staging?:**
**Reproducible in production?:**
**If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:**
**If this was caught during regression testing, add the test name, ID and link from TestRail:**
**Email or phone of affected tester (no customers):**
**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 All @@ -34,9 +35,11 @@ Can the user still use Expensify without this being fixed? Have you informed the
Check off any platforms that are affected by this issue
--->
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Native
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [ ] iOS: Native
- [ ] iOS: Standalone
- [ ] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Expand Down
8 changes: 5 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 @@ -51,7 +51,10 @@ For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image
It's acceptable to write "Same as tests" if the QA team is able to run the tests in the above "Tests" section.
--->
// TODO: These must be filled out, or the issue title must include "[No QA]."

- [ ] Verify that no errors appear in the JS console

Expand Down Expand Up @@ -79,7 +82,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
8 changes: 4 additions & 4 deletions .github/actions/composite/setupGitForOSBotify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ runs:
- name: Set up git for OSBotify
shell: bash
run: |
git config user.signingkey AEE1036472A782AB
git config commit.gpgsign true
git config user.name OSBotify
git config user.email [email protected]
git config --global user.signingkey AEE1036472A782AB
git config --global commit.gpgsign true
git config --global user.name OSBotify
git config --global user.email [email protected]
- name: Enable debug logs for git
shell: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ inputs:
ANDROID:
description: "Android job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
ANDROID_HYBRID:
description: "Android job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
DESKTOP:
description: "Desktop job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
IOS:
description: "iOS job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
IOS_HYBRID:
description: "iOS job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
WEB:
description: "Web job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12710,8 +12710,10 @@ async function run() {
const isProd = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', { required: true });
const version = core.getInput('DEPLOY_VERSION', { required: true });
const androidResult = getDeployTableMessage(core.getInput('ANDROID', { required: true }));
const androidHybridResult = getDeployTableMessage(core.getInput('ANDROID_HYBRID', { required: true }));
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', { required: true }));
const iOSResult = getDeployTableMessage(core.getInput('IOS', { required: true }));
const iOSHybridResult = getDeployTableMessage(core.getInput('IOS_HYBRID', { required: true }));
const webResult = getDeployTableMessage(core.getInput('WEB', { required: true }));
const date = core.getInput('DATE');
const note = core.getInput('NOTE');
Expand All @@ -12724,6 +12726,7 @@ async function run() {
message += `🚀`;
message += `\n\nplatform | result\n---|---\n🤖 android 🤖|${androidResult}\n🖥 desktop 🖥|${desktopResult}`;
message += `\n🍎 iOS 🍎|${iOSResult}\n🕸 web 🕸|${webResult}`;
message += `\n🤖🔄 android HybridApp 🤖🔄|${androidHybridResult}\n🍎🔄 iOS HybridApp 🍎🔄|${iOSHybridResult}`;
if (deployVerb === 'Cherry-picked' && !/no ?qa/gi.test(prTitle ?? '')) {
// eslint-disable-next-line max-len
message +=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ async function run() {
const version = core.getInput('DEPLOY_VERSION', {required: true});

const androidResult = getDeployTableMessage(core.getInput('ANDROID', {required: true}) as PlatformResult);
const androidHybridResult = getDeployTableMessage(core.getInput('ANDROID_HYBRID', {required: true}) as PlatformResult);
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', {required: true}) as PlatformResult);
const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true}) as PlatformResult);
const iOSHybridResult = getDeployTableMessage(core.getInput('IOS_HYBRID', {required: true}) as PlatformResult);
const webResult = getDeployTableMessage(core.getInput('WEB', {required: true}) as PlatformResult);

const date = core.getInput('DATE');
Expand All @@ -67,6 +69,7 @@ async function run() {
message += `🚀`;
message += `\n\nplatform | result\n---|---\n🤖 android 🤖|${androidResult}\n🖥 desktop 🖥|${desktopResult}`;
message += `\n🍎 iOS 🍎|${iOSResult}\n🕸 web 🕸|${webResult}`;
message += `\n🤖🔄 android HybridApp 🤖🔄|${androidHybridResult}\n🍎🔄 iOS HybridApp 🍎🔄|${iOSHybridResult}`;

if (deployVerb === 'Cherry-picked' && !/no ?qa/gi.test(prTitle ?? '')) {
// eslint-disable-next-line max-len
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
11 changes: 8 additions & 3 deletions .github/workflows/buildAndroid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ on:
description: The pull request number associated with this build, if relevant.
type: string
required: false

outputs:
AAB_FILE_NAME:
value: ${{ jobs.build.outputs.AAB_FILE_NAME }}
APK_FILE_NAME:
value: ${{ jobs.build.outputs.APK_FILE_NAME }}
APK_ARTIFACT_NAME:
value: ${{ jobs.build.outputs.APK_ARTIFACT_NAME }}

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -56,6 +59,7 @@ jobs:
outputs:
AAB_FILE_NAME: ${{ steps.build.outputs.AAB_FILE_NAME }}
APK_FILE_NAME: ${{ steps.build.outputs.APK_FILE_NAME }}
APK_ARTIFACT_NAME: ${{ steps.build.outputs.APK_ARTIFACT_NAME }}

steps:
- name: Checkout
Expand Down Expand Up @@ -159,28 +163,29 @@ 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-apk-artifact" >> "$GITHUB_OUTPUT"
} >> "$GITHUB_OUTPUT"
- name: Upload Android AAB artifact
if: ${{ steps.build.outputs.AAB_PATH != '' }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-prefix }}android-artifact-aab
name: ${{ inputs.artifact-prefix }}android-aab-artifact
path: ${{ steps.build.outputs.AAB_PATH }}

- name: Upload Android APK artifact
if: ${{ steps.build.outputs.APK_PATH != '' }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-prefix }}android-artifact-apk
name: ${{ steps.build.outputs.APK_ARTIFACT_NAME }}
path: ${{ steps.build.outputs.APK_PATH }}

- name: Upload Android sourcemaps artifact
if: ${{ steps.build.outputs.SHOULD_UPLOAD_SOURCEMAPS == 'true' }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-prefix }}android-artifact-sourcemaps
name: ${{ inputs.artifact-prefix }}android-sourcemaps-artifact
path: ./android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map
34 changes: 2 additions & 32 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,5 @@ on:

jobs:
CLA:
runs-on: ubuntu-latest
# This job only runs for pull request comments or pull request target events (not issue comments)
# It does not run for pull requests created by OSBotify
if: ${{ github.event.issue.pull_request || (github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'OSBotify' && github.event.pull_request.user.login != 'imgbot[bot]') }}
steps:
- name: CLA comment check
uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
id: sign
with:
text: ${{ github.event.comment.body }}
regex: '\s*I have read the CLA Document and I hereby sign the CLA\s*'
- name: CLA comment re-check
uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
id: recheck
with:
text: ${{ github.event.comment.body }}
regex: '\s*recheck\s*'
- name: CLA Assistant
if: ${{ steps.recheck.outputs.match != '' || steps.sign.outputs.match != '' || github.event_name == 'pull_request_target' }}
# Version: 2.1.2-beta
uses: cla-assistant/github-action@948230deb0d44dd38957592f08c6bd934d96d0cf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOTIFY_TOKEN }}
with:
path-to-signatures: '${{ github.repository }}/cla.json'
path-to-document: 'https://github.com/${{ github.repository }}/blob/main/contributingGuides/CLA.md'
branch: 'main'
remote-organization-name: 'Expensify'
remote-repository-name: 'CLA'
lock-pullrequest-aftermerge: false
allowlist: OSBotify,snyk-bot
uses: Expensify/GitHub-Actions/.github/workflows/cla.yml@main
secrets: inherit
89 changes: 89 additions & 0 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,92 @@ jobs:
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

createNewHybridVersion:
runs-on: macos-latest
needs: [validateActor, createNewVersion]
if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}
defaults:
run:
working-directory: Mobile-Expensify
steps:
- name: Run turnstyle
uses: softprops/turnstyle@49108bdfa571e62371bd2c3094893c547ab3fc03
with:
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Check out `App` repo
uses: actions/checkout@v4
with:
ref: main
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
# This is a workaround to allow pushes to a protected branch
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Check out `Mobile-Expensify` repo
uses: actions/checkout@v4
with:
repository: 'Expensify/Mobile-Expensify'
submodules: true
path: 'Mobile-Expensify'
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Update submodule
run: |
cd react-native
git submodule update --init
- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Generate HybridApp version
run: |
# Generate all flavors of the version
SHORT_APP_VERSION=$(echo "$NEW_VERSION" | awk -F'-' '{print $1}')
BUILD_NUMBER=$(echo "$NEW_VERSION" | awk -F'-' '{print $2}')
FULL_APP_VERSION="$SHORT_APP_VERSION.$BUILD_NUMBER"
ANDROID_VERSION_CODE=$(echo "$FULL_APP_VERSION" | ruby -e "puts '05%02d%02d%02d%02d' % STDIN.read.split('.')")
# File paths to update
ANDROID_MANIFEST_FILE="Android/AndroidManifest.xml"
IOS_INFO_PLIST_FILE="iOS/Expensify/Expensify-Info.plist"
IOS_SHARE_EXTENSION_PLIST_FILE="iOS/SmartScanExtension/Info.plist"
JS_CONFIG_FILE="app/config/config.json"
# Update Android HybridApp Version
sed -i .bak -E "s/versionName=\"([0-9\.]*)\"/versionName=\"$FULL_APP_VERSION\"/" $ANDROID_MANIFEST_FILE
sed -i .bak -E "s/versionCode=\"([0-9]*)\"/versionCode=\"$ANDROID_VERSION_CODE\"/" $ANDROID_MANIFEST_FILE
# Update iOS HybridApp Version
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_APP_VERSION" $IOS_INFO_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_INFO_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_APP_VERSION" $IOS_SHARE_EXTENSION_PLIST_FILE
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $FULL_APP_VERSION" $IOS_SHARE_EXTENSION_PLIST_FILE
# Update JS HybridApp Version
sed -i .bak -E "s/\"version\": \"([0-9\.]*)\"/\"version\": \"$FULL_APP_VERSION\"/" $JS_CONFIG_FILE
env:
NEW_VERSION: ${{ needs.createNewVersion.outputs.NEW_VERSION }}

- name: Commit new version
run: |
git add \
./Android/AndroidManifest.xml \
./app/config/config.json \
./iOS/Expensify/Expensify-Info.plist\
./iOS/SmartScanExtension/Info.plist
git commit -m "Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
- name: Update main branch
run: git push origin main

- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Loading

0 comments on commit 93d97d1

Please sign in to comment.