Skip to content

Commit e0d7e67

Browse files
committed
Merge branch 'main' into feature/useOnyx-canBeMissing
2 parents 5160138 + cd227b6 commit e0d7e67

File tree

256 files changed

+18633
-2730
lines changed

Some content is hidden

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

256 files changed

+18633
-2730
lines changed

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

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11643,37 +11643,14 @@ exports["default"] = CONST;
1164311643

1164411644
"use strict";
1164511645

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-
};
1166911646
var __importDefault = (this && this.__importDefault) || function (mod) {
1167011647
return (mod && mod.__esModule) ? mod : { "default": mod };
1167111648
};
1167211649
Object.defineProperty(exports, "__esModule", ({ value: true }));
1167311650
const child_process_1 = __nccwpck_require__(2081);
1167411651
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1167511652
const sanitizeStringForJSONParse_1 = __importDefault(__nccwpck_require__(3902));
11676-
const VersionUpdater = __importStar(__nccwpck_require__(8982));
11653+
const versionUpdater_1 = __nccwpck_require__(8982);
1167711654
/**
1167811655
* Check if a tag exists locally or in the remote.
1167911656
*/
@@ -11721,15 +11698,20 @@ function tagExists(tag) {
1172111698
* @param level the Semver level to step backward by
1172211699
*/
1172311700
function getPreviousExistingTag(tag, level) {
11724-
let previousVersion = VersionUpdater.getPreviousVersion(tag, level);
11701+
let previousVersion = (0, versionUpdater_1.getPreviousVersion)(tag.replace('-staging', ''), level);
1172511702
let tagExistsForPreviousVersion = false;
1172611703
while (!tagExistsForPreviousVersion) {
1172711704
if (tagExists(previousVersion)) {
1172811705
tagExistsForPreviousVersion = true;
1172911706
break;
1173011707
}
11708+
if (tagExists(`${previousVersion}-staging`)) {
11709+
tagExistsForPreviousVersion = true;
11710+
previousVersion = `${previousVersion}-staging`;
11711+
break;
11712+
}
1173111713
console.log(`Tag for previous version ${previousVersion} does not exist. Checking for an older version...`);
11732-
previousVersion = VersionUpdater.getPreviousVersion(previousVersion, level);
11714+
previousVersion = (0, versionUpdater_1.getPreviousVersion)(previousVersion, level);
1173311715
}
1173411716
return previousVersion;
1173511717
}
@@ -11775,8 +11757,8 @@ function fetchTag(tag, shallowExcludeTag = '') {
1177511757
* Get merge logs between two tags (inclusive) as a JavaScript object.
1177611758
*/
1177711759
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);
11760+
// 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
11761+
const previousPatchVersion = getPreviousExistingTag(fromTag.replace('-staging', ''), fromTag.endsWith('-staging') ? versionUpdater_1.SEMANTIC_VERSION_LEVELS.PATCH : versionUpdater_1.SEMANTIC_VERSION_LEVELS.MINOR);
1178011762
fetchTag(fromTag, previousPatchVersion);
1178111763
fetchTag(toTag, previousPatchVersion);
1178211764
console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
@@ -11821,7 +11803,7 @@ function getValidMergedPRs(commits) {
1182111803
if (author === CONST_1.default.OS_BOTIFY) {
1182211804
return;
1182311805
}
11824-
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-staging)/);
11806+
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/);
1182511807
if (!Array.isArray(match) || match.length < 2) {
1182611808
return;
1182711809
}

.github/actions/javascript/getDeployPullRequestList/index.js

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11684,37 +11684,14 @@ exports["default"] = CONST;
1168411684

1168511685
"use strict";
1168611686

