Skip to content

Commit

Permalink
Merge pull request #4827 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
  • Loading branch information
OSBotify authored Aug 25, 2021
2 parents 149a736 + 0fc65ff commit 90084ea
Show file tree
Hide file tree
Showing 94 changed files with 1,348 additions and 564 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ USE_NGROK=false
USE_WEB_PROXY=false
USE_WDYR=false
CAPTURE_METRICS=false
ONYX_METRICS=false
10 changes: 9 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
<!-- Explanation of the change or anything fishy that is going on -->

### Fixed Issues
<!-- Please replace GH_LINK with the link to the GitHub issue this Pull Request is fixing -->
<!---
Please replace GH_LINK with the link to the GitHub issue this Pull Request is fixing.
Do NOT add the special GH keywords like `fixed` etc, we have our own process of managing the flow.
It MUST be an entire link to the issue; otherwise, the linking will not work as expected.
Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add a new line):
$ https://github.com/Expensify/App/issues/4723
--->
$ GH_LINK

### Tests
Expand Down
12 changes: 10 additions & 2 deletions .github/actions/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,20 @@ const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOS
/**
* @param {String} deployer
* @param {String} deployVerb
* @param {String} prTitle
* @returns {String}
*/
function getDeployMessage(deployer, deployVerb) {
function getDeployMessage(deployer, deployVerb, prTitle) {
let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`;
message += ` by @${deployer} in version: ${version} 🚀`;
message += `\n\n platform | 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.';
}

return message;
}

Expand Down Expand Up @@ -127,14 +134,15 @@ const run = function () {
* (reflected in the branch name).
*/
let deployer = lodashGet(response, 'data.merged_by.login', '');
const issueTitle = lodashGet(response, 'data.title', '');
const CPActorMatches = data.message
.match(/Merge pull request #\d+ from Expensify\/(.+)-cherry-pick-staging-\d+/);
if (_.isArray(CPActorMatches) && CPActorMatches.length === 2 && CPActorMatches[1] !== 'OSBotify') {
deployer = CPActorMatches[1];
}

// Finally, comment on the PR
const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed');
const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed', issueTitle);
return commentPR(PR, deployMessage);
}),
Promise.resolve());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@ const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOS
/**
* @param {String} deployer
* @param {String} deployVerb
* @param {String} prTitle
* @returns {String}
*/
function getDeployMessage(deployer, deployVerb) {
function getDeployMessage(deployer, deployVerb, prTitle) {
let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`;
message += ` by @${deployer} in version: ${version} 🚀`;
message += `\n\n platform | 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.';
}

return message;
}

Expand Down Expand Up @@ -117,14 +124,15 @@ const run = function () {
* (reflected in the branch name).
*/
let deployer = lodashGet(response, 'data.merged_by.login', '');
const issueTitle = lodashGet(response, 'data.title', '');
const CPActorMatches = data.message
.match(/Merge pull request #\d+ from Expensify\/(.+)-cherry-pick-staging-\d+/);
if (_.isArray(CPActorMatches) && CPActorMatches.length === 2 && CPActorMatches[1] !== 'OSBotify') {
deployer = CPActorMatches[1];
}

// Finally, comment on the PR
const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed');
const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed', issueTitle);
return commentPR(PR, deployMessage);
}),
Promise.resolve());
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
PULL_REQUEST: ${{ steps.createPullRequest.outputs.pr_number }}

# Note: we only run this action if the PR was manually CP'd. Otherwise, the deploy checklist is updated from preDeploy.yml
- name: Update StagingDeployCash
if: ${{ github.actor != 'OSBotify' }}
uses: Expensify/App/.github/actions/createOrUpdateStagingDeploy@main
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
NPM_VERSION: ${{ env.NEW_VERSION }}
2 changes: 1 addition & 1 deletion .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployBlocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/finishReleaseCycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lockDeploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
41 changes: 34 additions & 7 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand All @@ -330,12 +330,6 @@ jobs:
with:
node-version: '14.x'

- name: Determine if this was a cherry-pick
id: isStagingDeployLocked
uses: Expensify/App/.github/actions/isStagingDeployLocked@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set version
run: echo "VERSION=$(npm run print-version --silent)" >> $GITHUB_ENV

Expand All @@ -358,3 +352,36 @@ jobs:
DESKTOP: ${{ needs.desktop.result }}
IOS: ${{ needs.iOS.result }}
WEB: ${{ needs.web.result }}

