Skip to content

Commit 40d81a8

Browse files
committed
Merge branch 'main' into fix/57775
2 parents d3d7ab6 + 5e7543e commit 40d81a8

889 files changed

Lines changed: 33426 additions & 11958 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ src/libs/SearchParser/searchParser.js
1515
src/libs/SearchParser/autocompleteParser.js
1616
help/_scripts/**
1717
Mobile-Expensify/**
18+
vendor

.eslintrc.changed.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
rules: {
88
'deprecation/deprecation': 'error',
99
'rulesdir/no-default-id-values': 'error',
10+
'rulesdir/provide-canBeMissing-in-useOnyx': 'error',
1011
'no-restricted-syntax': [
1112
'error',
1213
{

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,16 @@ module.exports = {
237237
selector: 'TSEnumDeclaration',
238238
message: "Please don't declare enums, use union types instead.",
239239
},
240+
241+
// These are the original rules from AirBnB's style guide, modified to allow for...of loops and for...in loops
242+
{
243+
selector: 'LabeledStatement',
244+
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
245+
},
246+
{
247+
selector: 'WithStatement',
248+
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize. It is also deprecated.',
249+
},
240250
],
241251
'no-restricted-properties': [
242252
'error',

.github/actions/javascript/authorChecklist/index.js

Lines changed: 278 additions & 179 deletions
Large diffs are not rendered by default.

.github/actions/javascript/awaitStagingDeploys/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12437,7 +12437,7 @@ class GithubUtils {
1243712437
static getStagingDeployCashData(issue) {
1243812438
try {
1243912439
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
12440-
const tag = issue.body?.match(versionRegex)?.[0].replace(/`/g, '');
12440+
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
1244112441
return {
1244212442
title: issue.title,
1244312443
url: issue.url,
@@ -12449,7 +12449,8 @@ class GithubUtils {
1244912449
isTimingDashboardChecked: issue.body ? /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body) : false,
1245012450
isFirebaseChecked: issue.body ? /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body) : false,
1245112451
isGHStatusChecked: issue.body ? /-\s\[x]\sI checked \[GitHub Status]/.test(issue.body) : false,
12452-
tag,
12452+
version,
12453+
tag: `${version}-staging`,
1245312454
};
1245412455
}
1245512456
catch (exception) {

.github/actions/javascript/checkAndroidStatus/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737132,7 +737132,7 @@ class GithubUtils {
737132737132
static getStagingDeployCashData(issue) {
737133737133
try {
737134737134
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
737135-
const tag = issue.body?.match(versionRegex)?.[0].replace(/`/g, '');
737135+
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
737136737136
return {
737137737137
title: issue.title,
737138737138
url: issue.url,
@@ -737144,7 +737144,8 @@ class GithubUtils {
737144737144
isTimingDashboardChecked: issue.body ? /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body) : false,
737145737145
isFirebaseChecked: issue.body ? /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body) : false,
737146737146
isGHStatusChecked: issue.body ? /-\s\[x]\sI checked \[GitHub Status]/.test(issue.body) : false,
737147-
tag,
737147+
version,
737148+
tag: `${version}-staging`,
737148737149
};
737149737150
}
737150737151
catch (exception) {

.github/actions/javascript/checkDeployBlockers/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11720,7 +11720,7 @@ class GithubUtils {
1172011720
static getStagingDeployCashData(issue) {
1172111721
try {
1172211722
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
11723-
const tag = issue.body?.match(versionRegex)?.[0].replace(/`/g, '');
11723+
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
1172411724
return {
1172511725
title: issue.title,
1172611726
url: issue.url,
@@ -11732,7 +11732,8 @@ class GithubUtils {
1173211732
isTimingDashboardChecked: issue.body ? /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body) : false,
1173311733
isFirebaseChecked: issue.body ? /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body) : false,
1173411734
isGHStatusChecked: issue.body ? /-\s\[x]\sI checked \[GitHub Status]/.test(issue.body) : false,
11735-
tag,
11735+
version,
11736+
tag: `${version}-staging`,
1173611737
};
1173711738
}
1173811739
catch (exception) {

.github/actions/javascript/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ type PackageJson = {
1515
async function run(): Promise<IssuesCreateResponse | void> {
1616
// Note: require('package.json').version does not work because ncc will resolve that to a plain string at compile time
1717
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')) as PackageJson;
18-
const newVersionTag = packageJson.version;
18+
// The checklist will use the package.json version, e.g. '1.2.3-4'
19+
const newVersion = packageJson.version;
20+
// The staging tag will use the package.json version with a '-staging' suffix, e.g. '1.2.3-4-staging'
21+
const newStagingTag = `${packageJson.version}-staging`;
1922

2023
try {
2124
// Start by fetching the list of recent StagingDeployCash issues, along with the list of open deploy blockers
@@ -52,14 +55,14 @@ async function run(): Promise<IssuesCreateResponse | void> {
5255
const currentChecklistData: StagingDeployCashData | undefined = shouldCreateNewDeployChecklist ? undefined : GithubUtils.getStagingDeployCashData(mostRecentChecklist);
5356

5457
// Find the list of PRs merged between the current checklist and the previous checklist
55-
const mergedPRs = await GitUtils.getPullRequestsMergedBetween(previousChecklistData.tag ?? '', newVersionTag);
58+
const mergedPRs = await GitUtils.getPullRequestsMergedBetween(previousChecklistData.tag, newStagingTag);
5659

5760
// Next, we generate the checklist body
5861
let checklistBody = '';
5962
let checklistAssignees: string[] = [];
6063
if (shouldCreateNewDeployChecklist) {
6164
const stagingDeployCashBodyAndAssignees = await GithubUtils.generateStagingDeployCashBodyAndAssignees(
62-
newVersionTag,
65+
newVersion,
6366
mergedPRs.map((value) => GithubUtils.getPullRequestURLFromNumber(value)),
6467
);
6568
if (stagingDeployCashBodyAndAssignees) {
@@ -106,9 +109,9 @@ async function run(): Promise<IssuesCreateResponse | void> {
106109
});
107110
});
108111

109-
const didVersionChange = newVersionTag !== currentChecklistData?.tag;
112+
const didVersionChange = newVersion !== currentChecklistData?.version;
110113
const stagingDeployCashBodyAndAssignees = await GithubUtils.generateStagingDeployCashBodyAndAssignees(
111-
newVersionTag,
114+
newVersion,
112115
PRList.map((pr) => pr.url),
113116
PRList.filter((pr) => pr.isVerified).map((pr) => pr.url),
114117
deployBlockers.map((blocker) => blocker.url),

.github/actions/javascript/createOrUpdateStagingDeploy/index.js

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11462,7 +11462,10 @@ const GitUtils_1 = __importDefault(__nccwpck_require__(1547));
1146211462
async function run() {
1146311463
// Note: require('package.json').version does not work because ncc will resolve that to a plain string at compile time
1146411464
const packageJson = JSON.parse(fs_1.default.readFileSync('package.json', 'utf8'));
11465-
const newVersionTag = packageJson.version;
11465+
// The checklist will use the package.json version, e.g. '1.2.3-4'
11466+
const newVersion = packageJson.version;
11467+
// The staging tag will use the package.json version with a '-staging' suffix, e.g. '1.2.3-4-staging'
11468+
const newStagingTag = `${packageJson.version}-staging`;
1146611469
try {
1146711470
// Start by fetching the list of recent StagingDeployCash issues, along with the list of open deploy blockers
1146811471
const { data: recentDeployChecklists } = await GithubUtils_1.default.octokit.issues.listForRepo({
@@ -11493,12 +11496,12 @@ async function run() {
1149311496
const previousChecklistData = GithubUtils_1.default.getStagingDeployCashData(previousChecklist);
1149411497
const currentChecklistData = shouldCreateNewDeployChecklist ? undefined : GithubUtils_1.default.getStagingDeployCashData(mostRecentChecklist);
1149511498
// Find the list of PRs merged between the current checklist and the previous checklist
11496-
const mergedPRs = await GitUtils_1.default.getPullRequestsMergedBetween(previousChecklistData.tag ?? '', newVersionTag);
11499+
const mergedPRs = await GitUtils_1.default.getPullRequestsMergedBetween(previousChecklistData.tag, newStagingTag);
1149711500
// Next, we generate the checklist body
1149811501
let checklistBody = '';
1149911502
let checklistAssignees = [];
1150011503
if (shouldCreateNewDeployChecklist) {
11501-
const stagingDeployCashBodyAndAssignees = await GithubUtils_1.default.generateStagingDeployCashBodyAndAssignees(newVersionTag, mergedPRs.map((value) => GithubUtils_1.default.getPullRequestURLFromNumber(value)));
11504+
const stagingDeployCashBodyAndAssignees = await GithubUtils_1.default.generateStagingDeployCashBodyAndAssignees(newVersion, mergedPRs.map((value) => GithubUtils_1.default.getPullRequestURLFromNumber(value)));
1150211505
if (stagingDeployCashBodyAndAssignees) {
1150311506
checklistBody = stagingDeployCashBodyAndAssignees.issueBody;
1150411507
checklistAssignees = stagingDeployCashBodyAndAssignees.issueAssignees.filter(Boolean);
@@ -11540,8 +11543,8 @@ async function run() {
1154011543
isResolved,
1154111544
});
1154211545
});
11543-
const didVersionChange = newVersionTag !== currentChecklistData?.tag;
11544-
const stagingDeployCashBodyAndAssignees = await GithubUtils_1.default.generateStagingDeployCashBodyAndAssignees(newVersionTag, PRList.map((pr) => pr.url), PRList.filter((pr) => pr.isVerified).map((pr) => pr.url), deployBlockers.map((blocker) => blocker.url), deployBlockers.filter((blocker) => blocker.isResolved).map((blocker) => blocker.url), currentChecklistData?.internalQAPRList.filter((pr) => pr.isResolved).map((pr) => pr.url), didVersionChange ? false : currentChecklistData.isTimingDashboardChecked, didVersionChange ? false : currentChecklistData.isFirebaseChecked, didVersionChange ? false : currentChecklistData.isGHStatusChecked);
11546+
const didVersionChange = newVersion !== currentChecklistData?.version;
11547+
const stagingDeployCashBodyAndAssignees = await GithubUtils_1.default.generateStagingDeployCashBodyAndAssignees(newVersion, PRList.map((pr) => pr.url), PRList.filter((pr) => pr.isVerified).map((pr) => pr.url), deployBlockers.map((blocker) => blocker.url), deployBlockers.filter((blocker) => blocker.isResolved).map((blocker) => blocker.url), currentChecklistData?.internalQAPRList.filter((pr) => pr.isResolved).map((pr) => pr.url), didVersionChange ? false : currentChecklistData.isTimingDashboardChecked, didVersionChange ? false : currentChecklistData.isFirebaseChecked, didVersionChange ? false : currentChecklistData.isGHStatusChecked);
1154511548
if (stagingDeployCashBodyAndAssignees) {
1154611549
checklistBody = stagingDeployCashBodyAndAssignees.issueBody;
1154711550
checklistAssignees = stagingDeployCashBodyAndAssignees.issueAssignees.filter(Boolean);
@@ -11643,37 +11646,14 @@ exports["default"] = CONST;
1164311646

1164411647
"use strict";
1164511648

11646-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11647-
if (k2 === undefined) k2 = k;
11648-
var desc = Object.getOwnPropertyDescriptor(m, k);
11649-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11650-
desc = { enumerable: true, get: function() { return m[k]; } };
11651-
}
11652-
Object.defineProperty(o, k2, desc);
11653-
}) : (function(o, m, k, k2) {
11654-
if (k2 === undefined) k2 = k;
11655-
o[k2] = m[k];
11656-
}));
11657-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
11658-
Object.defineProperty(o, "default", { enumerable: true, value: v });
11659-
}) : function(o, v) {
11660-
o["default"] = v;
11661-
});
11662-
var __importStar = (this && this.__importStar) || function (mod) {
11663-
if (mod && mod.__esModule) return mod;
11664-
var result = {};
11665-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11666-
__setModuleDefault(result, mod);
11667-
return result;
11668-
};
1166911649
var __importDefault = (this && this.__importDefault) || function (mod) {
1167011650
return (mod && mod.__esModule) ? mod : { "default": mod };
1167111651
};
1167211652
Object.defineProperty(exports, "__esModule", ({ value: true }));
1167311653
const child_process_1 = __nccwpck_require__(2081);
1167411654
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1167511655
const sanitizeStringForJSONParse_1 = __importDefault(__nccwpck_require__(3902));
11676-
const VersionUpdater = __importStar(__nccwpck_require__(8982));
11656+
const versionUpdater_1 = __nccwpck_require__(8982);
1167711657
/**
1167811658
* Check if a tag exists locally or in the remote.
1167911659
*/
@@ -11721,15 +11701,20 @@ function tagExists(tag) {
1172111701
* @param level the Semver level to step backward by
1172211702
*/
1172311703
function getPreviousExistingTag(tag, level) {
11724-
let previousVersion = VersionUpdater.getPreviousVersion(tag, level);
11704+
let previousVersion = (0, versionUpdater_1.getPreviousVersion)(tag.replace('-staging', ''), level);
1172511705
let tagExistsForPreviousVersion = false;
1172611706
while (!tagExistsForPreviousVersion) {
1172711707
if (tagExists(previousVersion)) {
1172811708
tagExistsForPreviousVersion = true;
1172911709
break;
1173011710
}
11711+
if (tagExists(`${previousVersion}-staging`)) {
11712+
tagExistsForPreviousVersion = true;
11713+
previousVersion = `${previousVersion}-staging`;
11714+
break;
11715+
}
1173111716
console.log(`Tag for previous version ${previousVersion} does not exist. Checking for an older version...`);
11732-
previousVersion = VersionUpdater.getPreviousVersion(previousVersion, level);
11717+
previousVersion = (0, versionUpdater_1.getPreviousVersion)(previousVersion, level);
1173311718
}
1173411719
return previousVersion;
1173511720
}
@@ -11775,8 +11760,8 @@ function fetchTag(tag, shallowExcludeTag = '') {
1177511760
* Get merge logs between two tags (inclusive) as a JavaScript object.
1177611761
*/
1177711762
function getCommitHistoryAsJSON(fromTag, toTag) {
11778-
// Fetch tags, excluding commits reachable from the previous patch version (i.e: previous checklist), so that we don't have to fetch the full history
11779-
const previousPatchVersion = getPreviousExistingTag(fromTag, VersionUpdater.SEMANTIC_VERSION_LEVELS.PATCH);
11763+
// Fetch tags, excluding commits reachable from the previous patch version (or minor for prod) (i.e: previous checklist), so that we don't have to fetch the full history
11764+
const previousPatchVersion = getPreviousExistingTag(fromTag.replace('-staging', ''), fromTag.endsWith('-staging') ? versionUpdater_1.SEMANTIC_VERSION_LEVELS.PATCH : versionUpdater_1.SEMANTIC_VERSION_LEVELS.MINOR);
1178011765
fetchTag(fromTag, previousPatchVersion);
1178111766
fetchTag(toTag, previousPatchVersion);
1178211767
console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
@@ -11821,7 +11806,7 @@ function getValidMergedPRs(commits) {
1182111806
if (author === CONST_1.default.OS_BOTIFY) {
1182211807
return;
1182311808
}
11824-
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-staging)/);
11809+
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/);
1182511810
if (!Array.isArray(match) || match.length < 2) {
1182611811
return;
1182711812
}
@@ -12002,7 +11987,7 @@ class GithubUtils {
1200211987
static getStagingDeployCashData(issue) {
1200311988
try {
1200411989
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
12005-
const tag = issue.body?.match(versionRegex)?.[0].replace(/`/g, '');
11990+
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
1200611991
return {
1200711992
title: issue.title,
1200811993
url: issue.url,
@@ -12014,7 +11999,8 @@ class GithubUtils {
1201411999
isTimingDashboardChecked: issue.body ? /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body) : false,
1201512000
isFirebaseChecked: issue.body ? /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body) : false,
1201612001
isGHStatusChecked: issue.body ? /-\s\[x]\sI checked \[GitHub Status]/.test(issue.body) : false,
12017-
tag,
12002+
version,
12003+
tag: `${version}-staging`,
1201812004
};
1201912005
}
1202012006
catch (exception) {

.github/actions/javascript/getArtifactInfo/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11681,7 +11681,7 @@ class GithubUtils {
1168111681
static getStagingDeployCashData(issue) {
1168211682
try {
1168311683
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
11684-
const tag = issue.body?.match(versionRegex)?.[0].replace(/`/g, '');
11684+
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
1168511685
return {
1168611686
title: issue.title,
1168711687
url: issue.url,
@@ -11693,7 +11693,8 @@ class GithubUtils {
1169311693
isTimingDashboardChecked: issue.body ? /-\s\[x]\sI checked the \[App Timing Dashboard]/.test(issue.body) : false,
1169411694
isFirebaseChecked: issue.body ? /-\s\[x]\sI checked \[Firebase Crashlytics]/.test(issue.body) : false,
1169511695
isGHStatusChecked: issue.body ? /-\s\[x]\sI checked \[GitHub Status]/.test(issue.body) : false,
11696-
tag,
11696+
version,
11697+
tag: `${version}-staging`,
1169711698
};
1169811699
}
1169911700
catch (exception) {

0 commit comments

Comments
 (0)