Skip to content

Commit

Permalink
Merge branch 'main' into 27393-displayName_fallback_to_hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorawski committed Oct 19, 2023
2 parents a3f64d6 + ef75eca commit 9ac720f
Show file tree
Hide file tree
Showing 652 changed files with 24,908 additions and 11,935 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports = {
},
{
selector: ['parameter', 'method'],
format: ['camelCase'],
format: ['camelCase', 'PascalCase'],
},
],
'@typescript-eslint/ban-types': [
Expand Down
25 changes: 3 additions & 22 deletions .github/actions/composite/setupGitForOSBotify/action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
name: "Setup Git for OSBotify"
description: "Setup Git for OSBotify"
name: 'Setup Git for OSBotify'
description: 'Setup Git for OSBotify'

inputs:
GPG_PASSPHRASE:
description: "Passphrase used to decrypt GPG key"
required: true
OS_BOTIFY_APP_ID:
description: "Application ID for OS Botify"
required: true
OS_BOTIFY_PRIVATE_KEY:
description: "OS Botify's private key"
description: 'Passphrase used to decrypt GPG key'
required: true

outputs:
# Do not try to use this for committing code. Use `secrets.OS_BOTIFY_COMMIT_TOKEN` instead
OS_BOTIFY_API_TOKEN:
description: Token to use for GitHub API interactions.
value: ${{ steps.generateToken.outputs.token }}

runs:
using: composite
steps:
Expand All @@ -41,10 +29,3 @@ runs:
shell: bash
if: runner.debug == '1'
run: echo "GIT_TRACE=true" >> "$GITHUB_ENV"

- name: Generate a token
id: generateToken
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: ${{ inputs.OS_BOTIFY_APP_ID }}
private_key: ${{ inputs.OS_BOTIFY_PRIVATE_KEY }}
53 changes: 53 additions & 0 deletions .github/actions/composite/setupGitForOSBotifyApp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This is a duplicate for setupGitForOSBotify except we are using a Github App now for Github Authentication.
# GitHub Apps have higher rate limits. The reason this is being duplicated is because the existing action is still in use
# in open PRs/branches that aren't up to date with main and it ends up breaking action workflows as a result.
name: "Setup Git for OSBotify"
description: "Setup Git for OSBotify"

inputs:
GPG_PASSPHRASE:
description: "Passphrase used to decrypt GPG key"
required: true
OS_BOTIFY_APP_ID:
description: "Application ID for OS Botify"
required: true
OS_BOTIFY_PRIVATE_KEY:
description: "OS Botify's private key"
required: true

outputs:
# Do not try to use this for committing code. Use `secrets.OS_BOTIFY_COMMIT_TOKEN` instead
OS_BOTIFY_API_TOKEN:
description: Token to use for GitHub API interactions.
value: ${{ steps.generateToken.outputs.token }}

runs:
using: composite
steps:
- name: Decrypt OSBotify GPG key
run: cd .github/workflows && gpg --quiet --batch --yes --decrypt --passphrase=${{ inputs.GPG_PASSPHRASE }} --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
shell: bash

- name: Import OSBotify GPG Key
shell: bash
run: cd .github/workflows && gpg --import OSBotify-private-key.asc

- name: Set up git for OSBotify
shell: bash
run: |
git config user.signingkey 367811D53E34168C
git config commit.gpgsign true
git config user.name OSBotify
git config user.email infra+osbotify@expensify.com
- name: Enable debug logs for git
shell: bash
if: runner.debug == '1'
run: echo "GIT_TRACE=true" >> "$GITHUB_ENV"

- name: Generate a token
id: generateToken
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: ${{ inputs.OS_BOTIFY_APP_ID }}
private_key: ${{ inputs.OS_BOTIFY_PRIVATE_KEY }}
11 changes: 8 additions & 3 deletions .github/scripts/findUnusedKeys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIB_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../../ && pwd)"

