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] Fix accessibility checkboxes in deploy checklist #6047

Merged
merged 6 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
49 changes: 14 additions & 35 deletions .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,26 +213,16 @@ class GithubUtils {
return [];
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
const PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: true,
}),
);
return _.sortBy(
_.union(unverifiedPRs, verifiedPRs),
'number',
);
return _.sortBy(PRList, 'number');
}

/**
Expand All @@ -249,26 +239,15 @@ class GithubUtils {
return [];
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: false,
}),
);
const resolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
const deployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: true,
url: match[2],
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
}),
);
return _.sortBy(
_.union(unresolvedDeployBlockers, resolvedDeployBlockers),
'number',
);
return _.sortBy(deployBlockers, 'number');
}

/**
Expand Down Expand Up @@ -325,8 +304,8 @@ class GithubUtils {
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
_.each(sortedDeployBlockers, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += URL;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ const run = function () {
const PRList = _.sortBy(
_.unique(
_.union(currentStagingDeployCashData.PRList, _.map(mergedPRs, number => ({
number,
number: Number.parseInt(number, 10),
url: GithubUtils.getPullRequestURLFromNumber(number),

// 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.
isVerified: false,
isAccessible: false,
isAccessiblityVerified: false,
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
}))),
false,
item => item.number,
Expand Down
53 changes: 16 additions & 37 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ const run = function () {
const PRList = _.sortBy(
_.unique(
_.union(currentStagingDeployCashData.PRList, _.map(mergedPRs, number => ({
number,
number: Number.parseInt(number, 10),
url: GithubUtils.getPullRequestURLFromNumber(number),

// 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.
isVerified: false,
isAccessible: false,
isAccessiblityVerified: false,
}))),
false,
item => item.number,
Expand Down Expand Up @@ -342,26 +342,16 @@ class GithubUtils {
return [];
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
const PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: true,
}),
);
return _.sortBy(
_.union(unverifiedPRs, verifiedPRs),
'number',
);
return _.sortBy(PRList, 'number');
}

/**
Expand All @@ -378,26 +368,15 @@ class GithubUtils {
return [];
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
const deployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: false,
url: match[2],
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
}),
);
const resolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: true,
}),
);
return _.sortBy(
_.union(unresolvedDeployBlockers, resolvedDeployBlockers),
'number',
);
return _.sortBy(deployBlockers, 'number');
}

/**
Expand Down Expand Up @@ -454,8 +433,8 @@ class GithubUtils {
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
_.each(sortedDeployBlockers, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += URL;
});
}

Expand Down
49 changes: 14 additions & 35 deletions .github/actions/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,26 +266,16 @@ class GithubUtils {
return [];
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
const PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: true,
}),
);
return _.sortBy(
_.union(unverifiedPRs, verifiedPRs),
'number',
);
return _.sortBy(PRList, 'number');
}

/**
Expand All @@ -302,26 +292,15 @@ class GithubUtils {
return [];
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: false,
}),
);
const resolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
const deployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: true,
url: match[2],
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
}),
);
return _.sortBy(
_.union(unresolvedDeployBlockers, resolvedDeployBlockers),
'number',
);
return _.sortBy(deployBlockers, 'number');
}

/**
Expand Down Expand Up @@ -378,8 +357,8 @@ class GithubUtils {
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
_.each(sortedDeployBlockers, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += URL;
});
}

Expand Down
49 changes: 14 additions & 35 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,26 +184,16 @@ class GithubUtils {
return [];
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
const PRList = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
number: Number.parseInt(match[2], 10),
isVerified: match[3] === 'x',
isAccessible: match[4] === 'x',
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: true,
}),
);
return _.sortBy(
_.union(unverifiedPRs, verifiedPRs),
'number',
);
return _.sortBy(PRList, 'number');
}

/**
Expand All @@ -220,26 +210,15 @@ class GithubUtils {
return [];
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: false,
}),
);
const resolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
const deployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
isResolved: true,
url: match[2],
number: Number.parseInt(match[3], 10),
isResolved: match[1] === 'x',
}),
);
return _.sortBy(
_.union(unresolvedDeployBlockers, resolvedDeployBlockers),
'number',
);
return _.sortBy(deployBlockers, 'number');
}

/**
Expand Down Expand Up @@ -296,8 +275,8 @@ class GithubUtils {
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
_.each(sortedDeployBlockers, (URL) => {
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] ';
issueBody += URL;
});
}

Expand Down
Loading