11687-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11688-
if (k2 === undefined) k2 = k;
11689-
var desc = Object.getOwnPropertyDescriptor(m, k);
11690-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11691-
desc = { enumerable: true, get: function() { return m[k]; } };
11692-
}
11693-
Object.defineProperty(o, k2, desc);
11694-
}) : (function(o, m, k, k2) {
11695-
if (k2 === undefined) k2 = k;
11696-
o[k2] = m[k];
11697-
}));
11698-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
11699-
Object.defineProperty(o, "default", { enumerable: true, value: v });
11700-
}) : function(o, v) {
11701-
o["default"] = v;
11702-
});
11703-
var __importStar = (this && this.__importStar) || function (mod) {
11704-
if (mod && mod.__esModule) return mod;
11705-
var result = {};
11706-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11707-
__setModuleDefault(result, mod);
11708-
return result;
11709-
};
1171011687
var __importDefault = (this && this.__importDefault) || function (mod) {
1171111688
return (mod && mod.__esModule) ? mod : { "default": mod };
1171211689
};
1171311690
Object.defineProperty(exports, "__esModule", ({ value: true }));
1171411691
const child_process_1 = __nccwpck_require__(2081);
1171511692
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1171611693
const sanitizeStringForJSONParse_1 = __importDefault(__nccwpck_require__(3902));
11717-
const VersionUpdater = __importStar(__nccwpck_require__(8982));
11694+
const versionUpdater_1 = __nccwpck_require__(8982);
1171811695
/**
1171911696
* Check if a tag exists locally or in the remote.
1172011697
*/
@@ -11762,15 +11739,20 @@ function tagExists(tag) {
1176211739
* @param level the Semver level to step backward by
1176311740
*/
1176411741
function getPreviousExistingTag(tag, level) {
11765-
let previousVersion = VersionUpdater.getPreviousVersion(tag, level);
11742+
let previousVersion = (0, versionUpdater_1.getPreviousVersion)(tag.replace('-staging', ''), level);
1176611743
let tagExistsForPreviousVersion = false;
1176711744
while (!tagExistsForPreviousVersion) {
1176811745
if (tagExists(previousVersion)) {
1176911746
tagExistsForPreviousVersion = true;
1177011747
break;
1177111748
}
11749+
if (tagExists(`${previousVersion}-staging`)) {
11750+
tagExistsForPreviousVersion = true;
11751+
previousVersion = `${previousVersion}-staging`;
11752+
break;
11753+
}
1177211754
console.log(`Tag for previous version ${previousVersion} does not exist. Checking for an older version...`);
11773-
previousVersion = VersionUpdater.getPreviousVersion(previousVersion, level);
11755+
previousVersion = (0, versionUpdater_1.getPreviousVersion)(previousVersion, level);
1177411756
}
1177511757
return previousVersion;
1177611758
}
@@ -11816,8 +11798,8 @@ function fetchTag(tag, shallowExcludeTag = '') {
1181611798
* Get merge logs between two tags (inclusive) as a JavaScript object.
1181711799
*/
1181811800
function getCommitHistoryAsJSON(fromTag, toTag) {
11819-
// 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
11820-
const previousPatchVersion = getPreviousExistingTag(fromTag, VersionUpdater.SEMANTIC_VERSION_LEVELS.PATCH);
11801+
// 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
11802+
const previousPatchVersion = getPreviousExistingTag(fromTag.replace('-staging', ''), fromTag.endsWith('-staging') ? versionUpdater_1.SEMANTIC_VERSION_LEVELS.PATCH : versionUpdater_1.SEMANTIC_VERSION_LEVELS.MINOR);
1182111803
fetchTag(fromTag, previousPatchVersion);
1182211804
fetchTag(toTag, previousPatchVersion);
1182311805
console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
@@ -11862,7 +11844,7 @@ function getValidMergedPRs(commits) {
1186211844
if (author === CONST_1.default.OS_BOTIFY) {
1186311845
return;
1186411846
}
11865-
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-staging)/);
11847+
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/);
1186611848
if (!Array.isArray(match) || match.length < 2) {
1186711849
return;
1186811850
}

.github/actions/javascript/getPreviousVersion/index.js

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,37 +2808,14 @@ exports["default"] = CONST;
28082808

28092809
"use strict";
28102810

2811-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2812-
if (k2 === undefined) k2 = k;
2813-
var desc = Object.getOwnPropertyDescriptor(m, k);
2814-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2815-
desc = { enumerable: true, get: function() { return m[k]; } };
2816-
}
2817-
Object.defineProperty(o, k2, desc);
2818-
}) : (function(o, m, k, k2) {
2819-
if (k2 === undefined) k2 = k;
2820-
o[k2] = m[k];
2821-
}));
2822-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
2823-
Object.defineProperty(o, "default", { enumerable: true, value: v });
2824-
}) : function(o, v) {
2825-
o["default"] = v;
2826-
});
2827-
var __importStar = (this && this.__importStar) || function (mod) {
2828-
if (mod && mod.__esModule) return mod;
2829-
var result = {};
2830-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
2831-
__setModuleDefault(result, mod);
2832-
return result;
2833-
};
28342811
var __importDefault = (this && this.__importDefault) || function (mod) {
28352812
return (mod && mod.__esModule) ? mod : { "default": mod };
28362813
};
28372814
Object.defineProperty(exports, "__esModule", ({ value: true }));
28382815
const child_process_1 = __nccwpck_require__(81);
28392816
const CONST_1 = __importDefault(__nccwpck_require__(873));
28402817
const sanitizeStringForJSONParse_1 = __importDefault(__nccwpck_require__(902));
2841-
const VersionUpdater = __importStar(__nccwpck_require__(982));
2818+
const versionUpdater_1 = __nccwpck_require__(982);
28422819
/**
28432820
* Check if a tag exists locally or in the remote.
28442821
*/
@@ -2886,15 +2863,20 @@ function tagExists(tag) {
28862863
* @param level the Semver level to step backward by
28872864
*/
28882865
function getPreviousExistingTag(tag, level) {
2889-
let previousVersion = VersionUpdater.getPreviousVersion(tag, level);
2866+
let previousVersion = (0, versionUpdater_1.getPreviousVersion)(tag.replace('-staging', ''), level);
28902867
let tagExistsForPreviousVersion = false;
28912868
while (!tagExistsForPreviousVersion) {
28922869
if (tagExists(previousVersion)) {
28932870
tagExistsForPreviousVersion = true;
28942871
break;
28952872
}
2873+
if (tagExists(`${previousVersion}-staging`)) {
2874+
tagExistsForPreviousVersion = true;
2875+
previousVersion = `${previousVersion}-staging`;
2876+
break;
2877+
}
28962878
console.log(`Tag for previous version ${previousVersion} does not exist. Checking for an older version...`);
2897-
previousVersion = VersionUpdater.getPreviousVersion(previousVersion, level);
2879+
previousVersion = (0, versionUpdater_1.getPreviousVersion)(previousVersion, level);
28982880
}
28992881
return previousVersion;
29002882
}
@@ -2940,8 +2922,8 @@ function fetchTag(tag, shallowExcludeTag = '') {
29402922
* Get merge logs between two tags (inclusive) as a JavaScript object.
29412923
*/
29422924
function getCommitHistoryAsJSON(fromTag, toTag) {
2943-
// 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
2944-
const previousPatchVersion = getPreviousExistingTag(fromTag, VersionUpdater.SEMANTIC_VERSION_LEVELS.PATCH);
2925+
// 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
2926+
const previousPatchVersion = getPreviousExistingTag(fromTag.replace('-staging', ''), fromTag.endsWith('-staging') ? versionUpdater_1.SEMANTIC_VERSION_LEVELS.PATCH : versionUpdater_1.SEMANTIC_VERSION_LEVELS.MINOR);
29452927
fetchTag(fromTag, previousPatchVersion);
29462928
fetchTag(toTag, previousPatchVersion);
29472929
console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
@@ -2986,7 +2968,7 @@ function getValidMergedPRs(commits) {
29862968
if (author === CONST_1.default.OS_BOTIFY) {
29872969
return;
29882970
}
2989-
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-staging)/);
2971+
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/);
29902972
if (!Array.isArray(match) || match.length < 2) {
29912973
return;
29922974
}

.github/libs/GitUtils.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {execSync, spawn} from 'child_process';
22
import CONST from './CONST';
33
import sanitizeStringForJSONParse from './sanitizeStringForJSONParse';
4-
import * as VersionUpdater from './versionUpdater';
4+
import {getPreviousVersion, SEMANTIC_VERSION_LEVELS} from './versionUpdater';
55
import type {SemverLevel} from './versionUpdater';
66

77
type CommitType = {
@@ -55,15 +55,20 @@ function tagExists(tag: string) {
5555
* @param level the Semver level to step backward by
5656
*/
5757
function getPreviousExistingTag(tag: string, level: SemverLevel) {
58-
let previousVersion = VersionUpdater.getPreviousVersion(tag, level);
58+
let previousVersion = getPreviousVersion(tag.replace('-staging', ''), level);
5959
let tagExistsForPreviousVersion = false;
6060
while (!tagExistsForPreviousVersion) {
6161
if (tagExists(previousVersion)) {
6262
tagExistsForPreviousVersion = true;
6363
break;
6464
}
65+
if (tagExists(`${previousVersion}-staging`)) {
66+
tagExistsForPreviousVersion = true;
67+
previousVersion = `${previousVersion}-staging`;
68+
break;
69+
}
6570
console.log(`Tag for previous version ${previousVersion} does not exist. Checking for an older version...`);
66-
previousVersion = VersionUpdater.getPreviousVersion(previousVersion, level);
71+
previousVersion = getPreviousVersion(previousVersion, level);
6772
}
6873
return previousVersion;
6974
}
@@ -112,8 +117,8 @@ function fetchTag(tag: string, shallowExcludeTag = '') {
112117
* Get merge logs between two tags (inclusive) as a JavaScript object.
113118
*/
114119
function getCommitHistoryAsJSON(fromTag: string, toTag: string): Promise<CommitType[]> {
115-
// 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
116-
const previousPatchVersion = getPreviousExistingTag(fromTag, VersionUpdater.SEMANTIC_VERSION_LEVELS.PATCH);
120+
// 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
121+
const previousPatchVersion = getPreviousExistingTag(fromTag.replace('-staging', ''), fromTag.endsWith('-staging') ? SEMANTIC_VERSION_LEVELS.PATCH : SEMANTIC_VERSION_LEVELS.MINOR);
117122
fetchTag(fromTag, previousPatchVersion);
118123
fetchTag(toTag, previousPatchVersion);
119124

@@ -164,7 +169,7 @@ function getValidMergedPRs(commits: CommitType[]): number[] {
164169
return;
165170
}
166171

167-
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-staging)/);
172+
const match = commit.subject.match(/Merge pull request #(\d+) from (?!Expensify\/.*-cherry-pick-(staging|production))/);
168173
if (!Array.isArray(match) || match.length < 2) {
169174
return;
170175
}

.github/workflows/deploy.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,11 @@ jobs:
161161
- name: Submit production build for Google Play review and a slow rollout
162162
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
163163
run: |
164-
# Complete the previous version rollout if the current rollout percentage is not -1 or 1
164+
# The Play Store is slow to review Android releases. To avoid halting production rollouts, we must wait for the previous release to finish rolling out before uploading a new one.
165+
# Skip this release if the current prod release is not fully rolled out.
165166
if [[ ${{ steps.getAndroidRolloutPercentage.outputs.CURRENT_ROLLOUT_PERCENTAGE }} != '-1' && ${{ steps.getAndroidRolloutPercentage.outputs.CURRENT_ROLLOUT_PERCENTAGE }} != '1' ]]; then
166-
echo "Completing the previous version rollout"
167-
bundle exec fastlane android complete_hybrid_rollout
168-
else
169-
echo "Skipping the completion of the previous version rollout"
167+
echo "Skipping Android release because the current prod release ${{ steps.getAndroidRolloutPercentage.outputs.CURRENT_ROLLOUT_PERCENTAGE }} has not fully rolled out"
168+
exit 0
170169
fi
171170
172171
# Submit the new version for review and slow rollout when it's approved

.github/workflows/finishReleaseCycle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
--label DeployBlockerCash \
9494
--json number \
9595
--jq '.[].number' \
96-
| xargs -L1 --max-procs=4 gh issue edit "$1" --repo 'Expensify/App' --remove-label DeployBlockerCash
96+
| xargs -L1 -I {} --max-procs=4 gh issue edit {} --repo 'Expensify/App' --remove-label DeployBlockerCash
9797
env:
9898
GITHUB_TOKEN: ${{ github.token }}
9999

.github/workflows/verifyHybridApp.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,25 @@ jobs:
5151
steps:
5252
- name: Comment on forks
5353
run: |
54-
gh pr comment ${{github.event.pull_request.html_url }} --body \
55-
":warning: This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. :warning:"
54+
PR_URL="${{ github.event.pull_request.html_url }}"
55+
COMMENT=":warning: This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. \
56+
Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. \
57+
Ask Contributor Plus for help if you are not sure how to handle this. :warning:"
58+
59+
# Fetch existing comments from author github-actions
60+
EXISTING_COMMENTS="$(\
61+
gh pr view "$PR_URL" \
62+
--comments \
63+
--json comments \
64+
--jq '.comments[] | select(.author = "github-actions") | .body' \
65+
)"
66+
67+
# Leave the comment only if it's not already present
68+
if grep -q "$COMMENT" <(echo "$EXISTING_COMMENTS"); then
69+
echo "Comment already exists, not posting again."
70+
else
71+
gh pr comment "$PR_URL" --body "$COMMENT"
72+
fi
5673
env:
5774
GITHUB_TOKEN: ${{ github.token }}
5875
verify_android:

.storybook/preview.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import Onyx from 'react-native-onyx';
44
import {SafeAreaProvider} from 'react-native-safe-area-context';
55
import type {Parameters} from 'storybook/internal/types';
6+
import {MoneyRequestReportContextProvider} from '@components/MoneyRequestReportView/MoneyRequestReportContext';
67
import ComposeProviders from '@src/components/ComposeProviders';
78
import HTMLEngineProvider from '@src/components/HTMLEngineProvider';
89
import {LocaleContextProvider} from '@src/components/LocaleContextProvider';
@@ -21,7 +22,18 @@ Onyx.init({
2122

2223
const decorators = [
2324
(Story: React.ElementType) => (
24-
<ComposeProviders components={[OnyxProvider, LocaleContextProvider, HTMLEngineProvider, SafeAreaProvider, PortalProvider, EnvironmentProvider, KeyboardStateProvider]}>
25+
<ComposeProviders
26+
components={[
27+
OnyxProvider,
28+
LocaleContextProvider,
29+
HTMLEngineProvider,
30+
SafeAreaProvider,
31+
PortalProvider,
32+
EnvironmentProvider,
33+
KeyboardStateProvider,
34+
MoneyRequestReportContextProvider,
35+
]}
36+
>
2537
<Story />
2638
</ComposeProviders>
2739
),

Mobile-Expensify

0 commit comments

Comments
 (0)