Skip to content

Commit

Permalink
Merge branch 'main' into migrateGroup6FilesToTypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed Mar 11, 2024
2 parents a2ea06c + a1834ab commit 64827f8
Show file tree
Hide file tree
Showing 113 changed files with 2,632 additions and 1,394 deletions.
16 changes: 7 additions & 9 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, (pr) => !_.isEmpty(_.findWhere(pr.labels, {name: CONST.LABELS.INTERNAL_QA}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = pr.merged_by.login;
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
Expand Down Expand Up @@ -325,11 +325,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` - ${mergerMention}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -359,9 +359,7 @@ class GithubUtils {
issueBody += `\r\n- [${isGHStatusChecked ? 'x' : ' '}] I checked [GitHub Status](https://www.githubstatus.com/) and verified there is no reported incident with Actions.`;

issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
return issueBody;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 7 additions & 9 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, (pr) => !_.isEmpty(_.findWhere(pr.labels, {name: CONST.LABELS.INTERNAL_QA}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = pr.merged_by.login;
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
Expand Down Expand Up @@ -437,11 +437,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` - ${mergerMention}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -471,9 +471,7 @@ class GithubUtils {
issueBody += `\r\n- [${isGHStatusChecked ? 'x' : ' '}] I checked [GitHub Status](https://www.githubstatus.com/) and verified there is no reported incident with Actions.`;

issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
return issueBody;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 7 additions & 9 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, (pr) => !_.isEmpty(_.findWhere(pr.labels, {name: CONST.LABELS.INTERNAL_QA}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = pr.merged_by.login;
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
Expand Down Expand Up @@ -404,11 +404,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` - ${mergerMention}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -438,9 +438,7 @@ class GithubUtils {
issueBody += `\r\n- [${isGHStatusChecked ? 'x' : ' '}] I checked [GitHub Status](https://www.githubstatus.com/) and verified there is no reported incident with Actions.`;

issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
return issueBody;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ async function run() {

// Next, we generate the checklist body
let checklistBody = '';
let checklistAssignees = [];
if (shouldCreateNewDeployChecklist) {
const {issueBody, issueAssignees} = await GithubUtils.generateStagingDeployCashBody(newVersionTag, _.map(mergedPRs, GithubUtils.getPullRequestURLFromNumber));
checklistBody = issueBody;
checklistAssignees = issueAssignees;
checklistBody = await GithubUtils.generateStagingDeployCashBody(newVersionTag, _.map(mergedPRs, GithubUtils.getPullRequestURLFromNumber));
} else {
// Generate the updated PR list, preserving the previous state of `isVerified` for existing PRs
const PRList = _.reduce(
Expand Down Expand Up @@ -97,7 +94,7 @@ async function run() {
}

const didVersionChange = newVersionTag !== currentChecklistData.tag;
const {issueBody, issueAssignees} = await GithubUtils.generateStagingDeployCashBody(
checklistBody = await GithubUtils.generateStagingDeployCashBody(
newVersionTag,
_.pluck(PRList, 'url'),
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
Expand All @@ -108,8 +105,6 @@ async function run() {
didVersionChange ? false : currentChecklistData.isFirebaseChecked,
didVersionChange ? false : currentChecklistData.isGHStatusChecked,
);
checklistBody = issueBody;
checklistAssignees = issueAssignees;
}

// Finally, create or update the checklist
Expand All @@ -124,7 +119,7 @@ async function run() {
...defaultPayload,
title: `Deploy Checklist: New Expensify ${format(new Date(), CONST.DATE_FORMAT_STRING)}`,
labels: [CONST.LABELS.STAGING_DEPLOY],
assignees: [CONST.APPLAUSE_BOT].concat(checklistAssignees),
assignees: [CONST.APPLAUSE_BOT],
});
console.log(`Successfully created new StagingDeployCash! 🎉 ${newChecklist.html_url}`);
return newChecklist;
Expand Down
27 changes: 10 additions & 17 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ async function run() {

// Next, we generate the checklist body
let checklistBody = '';
let checklistAssignees = [];
if (shouldCreateNewDeployChecklist) {
const {issueBody, issueAssignees} = await GithubUtils.generateStagingDeployCashBody(newVersionTag, _.map(mergedPRs, GithubUtils.getPullRequestURLFromNumber));
checklistBody = issueBody;
checklistAssignees = issueAssignees;
checklistBody = await GithubUtils.generateStagingDeployCashBody(newVersionTag, _.map(mergedPRs, GithubUtils.getPullRequestURLFromNumber));
} else {
// Generate the updated PR list, preserving the previous state of `isVerified` for existing PRs
const PRList = _.reduce(
Expand Down Expand Up @@ -106,7 +103,7 @@ async function run() {
}

const didVersionChange = newVersionTag !== currentChecklistData.tag;
const {issueBody, issueAssignees} = await GithubUtils.generateStagingDeployCashBody(
checklistBody = await GithubUtils.generateStagingDeployCashBody(
newVersionTag,
_.pluck(PRList, 'url'),
_.pluck(_.where(PRList, {isVerified: true}), 'url'),
Expand All @@ -117,8 +114,6 @@ async function run() {
didVersionChange ? false : currentChecklistData.isFirebaseChecked,
didVersionChange ? false : currentChecklistData.isGHStatusChecked,
);
checklistBody = issueBody;
checklistAssignees = issueAssignees;
}

// Finally, create or update the checklist
Expand All @@ -133,7 +128,7 @@ async function run() {
...defaultPayload,
title: `Deploy Checklist: New Expensify ${format(new Date(), CONST.DATE_FORMAT_STRING)}`,
labels: [CONST.LABELS.STAGING_DEPLOY],
assignees: [CONST.APPLAUSE_BOT].concat(checklistAssignees),
assignees: [CONST.APPLAUSE_BOT],
});
console.log(`Successfully created new StagingDeployCash! 🎉 ${newChecklist.html_url}`);
return newChecklist;
Expand Down Expand Up @@ -439,14 +434,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, (pr) => !_.isEmpty(_.findWhere(pr.labels, {name: CONST.LABELS.INTERNAL_QA}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = pr.merged_by.login;
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
Expand Down Expand Up @@ -481,11 +476,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` - ${mergerMention}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -515,9 +510,7 @@ class GithubUtils {
issueBody += `\r\n- [${isGHStatusChecked ? 'x' : ' '}] I checked [GitHub Status](https://www.githubstatus.com/) and verified there is no reported incident with Actions.`;

issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
return issueBody;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 7 additions & 9 deletions .github/actions/javascript/getArtifactInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, (pr) => !_.isEmpty(_.findWhere(pr.labels, {name: CONST.LABELS.INTERNAL_QA}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = pr.merged_by.login;
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
Expand Down Expand Up @@ -363,11 +363,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` - ${mergerMention}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -397,9 +397,7 @@ class GithubUtils {
issueBody += `\r\n- [${isGHStatusChecked ? 'x' : ' '}] I checked [GitHub Status](https://www.githubstatus.com/) and verified there is no reported incident with Actions.`;

issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
return issueBody;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 7 additions & 9 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// }
const internalQAPRMap = _.reduce(
_.filter(data, (pr) => !_.isEmpty(_.findWhere(pr.labels, {name: CONST.LABELS.INTERNAL_QA}))),
(map, pr) => {
// eslint-disable-next-line no-param-reassign
map[pr.html_url] = pr.merged_by.login;
map[pr.html_url] = _.compact(_.pluck(pr.assignees, 'login'));
return map;
},
{},
Expand Down Expand Up @@ -419,11 +419,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` - ${mergerMention}`;
issueBody += ` -${assigneeMentions}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -453,9 +453,7 @@ class GithubUtils {
issueBody += `\r\n- [${isGHStatusChecked ? 'x' : ' '}] I checked [GitHub Status](https://www.githubstatus.com/) and verified there is no reported incident with Actions.`;

issueBody += '\r\n\r\ncc @Expensify/applauseleads\r\n';
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
return issueBody;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
Loading

0 comments on commit 64827f8

Please sign in to comment.