Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO QA] Remove accessibility boxes from deploy checklist #9806

Merged
merged 43 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fa2ab76
Remove accessibility logic to return qa checklist to how it used to look
stitesExpensify Jul 8, 2022
0797a45
Remove unnecessary logic now that accessibility is not on the checklist
stitesExpensify Jul 8, 2022
056f776
Remove accessibility logic now that it is no longer being checked
stitesExpensify Jul 8, 2022
16247b9
Remove accessibility logic from getPullRequestDetails now that it is …
stitesExpensify Jul 8, 2022
cd04bad
Remove accessibility logic from getReleaseBody
stitesExpensify Jul 8, 2022
b728c95
Remove accessibility logic since we are no longer using the checkboxes
stitesExpensify Jul 8, 2022
01035e3
Update to correct indecies
stitesExpensify Jul 8, 2022
89959ce
Change format back to having no accessibility
stitesExpensify Jul 8, 2022
7ab5b05
Remove some unused vars
stitesExpensify Jul 8, 2022
6c9d953
Remove accessibility test
stitesExpensify Jul 8, 2022
ad12d93
Remove bad spaces
stitesExpensify Jul 8, 2022
5b7c8ba
Remove unnecessary lineStart
stitesExpensify Jul 8, 2022
4493fc1
Double line break
stitesExpensify Jul 8, 2022
d8dd357
Change from double line break to single
stitesExpensify Jul 8, 2022
6a7c4bb
Remove accessibility checkboxes
stitesExpensify Jul 8, 2022
a9fd02f
Fix regex
stitesExpensify Jul 8, 2022
f8eaf0d
Remove accessibility checkboxes
stitesExpensify Jul 9, 2022
dc4a896
Fix newline formatting
stitesExpensify Jul 9, 2022
a4dbb2d
Merge branch 'main' of github.com:Expensify/App into stites-removeAcc…
stitesExpensify Aug 8, 2022
c5bff08
Fix grouping and regex
stitesExpensify Aug 8, 2022
55b916b
Update all regex to not look for accessibility checklist and fix grou…
stitesExpensify Aug 8, 2022
b46990c
remove checks for accessibility
stitesExpensify Aug 8, 2022
1149e78
remove accessibility arrays, and fix regex
stitesExpensify Aug 8, 2022
e9bf8d7
remove accessibility from tests
stitesExpensify Aug 8, 2022
1946178
remove unnecessary test
stitesExpensify Aug 8, 2022
82f58e3
Fix more regex
stitesExpensify Aug 8, 2022
a13fc19
update regex again
stitesExpensify Aug 8, 2022
67bf2cd
Remove unused vars
stitesExpensify Aug 8, 2022
9e5bafe
Make sure to add another newline after all PRs (even the last one)
stitesExpensify Aug 10, 2022
4f0bc79
Fix regex to not get deployblockers too
stitesExpensify Aug 10, 2022
781cb3a
Fix expected to have correct spacing
stitesExpensify Aug 10, 2022
6002eb2
Fix expected results for new format
stitesExpensify Aug 10, 2022
cdb1c43
Fix number of params now that we aren't passing accessibilityPRs
stitesExpensify Aug 10, 2022
8b31bf3
Fix double spacing issue
stitesExpensify Aug 10, 2022
7dbe6ac
Fix too many spaces before deploy blocker and tests
stitesExpensify Aug 10, 2022
6d08676
Merge branch 'main' of github.com:Expensify/App into stites-removeAcc…
stitesExpensify Aug 10, 2022
d3957f1
Build github actions
stitesExpensify Aug 10, 2022
3b353f1
Fix regex again
stitesExpensify Aug 12, 2022
94e7cc4
Fix expected spacing
stitesExpensify Aug 12, 2022
5d19a84
Update regex again to stop searching if it doesn't find '-'
stitesExpensify Aug 12, 2022
5ce7d24
Update spacing for double spaces
stitesExpensify Aug 12, 2022
5dfd4a4
Final regex change and spacing fixes for tests
stitesExpensify Aug 12, 2022
a98fcce
Build github actions
stitesExpensify Aug 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,19 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
static getStagingDeployCashPRList(issue) {
let PRListSection = issue.body.match(/pull requests:\*\*(?:\r?\n)*((?:.*\r?\n(?:\s+-\s.*\r?\n)+\r?\n)+)/) || [];
let PRListSection = issue.body.match(/pull requests:\*\*\r?\n((?:-.*\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 PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- \\[([ x])] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
url: match[2],
number: Number.parseInt(match[3], 10),
isVerified: match[1] === 'x',
}),
);
return _.sortBy(PRList, 'number');
Expand All @@ -273,7 +272,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
static 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 All @@ -295,7 +294,7 @@ class GithubUtils {
* @private
*
* @param {Object} issue
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean, isAccessible: Boolean}]
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
static getStagingDeployCashInternalQA(issue) {
let internalQASection = issue.body.match(/Internal QA:\*\*\r?\n((?:- \[[ x]].*\r?\n)+)/) || [];
Expand All @@ -309,7 +308,6 @@ class GithubUtils {
url: match[2].split('-')[0].trim(),
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
isAccessible: false,
}),
);
return _.sortBy(internalQAPRs, 'number');
Expand All @@ -321,7 +319,6 @@ class GithubUtils {
* @param {String} tag
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
* @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.
Expand All @@ -333,7 +330,6 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
Expand Down Expand Up @@ -370,7 +366,6 @@ class GithubUtils {
);
console.log('Found the following NO QA PRs:', noQAPRs);
const verifiedOrNoQAPRs = _.union(verifiedPRList, noQAPRs);
const accessibleOrNoQAPRs = _.union(accessiblePRList, noQAPRs);

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
Expand All @@ -389,36 +384,40 @@ class GithubUtils {

// PR list
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
issueBody += '\r\n**This release contains changes from the following pull requests:**\r\n';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedOrNoQAPRs, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessibleOrNoQAPRs, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]';
issueBody += ` ${URL}\r\n`;
});
issueBody += '\r\n\r\n';
}

