Skip to content

Commit

Permalink
Merge branch 'main' into fix/37819
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Mar 18, 2024
2 parents 57f164f + c915e7f commit fa1cedc
Show file tree
Hide file tree
Showing 558 changed files with 12,777 additions and 15,563 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ module.exports = {
{
selector: ['parameter', 'method'],
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
],
'@typescript-eslint/ban-types': [
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like `Avatar` is modified, I verified that `Avatar` is working as expected in all cases)
- [ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- [ ] If the PR modifies the form input styles:
- [ ] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
- [ ] I verified that all the inputs inside a form are aligned with each other.
- [ ] I added `Design` label so the design team can review the changes.
- [ ] I added `Design` label and/or tagged `@Expensify/design` so the design team can review the changes.
- [ ] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
- [ ] If the `main` branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the `Test` steps.

Expand Down
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
Loading

0 comments on commit fa1cedc

Please sign in to comment.