Skip to content

Commit

Permalink
Merge branch 'main' into fix/42165
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed Nov 3, 2024
2 parents 67f3398 + bef062b commit 08e5e6a
Show file tree
Hide file tree
Showing 499 changed files with 9,286 additions and 8,256 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
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
6 changes: 3 additions & 3 deletions .github/workflows/buildAndroid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ 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
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
Expand All @@ -187,5 +187,5 @@ jobs:
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
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 08e5e6a

Please sign in to comment.