// 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:**';
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
issueBody += '**Deploy Blockers:**\r\n';
_.each(sortedDeployBlockers, (URL) => {
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '- [x] ' : '- [ ] ';
issueBody += URL;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
}

issueBody += '\r\n\r\n**Deployer verifications:**';
issueBody += '**Deployer verifications:**';
// eslint-disable-next-line max-len
issueBody += `\r\n- [${isTimingDashboardChecked ? 'x' : ' '}] I checked the [App Timing Dashboard](https://graphs.expensify.com/grafana/d/yj2EobAGz/app-timing?orgId=1) and verified this release does not cause a noticeable performance regression.`;
// eslint-disable-next-line max-len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const run = function () {
console.log('Checking for unverified PRs or unresolved deploy blockers', data);

// Check the issue description to see if there are any unfinished/un-QAed items in the checklist.
const uncheckedBoxRegex = /-\s\[\s]\s(?!Accessibility)/;
const uncheckedBoxRegex = /-\s\[\s]\s/;
if (uncheckedBoxRegex.test(data.body)) {
console.log('An unverified PR or unresolved deploy blocker was found.');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
Expand Down
43 changes: 21 additions & 22 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const run = function () {
console.log('Checking for unverified PRs or unresolved deploy blockers', data);

// Check the issue description to see if there are any unfinished/un-QAed items in the checklist.
const uncheckedBoxRegex = /-\s\[\s]\s(?!Accessibility)/;
const uncheckedBoxRegex = /-\s\[\s]\s/;
if (uncheckedBoxRegex.test(data.body)) {
console.log('An unverified PR or unresolved deploy blocker was found.');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
Expand Down Expand Up @@ -215,20 +215,19 @@ class GithubUtils {
* @returns {Array<Object>} - [{url: String, number: Number, isVerified: Boolean}]
*/
static getStagingDeployCashPRList(issue) {
let PRListSection = issue.body.match(/pull requests:\*\*(?:\r?\n)*((?:.*\r?\n(?:\s+-\s.*\r?\n)+\r?\n)+)/) || [];
let PRListSection = issue.body.match(/pull requests:\*\*\r?\n((?:-.*\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 PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- \\[([ x])] (${PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
url: match[2],
number: Number.parseInt(match[3], 10),
isVerified: match[1] === 'x',
}),
);
return _.sortBy(PRList, 'number');
Expand All @@ -243,7 +242,7 @@ class GithubUtils {
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
static 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 All @@ -265,7 +264,7 @@ class GithubUtils {
* @private
*
* @param {Object} issue
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean, isAccessible: Boolean}]
* @returns {Array<Object>} - [{URL: String, number: Number, isResolved: Boolean}]
*/
static getStagingDeployCashInternalQA(issue) {
let internalQASection = issue.body.match(/Internal QA:\*\*\r?\n((?:- \[[ x]].*\r?\n)+)/) || [];
Expand All @@ -279,7 +278,6 @@ class GithubUtils {
url: match[2].split('-')[0].trim(),
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
isAccessible: false,
}),
);
return _.sortBy(internalQAPRs, 'number');
Expand All @@ -291,7 +289,6 @@ class GithubUtils {
* @param {String} tag
* @param {Array} PRList - The list of PR URLs which are included in this StagingDeployCash
* @param {Array} [verifiedPRList] - The list of PR URLs which have passed QA.
* @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.
Expand All @@ -303,7 +300,6 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessiblePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
resolvedInternalQAPRs = [],
Expand Down Expand Up @@ -340,7 +336,6 @@ class GithubUtils {
);
console.log('Found the following NO QA PRs:', noQAPRs);
const verifiedOrNoQAPRs = _.union(verifiedPRList, noQAPRs);
const accessibleOrNoQAPRs = _.union(accessiblePRList, noQAPRs);

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
Expand All @@ -359,36 +354,40 @@ class GithubUtils {

// PR list
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
issueBody += '\r\n**This release contains changes from the following pull requests:**\r\n';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedOrNoQAPRs, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessibleOrNoQAPRs, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]';
issueBody += ` ${URL}\r\n`;
});
issueBody += '\r\n\r\n';
}

// 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:**';
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
issueBody += '**Deploy Blockers:**\r\n';
_.each(sortedDeployBlockers, (URL) => {
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '- [x] ' : '- [ ] ';
issueBody += URL;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
}

issueBody += '\r\n\r\n**Deployer verifications:**';
issueBody += '**Deployer verifications:**';
// eslint-disable-next-line max-len
issueBody += `\r\n- [${isTimingDashboardChecked ? 'x' : ' '}] I checked the [App Timing Dashboard](https://graphs.expensify.com/grafana/d/yj2EobAGz/app-timing?orgId=1) and verified this release does not cause a noticeable performance regression.`;
// eslint-disable-next-line max-len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ const run = function () {
// Since this is the second argument to _.union,
// it will appear later in the array than any duplicate.
// Since it is later in the array, it will be truncated by _.unique,
// and the original value of isVerified and isAccessible will be preserved.
// and the original value of isVerified will be preserved.
isVerified: false,
isAccessible: false,
}))),
false,
item => item.number,
Expand Down Expand Up @@ -132,7 +131,6 @@ const run = function () {
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'),
Expand Down
Loading