Skip to content

Commit 8d47250

Browse files
committed
Merge branch 'main' into youssef_reports_awaiting_first_level_approval
2 parents f5bab22 + 286212c commit 8d47250

File tree

970 files changed

+39756
-18382
lines changed

Some content is hidden

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

970 files changed

+39756
-18382
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ docs/assets/**
1212
web/gtm.js
1313
**/.expo/**
1414
src/libs/SearchParser/searchParser.js
15+
help/_scripts/**

.eslintrc.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module.exports = {
108108
'plugin:you-dont-need-lodash-underscore/all',
109109
'plugin:prettier/recommended',
110110
],
111-
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library', 'eslint-plugin-react-compiler', 'lodash'],
111+
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library', 'eslint-plugin-react-compiler', 'lodash', 'deprecation'],
112112
ignorePatterns: ['lib/**'],
113113
parser: '@typescript-eslint/parser',
114114
parserOptions: {
@@ -177,6 +177,7 @@ module.exports = {
177177
// ESLint core rules
178178
'es/no-nullish-coalescing-operators': 'off',
179179
'es/no-optional-chaining': 'off',
180+
'deprecation/deprecation': 'off',
180181

181182
// Import specific rules
182183
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
@@ -290,5 +291,11 @@ module.exports = {
290291
'rulesdir/use-periods-for-error-messages': 'error',
291292
},
292293
},
294+
{
295+
files: ['*.ts', '*.tsx'],
296+
rules: {
297+
'rulesdir/prefer-at': 'error',
298+
},
299+
},
293300
],
294301
};

.github/ISSUE_TEMPLATE/Standard.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ___
1010
**Version Number:**
1111
**Reproducible in staging?:**
1212
**Reproducible in production?:**
13+
**If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:**
1314
**If this was caught during regression testing, add the test name, ID and link from TestRail:**
1415
**Email or phone of affected tester (no customers):**
1516
**Logs:** https://stackoverflow.com/c/expensify/questions/4856
@@ -34,17 +35,21 @@ Can the user still use Expensify without this being fixed? Have you informed the
3435
Check off any platforms that are affected by this issue
3536
--->
3637
Which of our officially supported platforms is this issue occurring on?
37-
- [ ] Android: Native
38+
- [ ] Android: Standalone
39+
- [ ] Android: HybridApp
3840
- [ ] Android: mWeb Chrome
39-
- [ ] iOS: Native
41+
- [ ] iOS: Standalone
42+
- [ ] iOS: HybridApp
4043
- [ ] iOS: mWeb Safari
4144
- [ ] MacOS: Chrome / Safari
4245
- [ ] MacOS: Desktop
4346

4447
## Screenshots/Videos
4548

46-
Add any screenshot/video evidence
49+
<details>
50+
<summary>Add any screenshot/video evidence</summary>
4751

52+
4853
</details>
4954

5055
[View all open jobs on GitHub](https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22)

.github/actions/composite/buildAndroidE2EAPK/action.yml

-102
This file was deleted.

.github/actions/composite/setupGitForOSBotify/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
- name: Set up git for OSBotify
2121
shell: bash
2222
run: |
23-
git config user.signingkey 367811D53E34168C
23+
git config user.signingkey AEE1036472A782AB
2424
git config commit.gpgsign true
2525
git config user.name OSBotify
2626
git config user.email infra+osbotify@expensify.com

.github/actions/composite/setupGitForOSBotifyApp/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ runs:
5050
- name: Set up git for OSBotify
5151
shell: bash
5252
run: |
53-
git config user.signingkey 367811D53E34168C
53+
git config user.signingkey AEE1036472A782AB
5454
git config commit.gpgsign true
5555
git config user.name OSBotify
5656
git config user.email infra+osbotify@expensify.com

.github/actions/javascript/authorChecklist/authorChecklist.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ function partitionWithChecklist(body: string): string[] {
5454
async function getNumberOfItemsFromAuthorChecklist(): Promise<number> {
5555
const response = await fetch(pathToAuthorChecklist);
5656
const fileContents = await response.text();
57-
const checklist = partitionWithChecklist(fileContents)[1];
58-
const numberOfChecklistItems = (checklist.match(/\[ \]/g) ?? []).length;
57+
const checklist = partitionWithChecklist(fileContents).at(1);
58+
const numberOfChecklistItems = (checklist?.match(/\[ \]/g) ?? []).length ?? 0;
5959
return numberOfChecklistItems;
6060
}
6161

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

+11-7
Original file line numberDiff line numberDiff line change
@@ -16771,8 +16771,8 @@ function partitionWithChecklist(body) {
1677116771
async function getNumberOfItemsFromAuthorChecklist() {
1677216772
const response = await fetch(pathToAuthorChecklist);
1677316773
const fileContents = await response.text();
16774-
const checklist = partitionWithChecklist(fileContents)[1];
16775-
const numberOfChecklistItems = (checklist.match(/\[ \]/g) ?? []).length;
16774+
const checklist = partitionWithChecklist(fileContents).at(1);
16775+
const numberOfChecklistItems = (checklist?.match(/\[ \]/g) ?? []).length ?? 0;
1677616776
return numberOfChecklistItems;
1677716777
}
1677816778
function checkPRForCompletedChecklist(expectedNumberOfChecklistItems, checklist) {
@@ -17180,7 +17180,11 @@ class GithubUtils {
1718017180
if (data.length > 1) {
1718117181
throw new Error(`Found more than one ${CONST_1.default.LABELS.STAGING_DEPLOY} issue.`);
1718217182
}
17183-
return this.getStagingDeployCashData(data[0]);
17183+
const issue = data.at(0);
17184+
if (!issue) {
17185+
throw new Error(`Found an undefined ${CONST_1.default.LABELS.STAGING_DEPLOY} issue.`);
17186+
}
17187+
return this.getStagingDeployCashData(issue);
1718417188
});
1718517189
}
1718617190
/**
@@ -17258,7 +17262,7 @@ class GithubUtils {
1725817262
}
1725917263
internalQASection = internalQASection[1];
1726017264
const internalQAPRs = [...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${CONST_1.default.PULL_REQUEST_REGEX.source})`, 'g'))].map((match) => ({
17261-
url: match[2].split('-')[0].trim(),
17265+
url: match[2].split('-').at(0)?.trim() ?? '',
1726217266
number: Number.parseInt(match[3], 10),
1726317267
isResolved: match[1] === 'x',
1726417268
}));
@@ -17342,7 +17346,7 @@ class GithubUtils {
1734217346
* Fetch all pull requests given a list of PR numbers.
1734317347
*/
1734417348
static fetchAllPullRequests(pullRequestNumbers) {
17345-
const oldestPR = pullRequestNumbers.sort((a, b) => a - b)[0];
17349+
const oldestPR = pullRequestNumbers.sort((a, b) => a - b).at(0);
1734617350
return this.paginate(this.octokit.pulls.list, {
1734717351
owner: CONST_1.default.GITHUB_OWNER,
1734817352
repo: CONST_1.default.APP_REPO,
@@ -17416,7 +17420,7 @@ class GithubUtils {
1741617420
repo: CONST_1.default.APP_REPO,
1741717421
workflow_id: workflow,
1741817422
})
17419-
.then((response) => response.data.workflow_runs[0]?.id);
17423+
.then((response) => response.data.workflow_runs.at(0)?.id ?? -1);
1742017424
}
1742117425
/**
1742217426
* Generate the URL of an New Expensify pull request given the PR number.
@@ -17484,7 +17488,7 @@ class GithubUtils {
1748417488
per_page: 1,
1748517489
name: artifactName,
1748617490
})
17487-
.then((response) => response.data.artifacts[0]);
17491+
.then((response) => response.data.artifacts.at(0));
1748817492
}
1748917493
/**
1749017494
* Given an artifact ID, returns the download URL to a zip file containing the artifact.

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -12421,7 +12421,11 @@ class GithubUtils {
1242112421
if (data.length > 1) {
1242212422
throw new Error(`Found more than one ${CONST_1.default.LABELS.STAGING_DEPLOY} issue.`);
1242312423
}
12424-
return this.getStagingDeployCashData(data[0]);
12424+
const issue = data.at(0);
12425+
if (!issue) {
12426+
throw new Error(`Found an undefined ${CONST_1.default.LABELS.STAGING_DEPLOY} issue.`);
12427+
}
12428+
return this.getStagingDeployCashData(issue);
1242512429
});
1242612430
}
1242712431
/**
@@ -12499,7 +12503,7 @@ class GithubUtils {
1249912503
}
1250012504
internalQASection = internalQASection[1];
1250112505
const internalQAPRs = [...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${CONST_1.default.PULL_REQUEST_REGEX.source})`, 'g'))].map((match) => ({
12502-
url: match[2].split('-')[0].trim(),
12506+
url: match[2].split('-').at(0)?.trim() ?? '',
1250312507
number: Number.parseInt(match[3], 10),
1250412508
isResolved: match[1] === 'x',
1250512509
}));
@@ -12583,7 +12587,7 @@ class GithubUtils {
1258312587
* Fetch all pull requests given a list of PR numbers.
1258412588
*/
1258512589
static fetchAllPullRequests(pullRequestNumbers) {
12586-
const oldestPR = pullRequestNumbers.sort((a, b) => a - b)[0];
12590+
const oldestPR = pullRequestNumbers.sort((a, b) => a - b).at(0);
1258712591
return this.paginate(this.octokit.pulls.list, {
1258812592
owner: CONST_1.default.GITHUB_OWNER,
1258912593
repo: CONST_1.default.APP_REPO,
@@ -12657,7 +12661,7 @@ class GithubUtils {
1265712661
repo: CONST_1.default.APP_REPO,
1265812662
workflow_id: workflow,
1265912663
})
12660-
.then((response) => response.data.workflow_runs[0]?.id);
12664+
.then((response) => response.data.workflow_runs.at(0)?.id ?? -1);
1266112665
}
1266212666
/**
1266312667
* Generate the URL of an New Expensify pull request given the PR number.
@@ -12725,7 +12729,7 @@ class GithubUtils {
1272512729
per_page: 1,
1272612730
name: artifactName,
1272712731
})
12728-
.then((response) => response.data.artifacts[0]);
12732+
.then((response) => response.data.artifacts.at(0));
1272912733
}
1273012734
/**
1273112735
* Given an artifact ID, returns the download URL to a zip file containing the artifact.

.github/actions/javascript/bumpVersion/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3536,7 +3536,7 @@ exports.updateAndroidVersion = updateAndroidVersion;
35363536
* Updates the CFBundleShortVersionString and the CFBundleVersion.
35373537
*/
35383538
function updateiOSVersion(version) {
3539-
const shortVersion = version.split('-')[0];
3539+
const shortVersion = version.split('-').at(0);
35403540
const cfVersion = version.includes('-') ? version.replace('-', '.') : `${version}.0`;
35413541
console.log('Updating iOS', `CFBundleShortVersionString: ${shortVersion}`, `CFBundleVersion: ${cfVersion}`);
35423542
// Update Plists

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -11704,7 +11704,11 @@ class GithubUtils {
1170411704
if (data.length > 1) {
1170511705
throw new Error(`Found more than one ${CONST_1.default.LABELS.STAGING_DEPLOY} issue.`);
1170611706
}
11707-
return this.getStagingDeployCashData(data[0]);
11707+
const issue = data.at(0);
11708+
if (!issue) {
11709+
throw new Error(`Found an undefined ${CONST_1.default.LABELS.STAGING_DEPLOY} issue.`);
11710+
}
11711+
return this.getStagingDeployCashData(issue);
1170811712
});
1170911713
}
1171011714
/**
@@ -11782,7 +11786,7 @@ class GithubUtils {
1178211786
}
1178311787
internalQASection = internalQASection[1];
1178411788
const internalQAPRs = [...internalQASection.matchAll(new RegExp(`- \\[([ x])]\\s(${CONST_1.default.PULL_REQUEST_REGEX.source})`, 'g'))].map((match) => ({
11785-
url: match[2].split('-')[0].trim(),
11789+
url: match[2].split('-').at(0)?.trim() ?? '',
1178611790
number: Number.parseInt(match[3], 10),
1178711791
isResolved: match[1] === 'x',
1178811792
}));
@@ -11866,7 +11870,7 @@ class GithubUtils {
1186611870
* Fetch all pull requests given a list of PR numbers.
1186711871
*/
1186811872
static fetchAllPullRequests(pullRequestNumbers) {
11869-
const oldestPR = pullRequestNumbers.sort((a, b) => a - b)[0];
11873+
const oldestPR = pullRequestNumbers.sort((a, b) => a - b).at(0);
1187011874
return this.paginate(this.octokit.pulls.list, {
1187111875
owner: CONST_1.default.GITHUB_OWNER,
1187211876
repo: CONST_1.default.APP_REPO,
@@ -11940,7 +11944,7 @@ class GithubUtils {
1194011944
repo: CONST_1.default.APP_REPO,
1194111945
workflow_id: workflow,
1194211946
})
11943-
.then((response) => response.data.workflow_runs[0]?.id);
11947+
.then((response) => response.data.workflow_runs.at(0)?.id ?? -1);
1194411948
}
1194511949
/**
1194611950
* Generate the URL of an New Expensify pull request given the PR number.
@@ -12008,7 +12012,7 @@ class GithubUtils {
1200812012
per_page: 1,
1200912013
name: artifactName,
1201012014
})
12011-
.then((response) => response.data.artifacts[0]);
12015+
.then((response) => response.data.artifacts.at(0));
1201212016
}
1201312017
/**
1201412018
* Given an artifact ID, returns the download URL to a zip file containing the artifact.

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

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as core from '@actions/core';
2-
import format from 'date-fns/format';
2+
import {format} from 'date-fns/format';
33
import fs from 'fs';
44
import CONST from '@github/libs/CONST';
55
import GithubUtils from '@github/libs/GithubUtils';
@@ -29,15 +29,24 @@ async function run(): Promise<IssuesCreateResponse | void> {
2929

3030
// Look at the state of the most recent StagingDeployCash,
3131
// if it is open then we'll update the existing one, otherwise, we'll create a new one.
32-
const mostRecentChecklist = recentDeployChecklists[0];
32+
const mostRecentChecklist = recentDeployChecklists.at(0);
33+
34+
if (!mostRecentChecklist) {
35+
throw new Error('Could not find the most recent checklist');
36+
}
37+
3338
const shouldCreateNewDeployChecklist = mostRecentChecklist.state !== 'open';
34-
const previousChecklist = shouldCreateNewDeployChecklist ? mostRecentChecklist : recentDeployChecklists[1];
39+
const previousChecklist = shouldCreateNewDeployChecklist ? mostRecentChecklist : recentDeployChecklists.at(1);
3540
if (shouldCreateNewDeployChecklist) {
3641
console.log('Latest StagingDeployCash is closed, creating a new one.', mostRecentChecklist);
3742
} else {
3843
console.log('Latest StagingDeployCash is open, updating it instead of creating a new one.', 'Current:', mostRecentChecklist, 'Previous:', previousChecklist);
3944
}
4045

46+
if (!previousChecklist) {
47+
throw new Error('Could not find the previous checklist');
48+
}
49+
4150
// Parse the data from the previous and current checklists into the format used to generate the checklist
4251
const previousChecklistData = GithubUtils.getStagingDeployCashData(previousChecklist);
4352
const currentChecklistData: StagingDeployCashData | undefined = shouldCreateNewDeployChecklist ? undefined : GithubUtils.getStagingDeployCashData(mostRecentChecklist);

0 commit comments

Comments
 (0)