Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into maria-make-default-pa…
Browse files Browse the repository at this point in the history
…yment-method

# Conflicts:
#	src/pages/EnablePayments/userWalletPropTypes.js
#	src/pages/settings/Payments/PaymentMethodList.js
  • Loading branch information
MariaHCD committed Aug 16, 2022
2 parents 33e44a1 + 3faeca0 commit 792872e
Show file tree
Hide file tree
Showing 82 changed files with 101,329 additions and 70,803 deletions.
13,647 changes: 8,089 additions & 5,558 deletions .github/actions/javascript/awaitStagingDeploys/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
13,651 changes: 8,091 additions & 5,560 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
23,427 changes: 12,978 additions & 10,449 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js

Large diffs are not rendered by default.

9,894 changes: 6,134 additions & 3,760 deletions .github/actions/javascript/getDeployPullRequestList/index.js

Large diffs are not rendered by default.

13,649 changes: 8,090 additions & 5,559 deletions .github/actions/javascript/getPullRequestDetails/index.js

Large diffs are not rendered by default.

13,649 changes: 8,090 additions & 5,559 deletions .github/actions/javascript/getReleaseBody/index.js

Large diffs are not rendered by default.

13,647 changes: 8,089 additions & 5,558 deletions .github/actions/javascript/isPullRequestMergeable/index.js

Large diffs are not rendered by default.

13,649 changes: 8,090 additions & 5,559 deletions .github/actions/javascript/isStagingDeployLocked/index.js

Large diffs are not rendered by default.

13,651 changes: 8,091 additions & 5,560 deletions .github/actions/javascript/markPullRequestsAsDeployed/index.js

Large diffs are not rendered by default.

13,649 changes: 8,090 additions & 5,559 deletions .github/actions/javascript/reopenIssueWithComment/index.js

Large diffs are not rendered by default.

13,647 changes: 8,089 additions & 5,558 deletions .github/actions/javascript/triggerWorkflowAndWait/index.js

Large diffs are not rendered by default.

13,651 changes: 8,091 additions & 5,560 deletions .github/actions/javascript/verifySignedCommits/index.js

Large diffs are not rendered by default.

92 changes: 59 additions & 33 deletions .github/libs/GithubUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const lodashGet = require('lodash/get');
const core = require('@actions/core');
const {GitHub, getOctokitOptions} = require('@actions/github/lib/utils');
const {throttling} = require('@octokit/plugin-throttling');
const {paginateRest} = require('@octokit/plugin-paginate-rest');

const GITHUB_OWNER = 'Expensify';
const APP_REPO = 'App';
Expand All @@ -27,19 +28,16 @@ const POLL_RATE = 10000;

class GithubUtils {
/**
* Either give an existing instance of Octokit or create a new one
* Initialize internal octokit
*
* @readonly
* @static
* @memberof GithubUtils
* @private
*/
static get octokit() {
if (this.octokitInternal) {
return this.octokitInternal;
}
const OctokitThrottled = GitHub.plugin(throttling);
static initOctokit() {
const Octokit = GitHub.plugin(throttling, paginateRest);
const token = core.getInput('GITHUB_TOKEN', {required: true});
this.octokitInternal = new OctokitThrottled(getOctokitOptions(token, {

// Save a copy of octokit used in this class
this.internalOctokit = new Octokit(getOctokitOptions(token, {
throttle: {
onRateLimit: (retryAfter, options) => {
console.warn(
Expand All @@ -60,7 +58,36 @@ class GithubUtils {
},
},
}));
return this.octokitInternal;
}

/**
* Either give an existing instance of Octokit rest or create a new one
*
* @readonly
* @static
* @memberof GithubUtils
*/
static get octokit() {
if (this.internalOctokit) {
return this.internalOctokit.rest;
}
this.initOctokit();
return this.internalOctokit.rest;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
* @readonly
* @static
* @memberof GithubUtils
*/
static get paginate() {
if (this.internalOctokit) {
return this.internalOctokit.paginate;
}
this.initOctokit();
return this.internalOctokit.paginate;
}

/**
Expand Down Expand Up @@ -128,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 @@ -156,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 @@ -178,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 @@ -192,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 @@ -204,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 @@ -216,7 +240,6 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
Expand Down Expand Up @@ -253,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 @@ -272,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 All @@ -325,7 +351,7 @@ class GithubUtils {
*/
static fetchAllPullRequests(pullRequestNumbers) {
const oldestPR = _.first(_.sortBy(pullRequestNumbers));
return this.octokit.paginate(this.octokit.pulls.list, {
return this.paginate(this.octokit.pulls.list, {
owner: GITHUB_OWNER,
repo: APP_REPO,
state: 'all',
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"]
}
}]
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 1001018812
versionName "1.1.88-12"
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
1 change: 1 addition & 0 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
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
27 changes: 5 additions & 22 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
---
permalink: /404.html
layout: default
lhn_content: '404'
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}

h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
<div class="centered-content with-lhn">
<img id="icon" src="/assets/images/circle-hourglass.svg" />
<strong>Hmm it's not here...</strong>
<div>That page is nowhere to be found.</div>
</div>
6 changes: 4 additions & 2 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
<i class="fa-solid fa-angle-left icon"></i>
<div class="link">Back</div>
</div>
<span class="in-this-article">In this article</span>
<div class="article-toc"></div>
{% if page.lhn_content == nil %}
<span class="in-this-article">In this article</span>
<div class="article-toc"></div>
{% endif %}
{% endcase %}
</div>

Expand Down
Loading

0 comments on commit 792872e

Please sign in to comment.