Skip to content

Commit

Permalink
Merge pull request #10076 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
Update version to 1.1.86-0 on staging
  • Loading branch information
OSBotify authored Jul 25, 2022
2 parents aee2f4e + 26f9362 commit 61b2107
Show file tree
Hide file tree
Showing 110 changed files with 3,084 additions and 2,284 deletions.
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
24 changes: 20 additions & 4 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,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 Expand Up @@ -418,6 +425,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 @@ -452,8 +460,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 @@ -498,7 +505,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 @@ -516,6 +523,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 @@ -527,6 +535,7 @@ class GithubUtils {
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
isTimingDashboardChecked = false,
isFirebaseChecked = false,
) {
Expand All @@ -538,6 +547,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 @@ -582,11 +596,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/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,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 @@ -301,8 +302,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 @@ -347,7 +347,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 @@ -365,6 +365,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 @@ -376,6 +377,7 @@ class GithubUtils {
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
isTimingDashboardChecked = false,
isFirebaseChecked = false,
) {
Expand All @@ -387,6 +389,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 @@ -431,11 +438,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
Loading

0 comments on commit 61b2107

Please sign in to comment.