readonly SRC_DIR="${LIB_PATH}/src"
readonly STYLES_DIR="${LIB_PATH}/src/styles"
readonly STYLES_FILE="${LIB_PATH}/src/styles/styles.js"
readonly STYLES_FILE="${LIB_PATH}/src/styles/styles.ts"
readonly UTILITIES_STYLES_FILE="${LIB_PATH}/src/styles/utilities"
readonly STYLES_KEYS_FILE="${LIB_PATH}/scripts/style_keys_list_temp.txt"
readonly UTILITY_STYLES_KEYS_FILE="${LIB_PATH}/scripts/utility_keys_list_temp.txt"
Expand Down Expand Up @@ -210,7 +210,12 @@ find_theme_style_and_store_keys() {
fi

# Check if we are inside an arrow function
if [[ "$line" =~ ^[[:space:]]*([a-zA-Z0-9_-])+:[[:space:]]*\(.*\)[[:space:]]*'=>'[[:space:]]*\(\{ || "$line" =~ ^[[:space:]]*(const|let|var)[[:space:]]+([a-zA-Z0-9_-]+)[[:space:]]*=[[:space:]]*\(.*\)[[:space:]]*'=>' ]]; then
if [[ "$line" =~ ^[[:space:]]*([a-zA-Zgv 0-9_-])+:[[:space:]]*\(.*\)[[:space:]]*'=>'[[:space:]]*\(\{ || "$line" =~ ^[[:space:]]*([a-zA-Zgv 0-9_-])+:[[:space:]]*\(.*\)[[:space:]]*'=>' ]]; then
inside_arrow_function=true
continue
fi

if [[ "$line" =~ ^[[:space:]]*(const|let|var)[[:space:]]+([a-zA-Z0-9_-]+)[[:space:]]*=[[:space:]]*\(.*\)[[:space:]]*'=>' ]]; then
inside_arrow_function=true
continue
fi
Expand Down Expand Up @@ -348,7 +353,7 @@ echo "🔍 Looking for styles."
find_utility_styles_store_prefix
find_utility_usage_as_styles

# Find and store keys from styles.js
# Find and store keys from styles.ts
find_styles_object_and_store_keys "$STYLES_FILE"
find_styles_functions_and_store_keys "$STYLES_FILE"
collect_theme_keys_from_styles "$STYLES_FILE"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
validateActor:
runs-on: ubuntu-latest
outputs:
IS_DEPLOYER: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) || github.actor == 'OSBotify' }}
IS_DEPLOYER: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) || github.actor == 'OSBotify' || github.actor == 'os-botify[bot]' }}
steps:
- name: Check if user is deployer
id: isDeployer
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Set up git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/staging'
steps:
- uses: ./.github/actions/composite/setupGitForOSBotify
- name: Checkout staging branch
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Checkout staging branch
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: staging
token: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

- name: Tag version
run: git tag "$(npm run print-version --silent)"

Expand All @@ -32,20 +32,19 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/production'
steps:
- uses: ./.github/actions/composite/setupGitForOSBotify
- uses: actions/checkout@v3
name: Checkout
with:
ref: production
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: production
token: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

- name: Get current app version
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"

Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,15 @@ jobs:
if: ${{ always() && runner.debug != null && fromJSON(runner.debug) }}
run: cat "./Host_Machine_Files/\$WORKING_DIRECTORY/debug.log"

- name: Check if test failed, if so post the results and add the DeployBlocker label
run: |
if grep -q '🔴' ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md; then
gh pr edit ${{ inputs.PR_NUMBER }} --add-label DeployBlockerCash
gh pr comment ${{ inputs.PR_NUMBER }} -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md
gh pr comment ${{ inputs.PR_NUMBER }} -b "@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker."
else
echo '✅ no performance regression detected'
fi
env:
GITHUB_TOKEN: ${{ github.token }}
# TODO: Once tests are more reliable we should uncomment this
# - name: Check if test failed, if so post the results and add the DeployBlocker label
# run: |
# if grep -q '🔴' ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md; then
# gh pr edit ${{ inputs.PR_NUMBER }} --add-label DeployBlockerCash
# gh pr comment ${{ inputs.PR_NUMBER }} -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md
# gh pr comment ${{ inputs.PR_NUMBER }} -b "@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker."
# else
# echo '✅ no performance regression detected'
# fi
# env:
# GITHUB_TOKEN: ${{ github.token }}
20 changes: 13 additions & 7 deletions .github/workflows/finishReleaseCycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ jobs:
outputs:
isValid: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) && !fromJSON(steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS) }}
steps:
- uses: ./.github/actions/composite/setupGitForOSBotify
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
Expand All @@ -28,13 +34,13 @@ jobs:
echo "IS_DEPLOYER=false" >> "$GITHUB_OUTPUT"
fi
env:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Reopen and comment on issue (not a team member)
if: ${{ !fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) }}
uses: Expensify/App/.github/actions/javascript/reopenIssueWithComment@main
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
COMMENT: |
Sorry, only members of @Expensify/Mobile-Deployers can close deploy checklists.
Expand All @@ -45,14 +51,14 @@ jobs:
id: checkDeployBlockers
uses: Expensify/App/.github/actions/javascript/checkDeployBlockers@main
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}

