Skip to content

Commit

Permalink
Merge remote-tracking branch 'e.cash/main' into kidroca/attachment-pi…
Browse files Browse the repository at this point in the history
…cker-briefly-displayed-after-taking-a-picture

# Conflicts:
#	src/components/AttachmentPicker/index.native.js
  • Loading branch information
kidroca committed May 12, 2021
2 parents 6964c60 + d792202 commit 94ddc07
Show file tree
Hide file tree
Showing 137 changed files with 16,733 additions and 1,183 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
EXPENSIFY_URL_CASH=https://expensify.cash/
EXPENSIFY_URL_SECURE=https://secure.expensify.com.dev/
EXPENSIFY_URL_COM=https://www.expensify.com.dev/
EXPENSIFY_PARTNER_NAME=chat-expensify-com
EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
Expand Down
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
EXPENSIFY_URL_CASH=https://expensify.cash/
EXPENSIFY_URL_SECURE=https://secure.expensify.com/
EXPENSIFY_URL_COM=https://www.expensify.com/
EXPENSIFY_PARTNER_NAME=chat-expensify-com
EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
Expand Down
1 change: 1 addition & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
EXPENSIFY_URL_CASH=https://staging.expensify.cash/
EXPENSIFY_URL_SECURE=https://staging-secure.expensify.com/
EXPENSIFY_URL_COM=https://www.expensify.com/
EXPENSIFY_PARTNER_NAME=chat-expensify-com
EXPENSIFY_PARTNER_PASSWORD=e21965746fd75f82bb66
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
labels: AutoAssignerTriage
---

If you haven’t already, check out our [contributing guidelines](https://github.com/Expensify/ReactNativeChat/blob/main/CONTRIBUTING.md) for onboarding and email contributors@expensify.com to request to join our Slack channel!
___

Expand Down
26 changes: 24 additions & 2 deletions .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
getStagingDeployCashPRList(issue) {
const PRListSection = issue.body.match(/pull requests:\*\*\r\n((?:.*\r\n)+)\r\n/)[1];
let PRListSection = issue.body.match(/pull requests:\*\*\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 unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
Expand Down Expand Up @@ -204,7 +210,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
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 Down Expand Up @@ -396,6 +402,22 @@ class GithubUtils {
});
}

/**
* Get the most recent workflow run for the given Expensify.cash workflow.
*
* @param {String} workflow
* @returns {Promise}
*/
getLatestWorkflowRunID(workflow) {
console.log(`Fetching Expensify.cash workflow runs for ${workflow}...`);
return this.octokit.actions.listWorkflowRuns({
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
workflow_id: workflow,
})
.then(response => lodashGet(response, 'data.workflow_runs[0].id'));
}

/**
* Generate the well-formatted body of a production release.
*
Expand Down
26 changes: 24 additions & 2 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
getStagingDeployCashPRList(issue) {
const PRListSection = issue.body.match(/pull requests:\*\*\r\n((?:.*\r\n)+)\r\n/)[1];
let PRListSection = issue.body.match(/pull requests:\*\*\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 unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
Expand Down Expand Up @@ -230,7 +236,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
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 Down Expand Up @@ -422,6 +428,22 @@ class GithubUtils {
});
}

/**
* Get the most recent workflow run for the given Expensify.cash workflow.
*
* @param {String} workflow
* @returns {Promise}
*/
getLatestWorkflowRunID(workflow) {
console.log(`Fetching Expensify.cash workflow runs for ${workflow}...`);
return this.octokit.actions.listWorkflowRuns({
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
workflow_id: workflow,
})
.then(response => lodashGet(response, 'data.workflow_runs[0].id'));
}

/**
* Generate the well-formatted body of a production release.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const _ = require('underscore');
const core = require('@actions/core');
const github = require('@actions/github');
const ActionUtils = require('../../libs/ActionUtils');
const GitUtils = require('../../libs/GitUtils');

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

const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false}));
const isProductionDeploy = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', {required: false}, false);
const itemToFetch = isProductionDeploy ? 'release' : 'tag';

/**
Expand Down
32 changes: 31 additions & 1 deletion .github/actions/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ module.exports =
const _ = __nccwpck_require__(4987);
const core = __nccwpck_require__(2186);
const github = __nccwpck_require__(5438);
const ActionUtils = __nccwpck_require__(970);
const GitUtils = __nccwpck_require__(669);

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

const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false}));
const isProductionDeploy = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', {required: false}, false);
const itemToFetch = isProductionDeploy ? 'release' : 'tag';

/**
Expand Down Expand Up @@ -73,6 +74,35 @@ getTagsOrReleases(isProductionDeploy)
.catch(error => core.setFailed(error));


/***/ }),

/***/ 970:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(2186);

/**
* Safely parse a JSON input to a GitHub Action.
*
* @param {String} name - The name of the input.
* @param {Object} options - Options to pass to core.getInput
* @param {*} [defaultValue] - A default value to provide for the input.
* Not required if the {required: true} option is given in the second arg to this function.
* @returns {any}
*/
function getJSONInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (input) {
return JSON.parse(input);
}
return defaultValue;
}

