@@ -111,8 +111,9 @@ const run = function () {
111
111
// Since this is the second argument to _.union,
112
112
// it will appear later in the array than any duplicate.
113
113
// Since it is later in the array, it will be truncated by _.unique,
114
- // and the original value of isVerified will be preserved.
114
+ // and the original value of isVerified and isAccessible will be preserved.
115
115
isVerified: false,
116
+ isAccessible: false,
116
117
}))),
117
118
false,
118
119
item => item.number,
@@ -134,6 +135,7 @@ const run = function () {
134
135
tag,
135
136
_.pluck(PRList, 'url'),
136
137
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
138
+ _.pluck(_.where(PRList, {isAccessible: true}), 'url'),
137
139
_.pluck(deployBlockers, 'url'),
138
140
_.pluck(_.where(deployBlockers, {isResolved: true}), 'url'),
139
141
);
@@ -333,23 +335,23 @@ class GithubUtils {
333
335
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
334
336
*/
335
337
static getStagingDeployCashPRList(issue) {
336
- let PRListSection = issue.body.match(/pull requests:\*\*\r?\n((?:.*\r?\n)+) \r?\n/) || [];
338
+ let PRListSection = issue.body.match(/pull requests:\*\*(?: \r?\n)* ((?:.*\r?\n(?:\s+-\s.*\r?\n)+ \r?\n)+) /) || [];
337
339
if (PRListSection.length !== 2) {
338
340
// No PRs, return an empty array
339
341
console.log('Hmmm...The open StagingDeployCash does not list any pull requests, continuing...');
340
342
return [];
341
343
}
342
344
PRListSection = PRListSection[1];
343
345
const unverifiedPRs = _.map(
344
- [...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
346
+ [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA `, 'g'))],
345
347
match => ({
346
348
url: match[1],
347
349
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
348
350
isVerified: false,
349
351
}),
350
352
);
351
353
const verifiedPRs = _.map(
352
- [...PRListSection.matchAll(new RegExp(`- \\[x] (${PULL_REQUEST_REGEX.source})`, 'g'))],
354
+ [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[x\\] QA `, 'g'))],
353
355
match => ({
354
356
url: match[1],
355
357
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
@@ -377,15 +379,15 @@ class GithubUtils {
377
379
}
378
380
deployBlockerSection = deployBlockerSection[1];
379
381
const unresolvedDeployBlockers = _.map(
380
- [...deployBlockerSection.matchAll(new RegExp(`- \\[ ] (${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
382
+ [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA `, 'g'))],
381
383
match => ({
382
384
url: match[1],
383
385
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
384
386
isResolved: false,
385
387
}),
386
388
);
387
389
const resolvedDeployBlockers = _.map(
388
- [...deployBlockerSection.matchAll(new RegExp(`- \\[x] (${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
390
+ [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[x\\] QA `, 'g'))],
389
391
match => ({
390
392
url: match[1],
391
393
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
@@ -404,6 +406,7 @@ class GithubUtils {
404
406
* @param {String} tag
405
407
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
406
408
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
409
+ * @param {Array} [accessabilityPRList] - The list of PR URLs which have passed the accessability check.
407
410
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
408
411
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
409
412
* @returns {Promise}
@@ -412,6 +415,7 @@ class GithubUtils {
412
415
tag,
413
416
PRList,
414
417
verifiedPRList = [],
418
+ accessabilityPRList = [],
415
419
deployBlockers = [],
416
420
resolvedDeployBlockers = [],
417
421
) {
@@ -438,23 +442,25 @@ class GithubUtils {
438
442
439
443
// PR list
440
444
if (!_.isEmpty(sortedPRList)) {
441
- issueBody += '\r\n**This release contains changes from the following pull requests:**\r\n ';
445
+ issueBody += '\r\n**This release contains changes from the following pull requests:**';
442
446
_.each(sortedPRList, (URL) => {
443
- issueBody += _.contains(verifiedPRList, URL) ? '- [x]' : '- [ ]';
444
- issueBody += ` ${URL}\r\n`;
447
+ issueBody += `\r\n\r\n- ${URL}`;
448
+ issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
449
+ issueBody += _.contains(accessabilityPRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
445
450
});
446
451
}
447
452
448
453
// Deploy blockers
449
454
if (!_.isEmpty(deployBlockers)) {
450
- issueBody += '\r\n**Deploy Blockers:**\r\n ';
455
+ issueBody += '\r\n\r\n\r\n **Deploy Blockers:**';
451
456
_.each(sortedDeployBlockers, (URL) => {
452
- issueBody += _.contains(resolvedDeployBlockers, URL) ? '- [x]' : '- [ ]';
453
- issueBody += ` ${URL}\r\n`;
457
+ issueBody += `\r\n\r\n- ${URL}`;
458
+ issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
459
+ issueBody += _.contains(accessabilityPRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
454
460
});
455
461
}
456
462
457
- issueBody += '\r\ncc @Expensify/applauseleads\r\n';
463
+ issueBody += '\r\n\r\ ncc @Expensify/applauseleads\r\n';
458
464
return issueBody;
459
465
})
460
466
.catch(err => console.warn(
0 commit comments