Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into advaita
Browse files Browse the repository at this point in the history
  • Loading branch information
advaitasol9 authored Aug 24, 2022
2 parents 957682d + cd2f569 commit f6751a1
Show file tree
Hide file tree
Showing 143 changed files with 193,531 additions and 150,026 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
extends: ['expensify', 'plugin:storybook/recommended'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js'],
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', '.git/**'],
env: {
jest: true,
},
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:

- uses: actions/setup-node@09ba51f18e18a3756fea1f54d09c6745c064491d
with:
node-version: 14.19.3
node-version-file: '.nvmrc'
cache: npm

- name: Install node packages
Expand Down
21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/awaitStagingDeploys/index.js

Large diffs are not rendered by default.

2,643 changes: 2,364 additions & 279 deletions .github/actions/javascript/bumpVersion/index.js

Large diffs are not rendered by default.

2,273 changes: 2,183 additions & 90 deletions .github/actions/javascript/checkBundleVersionStringMatch/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const run = function () {
console.log('Checking for unverified PRs or unresolved deploy blockers', data);

// Check the issue description to see if there are any unfinished/un-QAed items in the checklist.
const uncheckedBoxRegex = /-\s\[\s]\s(?!Accessibility)/;
const uncheckedBoxRegex = /-\s\[\s]\s/;
if (uncheckedBoxRegex.test(data.body)) {
console.log('An unverified PR or unresolved deploy blocker was found.');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
Expand Down
21,066 changes: 11,048 additions & 10,018 deletions .github/actions/javascript/checkDeployBlockers/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ const run = function () {
// Since this is the second argument to _.union,
// it will appear later in the array than any duplicate.
// Since it is later in the array, it will be truncated by _.unique,
// and the original value of isVerified and isAccessible will be preserved.
// and the original value of isVerified will be preserved.
isVerified: false,
isAccessible: false,
}))),
false,
item => item.number,
Expand Down Expand Up @@ -132,7 +131,6 @@ const run = function () {
newTag,
_.pluck(PRList, 'url'),
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
_.pluck(_.where(PRList, {isAccessible: true}), 'url'),
_.pluck(deployBlockers, 'url'),
_.pluck(_.where(deployBlockers, {isResolved: true}), 'url'),
_.pluck(_.where(internalQAPRList, {isResolved: true}), 'url'),
Expand Down
30,616 changes: 15,822 additions & 14,794 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const core = require('@actions/core');
const github = require('@actions/github');
const ActionUtils = require('../../../libs/ActionUtils');
const GitUtils = require('../../../libs/GitUtils');
const GithubUtils = require('../../../libs/GithubUtils');

const octokit = github.getOctokit(core.getInput('GITHUB_TOKEN', {required: true}));
const inputTag = core.getInput('TAG', {required: true});

const isProductionDeploy = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', {required: false}, false);
Expand All @@ -18,13 +18,13 @@ const itemToFetch = isProductionDeploy ? 'release' : 'tag';
*/
function getTagsOrReleases(fetchReleases) {
if (fetchReleases) {
return octokit.repos.listReleases({
return GithubUtils.octokit.repos.listReleases({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
});
}

return octokit.repos.listTags({
return GithubUtils.octokit.repos.listTags({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
});
Expand Down
9,459 changes: 7,287 additions & 2,172 deletions .github/actions/javascript/getDeployPullRequestList/index.js

Large diffs are not rendered by default.

21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/getPullRequestDetails/index.js

Large diffs are not rendered by default.

21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/getReleaseBody/index.js

Large diffs are not rendered by default.

21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/isPullRequestMergeable/index.js

Large diffs are not rendered by default.

21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/isStagingDeployLocked/index.js

Large diffs are not rendered by default.

20,968 changes: 10,999 additions & 9,969 deletions .github/actions/javascript/markPullRequestsAsDeployed/index.js

Large diffs are not rendered by default.

21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/reopenIssueWithComment/index.js

Large diffs are not rendered by default.

21,064 changes: 11,047 additions & 10,017 deletions .github/actions/javascript/triggerWorkflowAndWait/index.js

Large diffs are not rendered by default.

20,968 changes: 10,999 additions & 9,969 deletions .github/actions/javascript/verifySignedCommits/index.js

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions .github/libs/GithubUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,19 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
static getStagingDeployCashPRList(issue) {
let PRListSection = issue.body.match(/pull requests:\*\*(?:\r?\n)*((?:.*\r?\n(?:\s+-\s.*\r?\n)+\r?\n)+)/) || [];
let PRListSection = issue.body.match(/pull requests:\*\*\r?\n((?:-.*\r?\n)+)\r?\n\r?\n?/) || [];
if (PRListSection.length !== 2) {
// No PRs, return an empty array
console.log('Hmmm...The open StagingDeployCash does not list any pull requests, continuing...');
return [];
}
PRListSection = PRListSection[1];
const PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- \\[([ x])] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
url: match[2],
number: Number.parseInt(match[3], 10),
isVerified: match[1] === 'x',
}),
);
return _.sortBy(PRList, 'number');
Expand All @@ -183,7 +182,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
static getStagingDeployCashDeployBlockers(issue) {
let deployBlockerSection = issue.body.match(/Deploy Blockers:\*\*\r?\n((?:.*\r?\n)+)/) || [];
let deployBlockerSection = issue.body.match(/Deploy Blockers:\*\*\r?\n((?:-.*\r?\n)+)/) || [];
if (deployBlockerSection.length !== 2) {
return [];
}
Expand All @@ -205,7 +204,7 @@ class GithubUtils {
* @private
*
* @param {Object} issue
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean, isAccessible: Boolean}]
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
static getStagingDeployCashInternalQA(issue) {
let internalQASection = issue.body.match(/Internal QA:\*\*\r?\n((?:- \[[ x]].*\r?\n)+)/) || [];
Expand All @@ -219,7 +218,6 @@ class GithubUtils {
url: match[2].split('-')[0].trim(),
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
isAccessible: false,
}),
);
return _.sortBy(internalQAPRs, 'number');
Expand All @@ -231,7 +229,6 @@ class GithubUtils {
* @param {String} tag
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
* @param {Array} [accessiblePRList] - The list of PR URLs which have passed the accessability check.
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
* @param {Array} [resolvedInternalQAPRs] - The list of Internal QA PR URLs which have been resolved.
Expand All @@ -243,7 +240,6 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
Expand Down Expand Up @@ -280,7 +276,6 @@ class GithubUtils {
);
console.log('Found the following NO QA PRs:', noQAPRs);
const verifiedOrNoQAPRs = _.union(verifiedPRList, noQAPRs);
const accessibleOrNoQAPRs = _.union(accessiblePRList, noQAPRs);

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
Expand All @@ -299,36 +294,40 @@ class GithubUtils {

// PR list
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
issueBody += '\r\n**This release contains changes from the following pull requests:**\r\n';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedOrNoQAPRs, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessibleOrNoQAPRs, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]';
issueBody += ` ${URL}\r\n`;
});
issueBody += '\r\n\r\n';
}

// Internal QA PR list
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '\r\n\r\n\r\n**Internal QA:**';
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
issueBody += '**Deploy Blockers:**\r\n';
_.each(sortedDeployBlockers, (URL) => {
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '- [x] ' : '- [ ] ';
issueBody += URL;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
}

issueBody += '\r\n\r\n**Deployer verifications:**';
issueBody += '**Deployer verifications:**';
// eslint-disable-next-line max-len
issueBody += `\r\n- [${isTimingDashboardChecked ? 'x' : ' '}] I checked the [App Timing Dashboard](https://graphs.expensify.com/grafana/d/yj2EobAGz/app-timing?orgId=1) and verified this release does not cause a noticeable performance regression.`;
// eslint-disable-next-line max-len
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.15.1
3 changes: 2 additions & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const env = dotenv.config({path: path.resolve(__dirname, '../.env.staging')}).pa
module.exports = ({config}) => {
config.resolve.alias = {
'react-native-config': 'react-web-config',
'react-native$': 'react-native-web',
'react-native$': '@expensify/react-native-web',
'react-native-web': '@expensify/react-native-web',
'@react-native-community/netinfo': path.resolve(__dirname, '../__mocks__/@react-native-community/netinfo.js'),
};

Expand Down
8 changes: 8 additions & 0 deletions .well-known/assetlinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.expensify.chat",
"sha256_cert_fingerprints": ["2E:65:6F:1C:34:F5:7E:BF:FC:C0:2D:A3:14:0E:83:FE:61:51:F2:9B:5D:59:58:61:C4:4D:A9:99:0C:CA:F4:8E"]
}
}]
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@
These instructions should get you set up ready to work on New Expensify 🙌