module.exports = {
getJSONInput,
};


/***/ }),

/***/ 669:
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/getReleaseBody/getReleaseBody.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const _ = require('underscore');
const core = require('@actions/core');
const ActionUtils = require('../../libs/ActionUtils');
const GithubUtils = require('../../libs/GithubUtils');

// Parse the stringified JSON array of PR numbers, and cast each from String -> Number
const PRList = _.map(JSON.parse(core.getInput('PR_LIST', {required: true})), Number);
const PRList = _.map(ActionUtils.getJSONInput('PR_LIST', {required: true}), Number);
console.log(`Got PR list: ${PRList}`);

const releaseBody = GithubUtils.getReleaseBody(PRList);
Expand Down
58 changes: 55 additions & 3 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ module.exports =

const _ = __nccwpck_require__(4987);
const core = __nccwpck_require__(2186);
const ActionUtils = __nccwpck_require__(970);
const GithubUtils = __nccwpck_require__(7999);

// Parse the stringified JSON array of PR numbers, and cast each from String -> Number
const PRList = _.map(JSON.parse(core.getInput('PR_LIST', {required: true})), Number);
const PRList = _.map(ActionUtils.getJSONInput('PR_LIST', {required: true}), Number);
console.log(`Got PR list: ${PRList}`);

const releaseBody = GithubUtils.getReleaseBody(PRList);
Expand All @@ -22,6 +23,35 @@ console.log(`Generated release body: ${releaseBody}`);
core.setOutput('RELEASE_BODY', releaseBody);


/***/ }),

/***/ 970:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(2186);

/**
* Safely parse a JSON input to a GitHub Action.
*
* @param {String} name - The name of the input.
* @param {Object} options - Options to pass to core.getInput
* @param {*} [defaultValue] - A default value to provide for the input.
* Not required if the {required: true} option is given in the second arg to this function.
* @returns {any}
*/
function getJSONInput(name, options, defaultValue = undefined) {
const input = core.getInput(name, options);
if (input) {
return JSON.parse(input);
}
return defaultValue;
}

module.exports = {
getJSONInput,
};


/***/ }),

/***/ 7999:
Expand Down Expand Up @@ -111,7 +141,13 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
getStagingDeployCashPRList(issue) {
const PRListSection = issue.body.match(/pull requests:\*\*\r\n((?:.*\r\n)+)\r\n/)[1];
let PRListSection = issue.body.match(/pull requests:\*\*\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 unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
Expand Down Expand Up @@ -143,7 +179,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
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 Down Expand Up @@ -335,6 +371,22 @@ class GithubUtils {
});
}

/**
* Get the most recent workflow run for the given Expensify.cash workflow.
*
* @param {String} workflow
* @returns {Promise}
*/
getLatestWorkflowRunID(workflow) {
console.log(`Fetching Expensify.cash workflow runs for ${workflow}...`);
return this.octokit.actions.listWorkflowRuns({
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
workflow_id: workflow,
})
.then(response => lodashGet(response, 'data.workflow_runs[0].id'));
}

/**
* Generate the well-formatted body of a production release.
*
Expand Down
26 changes: 24 additions & 2 deletions .github/actions/isPullRequestMergeable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
getStagingDeployCashPRList(issue) {
const PRListSection = issue.body.match(/pull requests:\*\*\r\n((?:.*\r\n)+)\r\n/)[1];
let PRListSection = issue.body.match(/pull requests:\*\*\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 unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
Expand Down Expand Up @@ -178,7 +184,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
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 Down Expand Up @@ -370,6 +376,22 @@ class GithubUtils {
});
}

/**
* Get the most recent workflow run for the given Expensify.cash workflow.
*
* @param {String} workflow
* @returns {Promise}
*/
getLatestWorkflowRunID(workflow) {
console.log(`Fetching Expensify.cash workflow runs for ${workflow}...`);
return this.octokit.actions.listWorkflowRuns({
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
workflow_id: workflow,
})
.then(response => lodashGet(response, 'data.workflow_runs[0].id'));
}

/**
* Generate the well-formatted body of a production release.
*
Expand Down
26 changes: 24 additions & 2 deletions .github/actions/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
getStagingDeployCashPRList(issue) {
const PRListSection = issue.body.match(/pull requests:\*\*\r\n((?:.*\r\n)+)\r\n/)[1];
let PRListSection = issue.body.match(/pull requests:\*\*\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 unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
Expand Down Expand Up @@ -156,7 +162,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
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 Down Expand Up @@ -348,6 +354,22 @@ class GithubUtils {
});
}

/**
* Get the most recent workflow run for the given Expensify.cash workflow.
*
* @param {String} workflow
* @returns {Promise}
*/
getLatestWorkflowRunID(workflow) {
console.log(`Fetching Expensify.cash workflow runs for ${workflow}...`);
return this.octokit.actions.listWorkflowRuns({
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
workflow_id: workflow,
})
.then(response => lodashGet(response, 'data.workflow_runs[0].id'));
}

/**
* Generate the well-formatted body of a production release.
*
Expand Down
Loading

0 comments on commit 94ddc07

Please sign in to comment.