- name: Reopen and comment on issue (has blockers)
if: ${{ fromJSON(steps.isDeployer.outputs.IS_DEPLOYER) && fromJSON(steps.checkDeployBlockers.outputs.HAS_DEPLOY_BLOCKERS || 'false') }}
uses: Expensify/App/.github/actions/javascript/reopenIssueWithComment@main
with:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
COMMENT: |
This issue either has unchecked items or has not yet been marked with the `:shipit:` emoji of approval.
Expand All @@ -78,7 +84,7 @@ jobs:

- name: Setup Git for OSBotify
id: setupGitForOSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
Expand Down Expand Up @@ -119,7 +125,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Setup Git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
validateActor:
runs-on: ubuntu-latest
outputs:
IS_DEPLOYER: ${{ fromJSON(steps.isUserDeployer.outputs.IS_DEPLOYER) || github.actor == 'OSBotify' }}
IS_DEPLOYER: ${{ fromJSON(steps.isUserDeployer.outputs.IS_DEPLOYER) || github.actor == 'OSBotify' || github.actor == 'os-botify[bot]' }}
steps:
- name: Check if user is deployer
id: isUserDeployer
Expand Down Expand Up @@ -104,6 +104,13 @@ jobs:
name: android-sourcemap
path: android/app/build/generated/sourcemaps/react/release/*.map

- name: Upload Android version to GitHub artifacts
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: actions/upload-artifact@v3
with:
name: app-production-release.aab
path: android/app/build/outputs/bundle/productionRelease/app-production-release.aab

- name: Upload Android version to Browser Stack
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@./android/app/build/outputs/bundle/productionRelease/app-production-release.aab"
Expand Down Expand Up @@ -238,6 +245,13 @@ jobs:
name: ios-sourcemap
path: main.jsbundle.map

- name: Upload iOS version to GitHub artifacts
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: actions/upload-artifact@v3
with:
name: New Expensify.ipa
path: /Users/runner/work/App/App/New Expensify.ipa

- name: Upload iOS version to Browser Stack
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/Users/runner/work/App/App/New Expensify.ipa"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Setup Git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotify
uses: Expensify/App/.github/actions/composite/setupGitForOSBotifyApp@8c19d6da4a3d7ce3b15c9cd89a802187d208ecab
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
Expand Down
7 changes: 7 additions & 0 deletions .storybook/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
src: url('../assets/fonts/web/ExpensifyMono-Bold.woff2') format('woff2'), url('../assets/fonts/web/ExpensifyMono-Bold.woff') format('woff');
}

@font-face {
font-family: ExpensifyNewKansas-Medium;
font-weight: 400;
font-style: normal;
src: url('../assets/fonts/web/ExpensifyNewKansas-Medium.woff2') format('woff2'), url('../assets/fonts/web/ExpensifyNewKansas-Medium.woff') format('woff');
}

* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down
8 changes: 8 additions & 0 deletions .well-known/apple-app-site-association
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
{
"/": "/search/*",
"comment": "Search"
},
{
"/": "/send/*",
"comment": "Send money"
},
{
"/": "/money2020/*",
"comment": "Money 2020"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="https://raw.githubusercontent.com/Expensify/App/main/web/favicon.png" width="64" height="64" alt="New Expensify Icon">
</a>
<h1>
<a href="https://new.expensify.com/">
<a href="https://new.expensify.com">
New Expensify
</a>
</h1>
Expand Down
1 change: 1 addition & 0 deletions __mocks__/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jest.doMock('react-native', () => {
BootSplash: {
getVisibilityStatus: jest.fn(),
hide: jest.fn(),
logoSizeRatio: 1,
navigationBarHeight: 0,
},
StartupTimer: {stop: jest.fn()},
Expand Down
Loading

0 comments on commit 9ac720f

Please sign in to comment.