Skip to content

Commit d60834a

Browse files
Merge pull request #5117 from Expensify/jules-deployChecklistAddAccessibleCheck
Add accessibility check to each PR in the deployChecklist
2 parents d0abb52 + b78918e commit d60834a

File tree

13 files changed

+297
-155
lines changed

13 files changed

+297
-155
lines changed

.github/actions/checkDeployBlockers/index.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -206,23 +206,23 @@ class GithubUtils {
206206
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
207207
*/
208208
static getStagingDeployCashPRList(issue) {
209-
let PRListSection = issue.body.match(/pull requests:\*\*\r?\n((?:.*\r?\n)+)\r?\n/) || [];
209+
let PRListSection = issue.body.match(/pull requests:\*\*(?:\r?\n)*((?:.*\r?\n(?:\s+-\s.*\r?\n)+\r?\n)+)/) || [];
210210
if (PRListSection.length !== 2) {
211211
// No PRs, return an empty array
212212
console.log('Hmmm...The open StagingDeployCash does not list any pull requests, continuing...');
213213
return [];
214214
}
215215
PRListSection = PRListSection[1];
216216
const unverifiedPRs = _.map(
217-
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
217+
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
218218
match => ({
219219
url: match[1],
220220
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
221221
isVerified: false,
222222
}),
223223
);
224224
const verifiedPRs = _.map(
225-
[...PRListSection.matchAll(new RegExp(`- \\[x] (${PULL_REQUEST_REGEX.source})`, 'g'))],
225+
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
226226
match => ({
227227
url: match[1],
228228
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
@@ -250,15 +250,15 @@ class GithubUtils {
250250
}
251251
deployBlockerSection = deployBlockerSection[1];
252252
const unresolvedDeployBlockers = _.map(
253-
[...deployBlockerSection.matchAll(new RegExp(`- \\[ ] (${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
253+
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
254254
match => ({
255255
url: match[1],
256256
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
257257
isResolved: false,
258258
}),
259259
);
260260
const resolvedDeployBlockers = _.map(
261-
[...deployBlockerSection.matchAll(new RegExp(`- \\[x] (${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
261+
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
262262
match => ({
263263
url: match[1],
264264
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
@@ -277,6 +277,7 @@ class GithubUtils {
277277
* @param {String} tag
278278
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
279279
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
280+
* @param {Array} [accessablePRList] - The list of PR URLs which have passed the accessability check.
280281
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
281282
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
282283
* @returns {Promise}
@@ -285,6 +286,7 @@ class GithubUtils {
285286
tag,
286287
PRList,
287288
verifiedPRList = [],
289+
accessablePRList = [],
288290
deployBlockers = [],
289291
resolvedDeployBlockers = [],
290292
) {
@@ -311,23 +313,24 @@ class GithubUtils {
311313

312314
// PR list
313315
if (!_.isEmpty(sortedPRList)) {
314-
issueBody += '\r\n**This release contains changes from the following pull requests:**\r\n';
316+
issueBody += '\r\n**This release contains changes from the following pull requests:**';
315317
_.each(sortedPRList, (URL) => {
316-
issueBody += _.contains(verifiedPRList, URL) ? '- [x]' : '- [ ]';
317-
issueBody += ` ${URL}\r\n`;
318+
issueBody += `\r\n\r\n- ${URL}`;
319+
issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
320+
issueBody += _.contains(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
318321
});
319322
}
320323

321324
// Deploy blockers
322325
if (!_.isEmpty(deployBlockers)) {
323-
issueBody += '\r\n**Deploy Blockers:**\r\n';
326+
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
324327
_.each(sortedDeployBlockers, (URL) => {
325-
issueBody += _.contains(resolvedDeployBlockers, URL) ? '- [x]' : '- [ ]';
326-
issueBody += ` ${URL}\r\n`;
328+
issueBody += `\r\n\r\n- ${URL}`;
329+
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
327330
});
328331
}
329332

330-
issueBody += '\r\ncc @Expensify/applauseleads\r\n';
333+
issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
331334
return issueBody;
332335
})
333336
.catch(err => console.warn(

.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ const run = function () {
101101
// Since this is the second argument to _.union,
102102
// it will appear later in the array than any duplicate.
103103
// Since it is later in the array, it will be truncated by _.unique,
104-
// and the original value of isVerified will be preserved.
104+
// and the original value of isVerified and isAccessible will be preserved.
105105
isVerified: false,
106+
isAccessible: false,
106107
}))),
107108
false,
108109
item => item.number,
@@ -124,6 +125,7 @@ const run = function () {
124125
tag,
125126
_.pluck(PRList, 'url'),
126127
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
128+
_.pluck(_.where(PRList, {isAccessible: true}), 'url'),
127129
_.pluck(deployBlockers, 'url'),
128130
_.pluck(_.where(deployBlockers, {isResolved: true}), 'url'),
129131
);

.github/actions/createOrUpdateStagingDeploy/index.js

+18-13
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ const run = function () {
111111
// Since this is the second argument to _.union,
112112
// it will appear later in the array than any duplicate.
113113
// 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.
115115
isVerified: false,
116+
isAccessible: false,
116117
}))),
117118
false,
118119
item => item.number,
@@ -134,6 +135,7 @@ const run = function () {
134135
tag,
135136
_.pluck(PRList, 'url'),
136137
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
138+
_.pluck(_.where(PRList, {isAccessible: true}), 'url'),
137139
_.pluck(deployBlockers, 'url'),
138140
_.pluck(_.where(deployBlockers, {isResolved: true}), 'url'),
139141
);
@@ -333,23 +335,23 @@ class GithubUtils {
333335
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
334336
*/
335337
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)+)/) || [];
337339
if (PRListSection.length !== 2) {
338340
// No PRs, return an empty array
339341
console.log('Hmmm...The open StagingDeployCash does not list any pull requests, continuing...');
340342
return [];
341343
}
342344
PRListSection = PRListSection[1];
343345
const unverifiedPRs = _.map(
344-
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
346+
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
345347
match => ({
346348
url: match[1],
347349
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
348350
isVerified: false,
349351
}),
350352
);
351353
const verifiedPRs = _.map(
352-
[...PRListSection.matchAll(new RegExp(`- \\[x] (${PULL_REQUEST_REGEX.source})`, 'g'))],
354+
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
353355
match => ({
354356
url: match[1],
355357
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
@@ -377,15 +379,15 @@ class GithubUtils {
377379
}
378380
deployBlockerSection = deployBlockerSection[1];
379381
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})\\s+- \\[ \\] QA`, 'g'))],
381383
match => ({
382384
url: match[1],
383385
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
384386
isResolved: false,
385387
}),
386388
);
387389
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})\\s+- \\[x\\] QA`, 'g'))],
389391
match => ({
390392
url: match[1],
391393
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
@@ -404,6 +406,7 @@ class GithubUtils {
404406
* @param {String} tag
405407
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
406408
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
409+
* @param {Array} [accessablePRList] - The list of PR URLs which have passed the accessability check.
407410
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
408411
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
409412
* @returns {Promise}
@@ -412,6 +415,7 @@ class GithubUtils {
412415
tag,
413416
PRList,
414417
verifiedPRList = [],
418+
accessablePRList = [],
415419
deployBlockers = [],
416420
resolvedDeployBlockers = [],
417421
) {
@@ -438,23 +442,24 @@ class GithubUtils {
438442

439443
// PR list
440444
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:**';
442446
_.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(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
445450
});
446451
}
447452

448453
// Deploy blockers
449454
if (!_.isEmpty(deployBlockers)) {
450-
issueBody += '\r\n**Deploy Blockers:**\r\n';
455+
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
451456
_.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';
454459
});
455460
}
456461

457-
issueBody += '\r\ncc @Expensify/applauseleads\r\n';
462+
issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
458463
return issueBody;
459464
})
460465
.catch(err => console.warn(

.github/actions/getPullRequestDetails/index.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -259,23 +259,23 @@ class GithubUtils {
259259
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
260260
*/
261261
static getStagingDeployCashPRList(issue) {
262-
let PRListSection = issue.body.match(/pull requests:\*\*\r?\n((?:.*\r?\n)+)\r?\n/) || [];
262+
let PRListSection = issue.body.match(/pull requests:\*\*(?:\r?\n)*((?:.*\r?\n(?:\s+-\s.*\r?\n)+\r?\n)+)/) || [];
263263
if (PRListSection.length !== 2) {
264264
// No PRs, return an empty array
265265
console.log('Hmmm...The open StagingDeployCash does not list any pull requests, continuing...');
266266
return [];
267267
}
268268
PRListSection = PRListSection[1];
269269
const unverifiedPRs = _.map(
270-
[...PRListSection.matchAll(new RegExp(`- \\[ ] (${PULL_REQUEST_REGEX.source})`, 'g'))],
270+
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
271271
match => ({
272272
url: match[1],
273273
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
274274
isVerified: false,
275275
}),
276276
);
277277
const verifiedPRs = _.map(
278-
[...PRListSection.matchAll(new RegExp(`- \\[x] (${PULL_REQUEST_REGEX.source})`, 'g'))],
278+
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
279279
match => ({
280280
url: match[1],
281281
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
@@ -303,15 +303,15 @@ class GithubUtils {
303303
}
304304
deployBlockerSection = deployBlockerSection[1];
305305
const unresolvedDeployBlockers = _.map(
306-
[...deployBlockerSection.matchAll(new RegExp(`- \\[ ] (${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
306+
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
307307
match => ({
308308
url: match[1],
309309
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
310310
isResolved: false,
311311
}),
312312
);
313313
const resolvedDeployBlockers = _.map(
314-
[...deployBlockerSection.matchAll(new RegExp(`- \\[x] (${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
314+
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
315315
match => ({
316316
url: match[1],
317317
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
@@ -330,6 +330,7 @@ class GithubUtils {
330330
* @param {String} tag
331331
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
332332
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
333+
* @param {Array} [accessablePRList] - The list of PR URLs which have passed the accessability check.
333334
* @param {Array} [deployBlockers] - The list of DeployBlocker URLs.
334335
* @param {Array} [resolvedDeployBlockers] - The list of DeployBlockers URLs which have been resolved.
335336
* @returns {Promise}
@@ -338,6 +339,7 @@ class GithubUtils {
338339
tag,
339340
PRList,
340341
verifiedPRList = [],
342+
accessablePRList = [],
341343
deployBlockers = [],
342344
resolvedDeployBlockers = [],
343345
) {
@@ -364,23 +366,24 @@ class GithubUtils {
364366

365367
// PR list
366368
if (!_.isEmpty(sortedPRList)) {
367-
issueBody += '\r\n**This release contains changes from the following pull requests:**\r\n';
369+
issueBody += '\r\n**This release contains changes from the following pull requests:**';
368370
_.each(sortedPRList, (URL) => {
369-
issueBody += _.contains(verifiedPRList, URL) ? '- [x]' : '- [ ]';
370-
issueBody += ` ${URL}\r\n`;
371+
issueBody += `\r\n\r\n- ${URL}`;
372+
issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
373+
issueBody += _.contains(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
371374
});
372375
}
373376

374377
// Deploy blockers
375378
if (!_.isEmpty(deployBlockers)) {
376-
issueBody += '\r\n**Deploy Blockers:**\r\n';
379+
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
377380
_.each(sortedDeployBlockers, (URL) => {
378-
issueBody += _.contains(resolvedDeployBlockers, URL) ? '- [x]' : '- [ ]';
379-
issueBody += ` ${URL}\r\n`;
381+
issueBody += `\r\n\r\n- ${URL}`;
382+
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
380383
});
381384
}
382385

383-
issueBody += '\r\ncc @Expensify/applauseleads\r\n';
386+
issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
384387
return issueBody;
385388
})
386389
.catch(err => console.warn(

0 commit comments

Comments
 (0)