Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into twizzyindy-accessibil…
Browse files Browse the repository at this point in the history
…ityImprovements
  • Loading branch information
TwizzyIndy committed Jun 8, 2021
2 parents a0a574d + 790a754 commit 5443259
Show file tree
Hide file tree
Showing 18 changed files with 420 additions and 61 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,43 @@ This application is built with the following principles.
----

# Deploying
## Continuous deployment / GitHub workflows
Every PR merged into `main` will kick off the **Create a new version** GitHub workflow defined in `.github/workflows/version.yml`.
It will look at the current version and increment it by one build version (using [`react-native-version`](https://www.npmjs.com/package/react-native-version)), create a PR with that new version, and tag the version.
## QA and deploy cycles
We utilize a CI/CD deployment system built using [GitHub Actions](https://github.com/features/actions) to ensure that new code is automatically deployed to our users as fast as possible. As part of this process, all code is first deployed to our staging environments, where it undergoes quality assurance (QA) testing before it is deployed to production. Typically, pull requests are deployed to staging immediately after they are merged.

The PR will be merged automatically by the GitHub workflow **automerge** to keep the version always up to date.
Every time a PR is deployed to staging, it is added to a [special tracking issue](https://github.com/Expensify/Expensify.cash/issues?q=is%3Aopen+is%3Aissue+label%3AStagingDeployCash) with the label `StagingDeployCash` (there will only ever be one open at a time). This tracking issue contains information about the new application version, a list of recently deployed pull requests, and any issues found on staging that are not present on production. Every weekday at 9am PST, our QA team adds the `🔐LockCashDeploys🔐` label to that tracking issue, and that signifies that they are starting their daily QA cycle. They will perform both regular regression testing and the QA steps listed for every pull request on the `StagingDeployCash` checklist.

When a new tag is pushed, it will trigger a deploy of all four clients:
1. The **web** app automatically deploys via a GitHub Action in `.github/workflows/main.yml`
2. The **MacOS desktop** app automatically deploys via a GitHub Action in `.github/workflows/desktop.yml`
3. The **Android** app automatically deploys via a GitHub Action in `.github/workflows/android.yml`
4. The **iOS** app automatically deploys via a GitHub Action in `.github/workflows/ios.yml`
Once the `StagingDeployCash` is locked, we won't run any staging deploys until it is either unlocked, or we run a production deploy. If severe issues are found on staging that are not present on production, a new issue (or the PR that caused the issue) will be labeled with `DeployBlockerCash`, and added to the `StagingDeployCash` deploy checklist. If we want to resolve a deploy blocker by reverting a pull request or deploying a hotfix directly to the staging environment, we can merge a pull request with the `CP Staging` label.

## Local production build
Once we have confirmed to the best of our ability that there are no deploy-blocking issues and that all our new features are working as expected on staging, we'll close the `StagingDeployCash`. That will automatically trigger a production deployment, open a new `StagingDeployCash` checklist, and deploy to staging any pull requests that were merged while the previous checklist was locked.

## Key GitHub workflows
These are some of the most central [GitHub Workflows](https://github.com/Expensify/Expensify.cash/tree/main/.github/workflows). There is more detailed information in the README [here](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/README.md).

### preDeploy
The [preDeploy workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/preDeploy.yml) executes whenever a pull request is merged to `main`, and at a high level does the following:

- If the `StagingDeployCash` is locked, comment on the merged PR that it will be deployed later.
- Otherwise:
- Create a new version by triggering the [`createNewVersion` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/createNewVersion.yml)
- Use the [`updateProtectedBranch` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/updateProtectedBranch.yml) to update the `staging` branch.
- Also, if the pull request has the `CP Staging` label, it will execute the [`cherryPick` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/cherryPick.yml) to deploy the pull request directly to staging, even if the `StagingDeployCash` is locked

### deploy
The [`deploy` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/deploy.yml) is really quite simple. It runs when code is pushed to the `staging` or `production` branches, and:

- If `staging` was updated, it creates a tag matching the new version, and pushes tags.
- If `production` was updated, it creates a GitHub Release for the new version

### platformDeploy
The [`platformDeploy` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/platformDeploy.yml) is what actually runs the deployment on all four platforms (iOS, Android, Web, macOS Desktop). It runs a staging deploy whenever a new tag is pushed to GitHub, and runs a production deploy whenever a new release is created.

### lockDeploys
The [`lockDeploys` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/lockDeploys.yml) executes when the `StagingDeployCash` is locked, and it prepares the staging branch for a production release by creating a new `PATCH` version (i.e: `1.0.57-5` -> `1.0.58.0`).

### finishReleaseCycle
The [`finishReleaseCycle` workflow](https://github.com/Expensify/Expensify.cash/blob/main/.github/workflows/finishReleaseCycle.yml) executes when the `StagingDeployCash` is closed. It updates the `production` branch from `staging` (triggering a production deploy), deploys `main` to staging, and creates a new `StagingDeployCash` deploy checklist.

## Local production builds
Sometimes it might be beneficial to generate a local production version instead of testing on production. Follow the steps below for each client:

#### Local production build of the web app
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001006300
versionName "1.0.63-0"
versionCode 1001006401
versionName "1.0.64-1"
}
splits {
abi {
Expand Down
8 changes: 4 additions & 4 deletions ios/ExpensifyCash/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.63</string>
<string>1.0.64</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.63.0</string>
<string>1.0.64.1</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down Expand Up @@ -63,12 +63,12 @@
</dict>
</dict>
</dict>
<key>NSMicrophoneUsageDescription</key>
<string>Required for video capture</string>
<key>NSCameraUsageDescription</key>
<string>Your camera is used to create chat attachments, documents, and facial capture.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to determine your default currency.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Required for video capture</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your camera roll is used to store chat attachments.</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/ExpensifyCashTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.63</string>
<string>1.0.64</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.63.0</string>
<string>1.0.64.1</string>
</dict>
</plist>
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "expensify.cash",
"version": "1.0.63-0",
"version": "1.0.64-1",
"author": "Expensify, Inc.",
"homepage": "https://expensify.cash",
"description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
1 change: 1 addition & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const CONST = {
CHRONOS_IN_CASH: 'chronosInCash',
IOU: 'IOU',
PAY_WITH_EXPENSIFY: 'payWithExpensify',
FREE_PLAN: 'freePlan',
},
BUTTON_STATES: {
DEFAULT: 'default',
Expand Down
56 changes: 36 additions & 20 deletions src/components/IOUBadge.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Text, View} from 'react-native';
import {Text, Pressable} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import ONYXKEYS from '../ONYXKEYS';
import styles from '../styles/styles';
import styles, {getBadgeColorStyle} from '../styles/styles';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';
import compose from '../libs/compose';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import CONST from '../CONST';

const propTypes = {
/** IOU Report data object */
iouReport: PropTypes.shape({
/** The report ID of the IOU */
reportID: PropTypes.number,

/** The report ID of the chat associated with the IOU */
chatReportID: PropTypes.number,

/** The total amount in cents */
total: PropTypes.number,

Expand All @@ -31,31 +39,39 @@ const propTypes = {

const defaultProps = {
iouReport: {
reportID: 0,
chatReportID: 0,
total: 0,
ownerEmail: null,
currency: CONST.CURRENCY.USD,
},
};

const IOUBadge = props => (
<View
style={[
styles.badge,
styles.ml2,
props.session.email === props.iouReport.ownerEmail ? styles.badgeSuccess : styles.badgeDanger,
]}
>
<Text
style={styles.badgeText}
numberOfLines={1}
const IOUBadge = (props) => {
const launchIOUDetailsModal = () => {
Navigation.navigate(ROUTES.getIouDetailsRoute(props.iouReport.chatReportID, props.iouReport.reportID));
};
return (
<Pressable
style={({pressed}) => ([
styles.badge,
styles.ml2,
getBadgeColorStyle(props.session.email === props.iouReport.ownerEmail, pressed),
])}
>
{props.numberFormat(
props.iouReport.total / 100,
{style: 'currency', currency: props.iouReport.currency},
)}
</Text>
</View>
);
<Text
style={styles.badgeText}
numberOfLines={1}
onPress={launchIOUDetailsModal}
>
{props.numberFormat(
props.iouReport.total / 100,
{style: 'currency', currency: props.iouReport.currency},
)}
</Text>
</Pressable>
);
};

IOUBadge.displayName = 'IOUBadge';
IOUBadge.propTypes = propTypes;
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export default {
payPalMe: 'PayPal.me/',
yourPayPalUsername: 'Your PayPal username',
addPayPalAccount: 'Add PayPal Account',
growlMessageOnSave: 'Your PayPal username was successfully added',
},
preferencesPage: {
mostRecent: 'Most Recent',
Expand Down
Loading

0 comments on commit 5443259

Please sign in to comment.