Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into new-places-api-support
Browse files Browse the repository at this point in the history
  • Loading branch information
rojiphil authored Sep 27, 2024
2 parents 67cc635 + 33818a9 commit 9a75de7
Show file tree
Hide file tree
Showing 349 changed files with 5,024 additions and 4,807 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = {
'plugin:you-dont-need-lodash-underscore/all',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library', 'eslint-plugin-react-compiler', 'lodash'],
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: {
Expand Down Expand Up @@ -177,6 +177,7 @@ module.exports = {
// ESLint core rules
'es/no-nullish-coalescing-operators': 'off',
'es/no-optional-chaining': 'off',
'deprecation/deprecation': 'off',

// Import specific rules
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ inputs:
GITHUB_TOKEN:
description: "Github token for authentication"
required: true
default: "${{ github.token }}"
ANDROID:
description: "Android job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
Expand All @@ -27,6 +26,12 @@ inputs:
WEB:
description: "Web job result ('success', 'failure', 'cancelled', or 'skipped')"
required: true
DATE:
description: "The date of deployment"
required: false
NOTE:
description: "Additional note from the deployer"
required: false
runs:
using: "node20"
main: "./index.js"
11 changes: 10 additions & 1 deletion .github/actions/javascript/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12713,16 +12713,25 @@ async function run() {
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', { required: true }));
const iOSResult = getDeployTableMessage(core.getInput('IOS', { required: true }));
const webResult = getDeployTableMessage(core.getInput('WEB', { required: true }));
const date = core.getInput('DATE');
const note = core.getInput('NOTE');
function getDeployMessage(deployer, deployVerb, prTitle) {
let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`;
message += ` by https://github.com/${deployer} in version: ${version} 🚀`;
message += ` by https://github.com/${deployer} in version: ${version} `;
if (date) {
message += `on ${date}`;
}
message += `🚀`;
message += `\n\nplatform | result\n---|---\n🤖 android 🤖|${androidResult}\n🖥 desktop 🖥|${desktopResult}`;
message += `\n🍎 iOS 🍎|${iOSResult}\n🕸 web 🕸|${webResult}`;
if (deployVerb === 'Cherry-picked' && !/no ?qa/gi.test(prTitle ?? '')) {
// eslint-disable-next-line max-len
message +=
'\n\n@Expensify/applauseleads please QA this PR and check it off on the [deploy checklist](https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3AStagingDeployCash) if it passes.';
}
if (note) {
message += `\n\n_Note:_ ${note}`;
}
return message;
}
if (isProd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ async function run() {
const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true}) as PlatformResult);
const webResult = getDeployTableMessage(core.getInput('WEB', {required: true}) as PlatformResult);

const date = core.getInput('DATE');
const note = core.getInput('NOTE');

function getDeployMessage(deployer: string, deployVerb: string, prTitle?: string): string {
let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`;
message += ` by https://github.com/${deployer} in version: ${version} 🚀`;
message += ` by https://github.com/${deployer} in version: ${version} `;
if (date) {
message += `on ${date}`;
}
message += `🚀`;
message += `\n\nplatform | result\n---|---\n🤖 android 🤖|${androidResult}\n🖥 desktop 🖥|${desktopResult}`;
message += `\n🍎 iOS 🍎|${iOSResult}\n🕸 web 🕸|${webResult}`;

Expand All @@ -67,6 +74,10 @@ async function run() {
'\n\n@Expensify/applauseleads please QA this PR and check it off on the [deploy checklist](https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3AStagingDeployCash) if it passes.';
}

if (note) {
message += `\n\n_Note:_ ${note}`;
}

return message;
}

Expand Down
38 changes: 9 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -649,34 +649,14 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

postGithubComment:
name: Post a GitHub comments on all deployed PRs when platforms are done building and deploying
runs-on: ubuntu-latest
postGithubComments:
uses: ./.github/workflows/postDeployComments.yml
if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
needs: [prep, android, desktop, iOS, web, checkDeploymentSuccess, createPrerelease, finalizeRelease]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Get Release Pull Request List
id: getReleasePRList
uses: ./.github/actions/javascript/getDeployPullRequestList
with:
TAG: ${{ needs.prep.outputs.APP_VERSION }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}

- name: Comment on issues
uses: ./.github/actions/javascript/markPullRequestsAsDeployed
with:
PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }}
IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
DEPLOY_VERSION: ${{ needs.prep.outputs.APP_VERSION }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
ANDROID: ${{ needs.android.result }}
DESKTOP: ${{ needs.desktop.result }}
IOS: ${{ needs.iOS.result }}
WEB: ${{ needs.web.result }}
with:
version: ${{ needs.prep.outputs.APP_VERSION }}
env: ${{ github.ref == 'refs/heads/production' && 'production' || 'staging' }}
android: ${{ needs.android.result }}
ios: ${{ needs.iOS.result }}
web: ${{ needs.web.result }}
desktop: ${{ needs.desktop.result }}
118 changes: 118 additions & 0 deletions .github/workflows/postDeployComments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Post Deploy Comments

on:
workflow_call:
inputs:
version:
description: The version that was deployed
required: true
type: string
env:
description: The environment that was deployed (staging or prod)
required: true
type: string
android:
description: Android deploy status
required: true
type: string
ios:
description: iOS deploy status
required: true
type: string
web:
description: Web deploy status
required: true
type: string
desktop:
description: Desktop deploy status
required: true
type: string
workflow_dispatch:
inputs:
version:
description: The version that was deployed
required: true
type: string
env:
description: The environment that was deployed (staging or prod)
required: true
type: choice
options:
- staging
- production
android:
description: Android deploy status
required: true
type: choice
options:
- success
- failure
- cancelled
- skipped
ios:
description: iOS deploy status
required: true
type: choice
options:
- success
- failure
- cancelled
- skipped
web:
description: Web deploy status
required: true
type: choice
options:
- success
- failure
- cancelled
- skipped
desktop:
description: Desktop deploy status
required: true
type: choice
options:
- success
- failure
- cancelled
- skipped
date:
description: The date when this deploy occurred
required: false
type: string
note:
description: Any additional note you want to include with the deploy comment
required: false
type: string

jobs:
postDeployComments:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Get pull request list
id: getPullRequestList
uses: ./.github/actions/javascript/getDeployPullRequestList
with:
TAG: ${{ inputs.version }}
GITHUB_TOKEN: ${{ github.token }}
IS_PRODUCTION_DEPLOY: ${{ inputs.env == 'production' }}

- name: Comment on issues
uses: ./.github/actions/javascript/markPullRequestsAsDeployed
with:
PR_LIST: ${{ steps.getPullRequestList.outputs.PR_LIST }}
IS_PRODUCTION_DEPLOY: ${{ inputs.env == 'production' }}
DEPLOY_VERSION: ${{ inputs.version }}
GITHUB_TOKEN: ${{ github.token }}
ANDROID: ${{ inputs.android }}
DESKTOP: ${{ inputs.desktop }}
IOS: ${{ inputs.ios }}
WEB: ${{ inputs.web }}
DATE: ${{ inputs.date }}
NOTE: ${{ inputs.note }}
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,30 @@ Some pointers:
key to the translation file and use the arrow function version, like so:
`nameOfTheKey: ({amount, dateTime}) => "User has sent " + amount + " to you on " + dateTime,`.
This is because the order of the phrases might vary from one language to another.
- When working with translations that involve plural forms, it's important to handle different cases correctly.

For example:
- zero: Used when there are no items **(optional)**.
- one: Used when there's exactly one item.
- two: Used when there's two items. **(optional)**
- few: Used for a small number of items **(optional)**.
- many: Used for larger quantities **(optional)**.
- other: A catch-all case for other counts or variations.

Here’s an example of how to implement plural translations:

messages: () => ({
zero: 'No messages',
one: 'One message',
two: 'Two messages',
few: (count) => `${count} messages`,
many: (count) => `You have ${count} messages`,
other: (count) => `You have ${count} unread messages`,
})

In your code, you can use the translation like this:

`translate('common.messages', {count: 1});`
----

# Deploying
Expand Down
5 changes: 5 additions & 0 deletions __mocks__/react-native-haptic-feedback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type HapticFeedback from 'react-native-haptic-feedback';

const RNHapticFeedback: typeof HapticFeedback = {trigger: jest.fn()};

export default RNHapticFeedback;
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009003900
versionName "9.0.39-0"
versionCode 1009004004
versionName "9.0.40-4"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ buildscript {
classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1")
classpath("com.google.firebase:perf-plugin:1.4.1")
// Fullstory integration
classpath ("com.fullstory:gradle-plugin-local:1.49.0")
classpath ("com.fullstory:gradle-plugin-local:1.52.0")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ MYAPP_UPLOAD_KEY_ALIAS=ReactNativeChat-Key-Alias
disableFrameProcessors=true

android.nonTransitiveRClass=false

org.gradle.parallel=true
Loading

0 comments on commit 9a75de7

Please sign in to comment.