- name: 'Announces the deploy in the #announce Slack room'
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
{
channel: '#announce',
attachments: [{
color: 'good',
text: `Successfully deployed ${process.env.AS_REPO} v${{ env.VERSION }} to ${{ env.SHOULD_DEPLOY_PRODUCTION == 'true' ? 'production' : 'staging' }}.`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: 'Announces a production deploy in the #expensify-open-source Slack room'
uses: 8398a7/action-slack@v3
if: ${{ env.SHOULD_DEPLOY_PRODUCTION == 'true' }}
with:
status: custom
custom_payload: |
{
channel: '#expensify-open-source',
attachments: [{
color: 'good',
text: `Successfully deployed ${process.env.AS_REPO} v${{ env.VERSION }} to production.`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/updateProtectedBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/warnCPLabel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
pretext: `<!subteam^S4TJJ3PSL>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you are hired for an Upwork job and have any job-specific questions, please a
If you've found a vulnerability, please email [email protected] with the subject `Vulnerability Report` instead of creating an issue.

## Payment for Contributions
We hire and pay external contributors via Upwork.com. If you'd like to be paid for contributing, please create an Upwork account and apply for a job in the [Upwork issue list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). If you think your compensation should be increased for a specific job, you can request a reevaluation by commenting in the Github issue where the Upwork job was posted. Payment for your contributions will be made no less than 7 days after the pull request is merged to allow for regression testing. We hire one contributor for each Upwork job. New contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. If you have not received payment after 8 days of the PR being deployed to production, please email [email protected] referencing the GH issue and your GH handle.
We hire and pay external contributors via Upwork.com. If you'd like to be paid for contributing, please create an Upwork account and apply for a job in the [Upwork issue list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). If you think your compensation should be increased for a specific job, you can request a reevaluation by commenting in the Github issue where the Upwork job was posted. Payment for your contributions will be made no less than 7 days after the pull request is deployed to production to allow for regression testing. We hire one contributor for each Upwork job. New contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. If you have not received payment after 8 days of the PR being deployed to production, please email [email protected] referencing the GH issue and your GH handle.

## Finding Jobs
There are two ways you can find a job that you can contribute to:
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001008611
versionName "1.0.86-11"
versionCode 1001008612
versionName "1.0.86-12"
}
splits {
abi {
Expand Down
23 changes: 23 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require('dotenv').config();

const defaultPresets = ['@babel/preset-react', '@babel/preset-env', '@babel/preset-flow'];
const defaultPlugins = [
// Adding the commonjs: true option to react-native-web plugin can cause styling conflicts
Expand Down Expand Up @@ -34,6 +36,27 @@ const metro = {
],
};

/*
* We use Flipper, <React.Profiler> and react-native-performance to capture/monitor stats
* By default <React.Profiler> is disabled in production as it adds small overhead
* When CAPTURE_METRICS is set we're explicitly saying that we want to capture metrics
* To enable the <Profiler> for release builds we add these aliases */
if (process.env.CAPTURE_METRICS === 'true') {
const path = require('path');
const profilingRenderer = path.resolve(
__dirname,
'./node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling',
);

metro.plugins.push(['module-resolver', {
root: ['./'],
alias: {
'ReactNativeRenderer-prod': profilingRenderer,
'scheduler/tracing': 'scheduler/tracing-profiling',
},
}]);
}

module.exports = ({caller}) => {
// For `react-native` (iOS/Android) caller will be "metro"
// For `webpack` (Web) caller will be "@babel-loader"
Expand Down
1 change: 1 addition & 0 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const includeModules = [
'react-native-modal',
'react-native-onyx',
'react-native-gesture-handler',
'react-native-flipper',
].join('|');

const webpackConfig = {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.86.11</string>
<string>1.0.86.12</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.86.11</string>
<string>1.0.86.12</string>
</dict>
</plist>
12 changes: 9 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ PODS:
- OpenSSL-Universal (= 1.1.180)
- Flipper-Glog (0.3.6)
- Flipper-PeerTalk (0.0.4)
- flipper-plugin-react-native-performance (0.6.0):
- React
- Flipper-RSocket (1.3.1):
- Flipper-Folly (~> 2.5)
- FlipperKit (0.75.1):
Expand Down Expand Up @@ -412,7 +414,7 @@ PODS:
- React-Core
- react-native-document-picker (5.1.0):
- React-Core
- react-native-flipper (0.100.0):
- react-native-flipper (0.103.0):
- React-Core
- react-native-image-picker (4.0.3):
- React-Core
Expand Down Expand Up @@ -598,6 +600,7 @@ DEPENDENCIES:
- Flipper-Folly (~> 2.5.3)
- Flipper-Glog (= 0.3.6)
- Flipper-PeerTalk (~> 0.0.4)
- flipper-plugin-react-native-performance (from `../node_modules/flipper-plugin-react-native-performance/ios`)
- Flipper-RSocket (~> 1.3)
- FlipperKit (~> 0.75.1)
- FlipperKit/Core (~> 0.75.1)
Expand Down Expand Up @@ -731,6 +734,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
flipper-plugin-react-native-performance:
:path: "../node_modules/flipper-plugin-react-native-performance/ios"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
onfido-react-native-sdk:
Expand Down Expand Up @@ -877,7 +882,7 @@ SPEC CHECKSUMS:
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
EXHaptics: 337c160c148baa6f0e7166249f368965906e346b
FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53
FBReactNativeSpec: 884d4cc2b011759361797a4035c47e10099393b5
FBReactNativeSpec: d2bbf7ed8374a5ef7e82afdce19c4e50731f1f0e
Firebase: 54cdc8bc9c9b3de54f43dab86e62f5a76b47034f
FirebaseABTesting: 4cb61aeeb50f60680af1c01fff781dfaf9293916
FirebaseAnalytics: 4751d6a49598a2b58da678cc07df696bcd809ab9
Expand All @@ -892,6 +897,7 @@ SPEC CHECKSUMS:
Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
flipper-plugin-react-native-performance: c639bbaf0e0444bab8eeb86dad93651c2e13291e
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
Expand Down Expand Up @@ -923,7 +929,7 @@ SPEC CHECKSUMS:
React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9
react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed
react-native-document-picker: 0e3602a4064da040321bafad6848d8b0edcb1d55
react-native-flipper: 1943b82f2e494c77b741eb1ed257b6734a334b83
react-native-flipper: 169e8ba429b73ad637ce007337ce4b415e783799
react-native-image-picker: 4089335b89b625d4e34d53fb249c48a7a791b3ea
react-native-netinfo: 52cf0ee8342548a485e28f4b09e56b477567244d
react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f
Expand Down
Loading

0 comments on commit 90084ea

Please sign in to comment.