Skip to content

Commit

Permalink
Merge pull request #6102 from Expensify/yuwen-internalQAChecklist
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored Nov 10, 2021
2 parents 5498334 + 66fc68d commit 2756657
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -277,6 +278,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -287,6 +299,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -309,6 +322,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -406,6 +407,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -416,6 +428,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -438,6 +451,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -330,6 +331,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -340,6 +352,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -362,6 +375,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -248,6 +249,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -258,6 +270,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -280,6 +293,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/isPullRequestMergeable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -253,6 +254,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -263,6 +275,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -285,6 +298,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -229,6 +230,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -239,6 +251,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -261,6 +274,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ const ISSUE_OR_PULL_REQUEST_REGEX = new RegExp(`${GITHUB_BASE_URL_REGEX.source}/
const APPLAUSE_BOT = 'applausebot';
const STAGING_DEPLOY_CASH_LABEL = 'StagingDeployCash';
const DEPLOY_BLOCKER_CASH_LABEL = 'DeployBlockerCash';
const INTERNAL_QA_LABEL = 'InternalQA';

class GithubUtils {
/**
Expand Down Expand Up @@ -381,6 +382,17 @@ class GithubUtils {
);
console.log('Filtering out the following automated pull requests:', automatedPRs);

const internalQAPRMap = _.reduce(
_.filter(data, pr => !_.isEmpty(_.findWhere(pr.labels, {name: INTERNAL_QA_LABEL}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
);
console.log('Found the following Internal QA PRs:', internalQAPRMap);

const noQAPRs = _.pluck(
_.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')),
'html_url',
Expand All @@ -391,6 +403,7 @@ class GithubUtils {

const sortedPRList = _.chain(PRList)
.difference(automatedPRs)
.difference(_.keys(internalQAPRMap))
.unique()
.sortBy(GithubUtils.getPullRequestNumberFromURL)
.value();
Expand All @@ -413,6 +426,16 @@ class GithubUtils {
});
}

if (!_.isEmpty(internalQAPRMap)) {
issueBody += '\r\n\r\n\r\n**Internal QA:**';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `\r\n${_.contains(verifiedOrNoQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
});
}

// Deploy blockers
if (!_.isEmpty(deployBlockers)) {
issueBody += '\r\n\r\n\r\n**Deploy Blockers:**';
Expand Down
Loading

0 comments on commit 2756657

Please sign in to comment.