## Getting Started
1. Install `node` & `npm`: `brew install node`
1. Install `nvm` then `node` & `npm`: `brew install nvm && nvm install`
2. Install `watchman`: `brew install watchman`
3. Install dependencies: `npm install`

You can use any IDE or code editing tool for developing on any platform. Use your favorite!

## Recommended `node` setup
In order to have more consistent builds, we use a strict `node` and `npm` version as defined in the `package.json` `engines` field and `.nvmrc` file. `npm install` will fail if you do not use the version defined, so it is recommended to install `node` via `nvm` for easy node version management. Automatic `node` version switching can be installed for [`zsh`](https://github.com/nvm-sh/nvm#zsh) or [`bash`](https://github.com/nvm-sh/nvm#bash) using `nvm`.

## Running the web app 🕸
* To run the **development web app**: `npm run web`
* Changes applied to Javascript will be applied automatically via WebPack as configured in `webpack.dev.js`
Expand All @@ -49,7 +52,6 @@ For an M1 Mac, read this [SO](https://stackoverflow.com/c/expensify/questions/11
* To run a on a **Development Simulator**: `npm run ios`
* Changes applied to Javascript will be applied automatically, any changes to native code will require a recompile


## Running the Android app 🤖
* To install the Android dependencies, run: `npm install`
* Go through the instructions on [this SO post](https://stackoverflow.com/c/expensify/questions/13283/13284#13284) to start running the app on android.
Expand Down Expand Up @@ -93,7 +95,6 @@ variables referenced here get updated since your local `.env` file is ignored.
- `ONYX_METRICS` (optional) - Set this to `true` to capture even more performance metrics and see them in Flipper
see [React-Native-Onyx#benchmarks](https://github.com/Expensify/react-native-onyx#benchmarks) for more information


----

# Running the tests
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001018807
versionName "1.1.88-7"
versionCode 1001018900
versionName "1.1.89-0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
8 changes: 4 additions & 4 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@
<activity
android:name=".bootsplash.BootSplashActivity"
android:theme="@style/BootTheme"
android:exported="false"
android:exported="true"
android:launchMode="singleTask">

<intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- Custom URI handlers. Used to intercept Urban Airship deep links. -->
<intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="new-expensify"/>
</intent-filter>

<!-- Web URL handlers. Used to intercept web links. -->
<intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
Expand Down
6 changes: 4 additions & 2 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const includeModules = [
'react-native-animatable',
'react-native-reanimated',
'react-native-picker-select',
'react-native-web',
'@expensify/react-native-web',
'react-native-webview',
'@react-native-picker',
'react-native-modal',
Expand Down Expand Up @@ -56,6 +56,7 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
{from: 'node_modules/react-pdf/dist/esm/Page/AnnotationLayer.css', to: 'css/AnnotationLayer.css'},
{from: 'assets/images/shadow.png', to: 'images/shadow.png'},
{from: '.well-known/apple-app-site-association', to: '.well-known/apple-app-site-association', toType: 'file'},
{from: '.well-known/assetlinks.json', to: '.well-known/assetlinks.json'},

// These files are copied over as per instructions here
// https://github.com/wojtekmaj/react-pdf#copying-cmaps
Expand Down Expand Up @@ -150,7 +151,8 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
resolve: {
alias: {
'react-native-config': 'react-web-config',
'react-native$': 'react-native-web',
'react-native$': '@expensify/react-native-web',
'react-native-web': '@expensify/react-native-web',
'react-content-loader/native': 'react-content-loader',
},

Expand Down
Loading

0 comments on commit f6751a1

Please sign in to comment.