Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshdeepjoshi committed Aug 3, 2022
2 parents ebb51ff + 28778a0 commit 1a84291
Show file tree
Hide file tree
Showing 161 changed files with 3,542 additions and 2,115 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'],
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js'],
env: {
jest: true,
},
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ runs:
steps:
# Version: 3.0.2
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
with:
fetch-depth: 0

- uses: actions/setup-node@09ba51f18e18a3756fea1f54d09c6745c064491d
with:
Expand Down
17 changes: 13 additions & 4 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class GithubUtils {
labels: issue.labels,
PRList: this.getStagingDeployCashPRList(issue),
deployBlockers: this.getStagingDeployCashDeployBlockers(issue),
internalQAPRList: this.getStagingDeployCashInternalQA(issue),
isTimingDashboardChecked: /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body),
isFirebaseChecked: /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body),
tag,
Expand Down Expand Up @@ -260,8 +261,7 @@ class GithubUtils {
isAccessible: match[4] === 'x',
}),
);
const internalQAPRList = this.getStagingDeployCashInternalQA(issue);
return _.sortBy(_.union(PRList, internalQAPRList), 'number');
return _.sortBy(PRList, 'number');
}

/**
Expand Down Expand Up @@ -306,7 +306,7 @@ class GithubUtils {
const internalQAPRs = _.map(
[...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[2],
url: match[2].split('-')[0].trim(),
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
isAccessible: false,
Expand All @@ -324,6 +324,7 @@ class GithubUtils {
* @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.
* @param {Boolean} [isTimingDashboardChecked]
* @param {Boolean} [isFirebaseChecked]
* @returns {Promise}
Expand All @@ -335,6 +336,7 @@ class GithubUtils {
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
isTimingDashboardChecked = false,
isFirebaseChecked = false,
) {
Expand All @@ -346,6 +348,11 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
Expand Down Expand Up @@ -390,11 +397,13 @@ class GithubUtils {
});
}

// 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:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
Expand Down
17 changes: 13 additions & 4 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ class GithubUtils {
labels: issue.labels,
PRList: this.getStagingDeployCashPRList(issue),
deployBlockers: this.getStagingDeployCashDeployBlockers(issue),
internalQAPRList: this.getStagingDeployCashInternalQA(issue),
isTimingDashboardChecked: /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body),
isFirebaseChecked: /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body),
tag,
Expand Down Expand Up @@ -230,8 +231,7 @@ class GithubUtils {
isAccessible: match[4] === 'x',
}),
);
const internalQAPRList = this.getStagingDeployCashInternalQA(issue);
return _.sortBy(_.union(PRList, internalQAPRList), 'number');
return _.sortBy(PRList, 'number');
}

/**
Expand Down Expand Up @@ -276,7 +276,7 @@ class GithubUtils {
const internalQAPRs = _.map(
[...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[2],
url: match[2].split('-')[0].trim(),
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
isAccessible: false,
Expand All @@ -294,6 +294,7 @@ class GithubUtils {
* @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.
* @param {Boolean} [isTimingDashboardChecked]
* @param {Boolean} [isFirebaseChecked]
* @returns {Promise}
Expand All @@ -305,6 +306,7 @@ class GithubUtils {
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
isTimingDashboardChecked = false,
isFirebaseChecked = false,
) {
Expand All @@ -316,6 +318,11 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
Expand Down Expand Up @@ -360,11 +367,13 @@ class GithubUtils {
});
}

// 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:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,20 @@ const run = function () {
'number',
);

// Get the internalQA PR list, preserving the previous state of `isResolved`
const internalQAPRList = _.sortBy(
currentStagingDeployCashData.internalQAPRList,
'number',
);

return GithubUtils.generateStagingDeployCashBody(
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'),
didVersionChange ? false : currentStagingDeployCashData.isTimingDashboardChecked,
didVersionChange ? false : currentStagingDeployCashData.isFirebaseChecked,
);
Expand Down
Loading

0 comments on commit 1a84291

Please sign in to comment.