Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
Browse files Browse the repository at this point in the history
…s-migration/G9
  • Loading branch information
kubabutkiewicz committed Mar 8, 2024
2 parents 8e55e46 + 86a9904 commit 6b6fb10
Show file tree
Hide file tree
Showing 181 changed files with 2,388 additions and 1,291 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const restrictedImportPaths = [
{
name: 'react-native',
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', 'Text'],
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', 'Text', 'ScrollView'],
message: [
'',
"For 'useWindowDimensions', please use 'src/hooks/useWindowDimensions' instead.",
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
"For 'StatusBar', please use 'src/libs/StatusBar' instead.",
"For 'Text', please use '@components/Text' instead.",
"For 'ScrollView', please use '@components/ScrollView' instead.",
].join('\n'),
},
{
Expand Down
16 changes: 9 additions & 7 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', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// }
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] = _.compact(_.pluck(pr.assignees, 'login'));
map[pr.html_url] = pr.merged_by.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, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += ` - ${mergerMention}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -359,7 +359,9 @@ 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';
return issueBody;
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 9 additions & 7 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', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// }
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] = _.compact(_.pluck(pr.assignees, 'login'));
map[pr.html_url] = pr.merged_by.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, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += ` - ${mergerMention}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -471,7 +471,9 @@ 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';
return issueBody;
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 9 additions & 7 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', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// }
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] = _.compact(_.pluck(pr.assignees, 'login'));
map[pr.html_url] = pr.merged_by.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, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += ` - ${mergerMention}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -438,7 +438,9 @@ 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';
return issueBody;
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
})
.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,8 +40,11 @@ async function run() {

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

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

// Finally, create or update the checklist
Expand All @@ -119,7 +124,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],
assignees: [CONST.APPLAUSE_BOT].concat(checklistAssignees),
});
console.log(`Successfully created new StagingDeployCash! 🎉 ${newChecklist.html_url}`);
return newChecklist;
Expand Down
27 changes: 17 additions & 10 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ async function run() {

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

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

// Finally, create or update the checklist
Expand All @@ -128,7 +133,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],
assignees: [CONST.APPLAUSE_BOT].concat(checklistAssignees),
});
console.log(`Successfully created new StagingDeployCash! 🎉 ${newChecklist.html_url}`);
return newChecklist;
Expand Down Expand Up @@ -434,14 +439,14 @@ class GithubUtils {
.then((data) => {
// The format of this map is following:
// {
// 'https://github.com/Expensify/App/pull/9641': [ 'PauloGasparSv', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// }
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] = _.compact(_.pluck(pr.assignees, 'login'));
map[pr.html_url] = pr.merged_by.login;
return map;
},
{},
Expand Down Expand Up @@ -476,11 +481,11 @@ class GithubUtils {
if (!_.isEmpty(internalQAPRMap)) {
console.log('Found the following verified Internal QA PRs:', resolvedInternalQAPRs);
issueBody += '**Internal QA:**\r\n';
_.each(internalQAPRMap, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += ` - ${mergerMention}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -510,7 +515,9 @@ 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';
return issueBody;
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
16 changes: 9 additions & 7 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', 'kidroca' ],
// 'https://github.com/Expensify/App/pull/9642': [ 'mountiny', 'kidroca' ]
// 'https://github.com/Expensify/App/pull/9641': 'PauloGasparSv',
// 'https://github.com/Expensify/App/pull/9642': 'mountiny'
// }
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] = _.compact(_.pluck(pr.assignees, 'login'));
map[pr.html_url] = pr.merged_by.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, (assignees, URL) => {
const assigneeMentions = _.reduce(assignees, (memo, assignee) => `${memo} @${assignee}`, '');
_.each(internalQAPRMap, (merger, URL) => {
const mergerMention = `@${merger}`;
issueBody += `${_.contains(resolvedInternalQAPRs, URL) ? '- [x]' : '- [ ]'} `;
issueBody += `${URL}`;
issueBody += ` -${assigneeMentions}`;
issueBody += ` - ${mergerMention}`;
issueBody += '\r\n';
});
issueBody += '\r\n\r\n';
Expand Down Expand Up @@ -397,7 +397,9 @@ 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';
return issueBody;
const issueAssignees = _.values(internalQAPRMap);
const issue = {issueBody, issueAssignees};
return issue;
})
.catch((err) => console.warn('Error generating StagingDeployCash issue body! Continuing...', err));
}
Expand Down
Loading

0 comments on commit 6b6fb10

Please sign in to comment.