Skip to content

Commit

Permalink
Update actions build
Browse files Browse the repository at this point in the history
  • Loading branch information
stitesExpensify committed Oct 12, 2021
1 parent 983de3b commit b78918e
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 99 deletions.
21 changes: 10 additions & 11 deletions .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ class GithubUtils {
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
Expand Down Expand Up @@ -250,15 +250,15 @@ class GithubUtils {
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`(${ISSUE_OR_PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...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})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
Expand All @@ -277,7 +277,7 @@ 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} [accessabilityPRList] - The list of PR URLs which have passed the accessability check.
* @param {Array} [accessablePRList] - 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.
* @returns {Promise}
Expand All @@ -286,7 +286,7 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessabilityPRList = [],
accessablePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
) {
Expand Down Expand Up @@ -315,19 +315,18 @@ class GithubUtils {
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n${URL}`;
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessabilityPRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
});
}

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

Expand Down Expand Up @@ -409,7 +408,7 @@ class GithubUtils {
static getReleaseBody(pullRequests) {
return _.map(
pullRequests,
number => `${this.getPullRequestURLFromNumber(number)}`,
number => `- ${this.getPullRequestURLFromNumber(number)}`,
).join('\r\n');
}

Expand Down
21 changes: 10 additions & 11 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ class GithubUtils {
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
Expand Down Expand Up @@ -379,15 +379,15 @@ class GithubUtils {
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`(${ISSUE_OR_PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...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})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
Expand All @@ -406,7 +406,7 @@ 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} [accessabilityPRList] - The list of PR URLs which have passed the accessability check.
* @param {Array} [accessablePRList] - 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.
* @returns {Promise}
Expand All @@ -415,7 +415,7 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessabilityPRList = [],
accessablePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
) {
Expand Down Expand Up @@ -444,19 +444,18 @@ class GithubUtils {
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n${URL}`;
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessabilityPRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
});
}

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

Expand Down Expand Up @@ -538,7 +537,7 @@ class GithubUtils {
static getReleaseBody(pullRequests) {
return _.map(
pullRequests,
number => `${this.getPullRequestURLFromNumber(number)}`,
number => `- ${this.getPullRequestURLFromNumber(number)}`,
).join('\r\n');
}

Expand Down
21 changes: 10 additions & 11 deletions .github/actions/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ class GithubUtils {
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
Expand Down Expand Up @@ -303,15 +303,15 @@ class GithubUtils {
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`(${ISSUE_OR_PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...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})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
Expand All @@ -330,7 +330,7 @@ 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} [accessabilityPRList] - The list of PR URLs which have passed the accessability check.
* @param {Array} [accessablePRList] - 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.
* @returns {Promise}
Expand All @@ -339,7 +339,7 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessabilityPRList = [],
accessablePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
) {
Expand Down Expand Up @@ -368,19 +368,18 @@ class GithubUtils {
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n${URL}`;
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessabilityPRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
});
}

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

Expand Down Expand Up @@ -462,7 +461,7 @@ class GithubUtils {
static getReleaseBody(pullRequests) {
return _.map(
pullRequests,
number => `${this.getPullRequestURLFromNumber(number)}`,
number => `- ${this.getPullRequestURLFromNumber(number)}`,
).join('\r\n');
}

Expand Down
21 changes: 10 additions & 11 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ class GithubUtils {
}
PRListSection = PRListSection[1];
const unverifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
isVerified: false,
}),
);
const verifiedPRs = _.map(
[...PRListSection.matchAll(new RegExp(`(${PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getPullRequestNumberFromURL(match[1]),
Expand Down Expand Up @@ -221,15 +221,15 @@ class GithubUtils {
}
deployBlockerSection = deployBlockerSection[1];
const unresolvedDeployBlockers = _.map(
[...deployBlockerSection.matchAll(new RegExp(`(${ISSUE_OR_PULL_REQUEST_REGEX.source})[\r\n]\\s+- \\[ \\] QA`, 'g'))],
[...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})[\r\n]\\s+- \\[x\\] QA`, 'g'))],
[...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))],
match => ({
url: match[1],
number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]),
Expand All @@ -248,7 +248,7 @@ 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} [accessabilityPRList] - The list of PR URLs which have passed the accessability check.
* @param {Array} [accessablePRList] - 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.
* @returns {Promise}
Expand All @@ -257,7 +257,7 @@ class GithubUtils {
tag,
PRList,
verifiedPRList = [],
accessabilityPRList = [],
accessablePRList = [],
deployBlockers = [],
resolvedDeployBlockers = [],
) {
Expand Down Expand Up @@ -286,19 +286,18 @@ class GithubUtils {
if (!_.isEmpty(sortedPRList)) {
issueBody += '\r\n**This release contains changes from the following pull requests:**';
_.each(sortedPRList, (URL) => {
issueBody += `\r\n\r\n${URL}`;
issueBody += `\r\n\r\n- ${URL}`;
issueBody += _.contains(verifiedPRList, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA';
issueBody += _.contains(accessabilityPRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
issueBody += _.contains(accessablePRList, URL) ? '\r\n - [x] Accessibility' : '\r\n - [ ] Accessibility';
});
}

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

Expand Down Expand Up @@ -380,7 +379,7 @@ class GithubUtils {
static getReleaseBody(pullRequests) {
return _.map(
pullRequests,
number => `${this.getPullRequestURLFromNumber(number)}`,
number => `- ${this.getPullRequestURLFromNumber(number)}`,
).join('\r\n');
}

Expand Down
Loading

0 comments on commit b78918e

Please sign in to comment.