Skip to content

Commit cd91e6d

Browse files
committed
resolve conflict
2 parents 9cc5de9 + 74fc9b9 commit cd91e6d

389 files changed

Lines changed: 9827 additions & 6056 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.

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST=-1
3636
FB_API_KEY=YOUR_API_KEY
3737
FB_APP_ID=YOUR_APP_ID
3838
FB_PROJECT_ID=YOUR_PROJECT_ID
39+
40+
GITHUB_TOKEN=YOUR_TOKEN

.github/actionlint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ self-hosted-runner:
1010
paths:
1111
'**/*':
1212
ignore:
13-
# This is meant to be a temporary workaround for a bug in actionslint. Upstream:
13+
# This is meant to be a temporary workaround for a bug in actionlint. Upstream:
1414
# - issue: https://github.com/rhysd/actionlint/issues/511
1515
# - PR: https://github.com/rhysd/actionlint/pull/513
1616
- '"env" is not allowed in "runs" section because .* is a Composite action.*'

.github/actions/javascript/postTestBuildComment/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ inputs:
44
REPO:
55
description: "Repository to place a comment. Can be App or Mobile-Expensify"
66
default: App
7-
PR_NUMBER:
8-
description: "Pull request number"
9-
required: true
7+
APP_PR_NUMBER:
8+
description: "Pull request number for Expensify/App repository"
9+
required: false
10+
MOBILE_EXPENSIFY_PR_NUMBER:
11+
description: "Pull request number for Expensify/Mobile-Expensify repository"
12+
required: false
1013
GITHUB_TOKEN:
1114
description: "Github token for authentication"
1215
default: "${{ github.token }}"

.github/actions/javascript/postTestBuildComment/index.js

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11501,7 +11501,7 @@ const core = __importStar(__nccwpck_require__(2186));
1150111501
const github_1 = __nccwpck_require__(5438);
1150211502
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1150311503
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
11504-
function getTestBuildMessage() {
11504+
function getTestBuildMessage(appPr, mobileExpensifyPr) {
1150511505
const inputs = ['ANDROID', 'DESKTOP', 'IOS', 'WEB'];
1150611506
const names = {
1150711507
[inputs[0]]: 'Android',
@@ -11515,24 +11515,36 @@ function getTestBuildMessage() {
1151511515
acc[platform] = { link: 'N/A', qrCode: 'N/A' };
1151611516
return acc;
1151711517
}
11518-
const isSuccess = input === 'success';
11519-
const link = isSuccess ? core.getInput(`${platform}_LINK`) : '❌ FAILED ❌';
11520-
const qrCode = isSuccess
11521-
? `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})`
11522-
: `The QR code can't be generated, because the ${names[platform]} build failed`;
11518+
let link = '';
11519+
let qrCode = '';
11520+
switch (input) {
11521+
case 'success':
11522+
link = core.getInput(`${platform}_LINK`);
11523+
qrCode = `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})`;
11524+
break;
11525+
case 'skipped':
11526+
link = '⏩ SKIPPED ⏩';
11527+
qrCode = `The build for ${names[platform]} was skipped`;
11528+
break;
11529+
default:
11530+
link = '❌ FAILED ❌';
11531+
qrCode = `The QR code can't be generated, because the ${names[platform]} build failed`;
11532+
}
1152311533
acc[platform] = {
1152411534
link,
1152511535
qrCode,
1152611536
};
1152711537
return acc;
1152811538
}, {});
11529-
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
11539+
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS${appPr ? ', Desktop, and Web' : ''}. Happy testing! :test_tube::test_tube:
11540+
Built from${appPr ? ` App PR Expensify/App#${appPr}` : ''}${mobileExpensifyPr ? ` Mobile-Expensify PR Expensify/Mobile-Expensify#${mobileExpensifyPr}` : ''}.
1153011541
| Android :robot: | iOS :apple: |
1153111542
| ------------- | ------------- |
11532-
| Android :robot::arrows_counterclockwise: | iOS :apple::arrows_counterclockwise: |
1153311543
| ${result.ANDROID.link} | ${result.IOS.link} |
1153411544
| ${result.ANDROID.qrCode} | ${result.IOS.qrCode} |
11545+
1153511546
| Desktop :computer: | Web :spider_web: |
11547+
| ------------- | ------------- |
1153611548
| ${result.DESKTOP.link} | ${result.WEB.link} |
1153711549
| ${result.DESKTOP.qrCode} | ${result.WEB.qrCode} |
1153811550

@@ -11557,17 +11569,23 @@ async function commentPR(REPO, PR, message) {
1155711569
}
1155811570
}
1155911571
async function run() {
11560-
const PR_NUMBER = Number(core.getInput('PR_NUMBER', { required: true }));
11572+
const APP_PR_NUMBER = Number(core.getInput('APP_PR_NUMBER', { required: false }));
11573+
const MOBILE_EXPENSIFY_PR_NUMBER = Number(core.getInput('MOBILE_EXPENSIFY_PR_NUMBER', { required: false }));
1156111574
const REPO = String(core.getInput('REPO', { required: true }));
1156211575
if (REPO !== CONST_1.default.APP_REPO && REPO !== CONST_1.default.MOBILE_EXPENSIFY_REPO) {
1156311576
core.setFailed(`Invalid repository used to place output comment: ${REPO}`);
1156411577
return;
1156511578
}
11579+
if ((REPO === CONST_1.default.APP_REPO && !APP_PR_NUMBER) || (REPO === CONST_1.default.MOBILE_EXPENSIFY_REPO && !MOBILE_EXPENSIFY_PR_NUMBER)) {
11580+
core.setFailed(`Please provide ${REPO} pull request number`);
11581+
return;
11582+
}
11583+
const destinationPRNumber = REPO === CONST_1.default.APP_REPO ? APP_PR_NUMBER : MOBILE_EXPENSIFY_PR_NUMBER;
1156611584
const comments = await GithubUtils_1.default.paginate(GithubUtils_1.default.octokit.issues.listComments, {
1156711585
owner: CONST_1.default.GITHUB_OWNER,
1156811586
repo: REPO,
1156911587
// eslint-disable-next-line @typescript-eslint/naming-convention
11570-
issue_number: PR_NUMBER,
11588+
issue_number: destinationPRNumber,
1157111589
// eslint-disable-next-line @typescript-eslint/naming-convention
1157211590
per_page: 100,
1157311591
}, (response) => response.data);
@@ -11584,7 +11602,7 @@ async function run() {
1158411602
}
1158511603
`);
1158611604
}
11587-
await commentPR(REPO, PR_NUMBER, getTestBuildMessage());
11605+
await commentPR(REPO, destinationPRNumber, getTestBuildMessage(APP_PR_NUMBER, MOBILE_EXPENSIFY_PR_NUMBER));
1158811606
}
1158911607
if (require.main === require.cache[eval('__filename')]) {
1159011608
run();

.github/actions/javascript/postTestBuildComment/postTestBuildComment.ts

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {TupleToUnion} from 'type-fest';
44
import CONST from '@github/libs/CONST';
55
import GithubUtils from '@github/libs/GithubUtils';
66

7-
function getTestBuildMessage(): string {
7+
function getTestBuildMessage(appPr?: number, mobileExpensifyPr?: number): string {
88
const inputs = ['ANDROID', 'DESKTOP', 'IOS', 'WEB'] as const;
99
const names = {
1010
[inputs[0]]: 'Android',
@@ -22,12 +22,21 @@ function getTestBuildMessage(): string {
2222
return acc;
2323
}
2424

25-
const isSuccess = input === 'success';
26-
27-
const link = isSuccess ? core.getInput(`${platform}_LINK`) : '❌ FAILED ❌';
28-
const qrCode = isSuccess
29-
? `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})`
30-
: `The QR code can't be generated, because the ${names[platform]} build failed`;
25+
let link = '';
26+
let qrCode = '';
27+
switch (input) {
28+
case 'success':
29+
link = core.getInput(`${platform}_LINK`);
30+
qrCode = `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})`;
31+
break;
32+
case 'skipped':
33+
link = '⏩ SKIPPED ⏩';
34+
qrCode = `The build for ${names[platform]} was skipped`;
35+
break;
36+
default:
37+
link = '❌ FAILED ❌';
38+
qrCode = `The QR code can't be generated, because the ${names[platform]} build failed`;
39+
}
3140

3241
acc[platform] = {
3342
link,
@@ -38,13 +47,15 @@ function getTestBuildMessage(): string {
3847
{} as Record<TupleToUnion<typeof inputs>, {link: string; qrCode: string}>,
3948
);
4049

41-
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
50+
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS${appPr ? ', Desktop, and Web' : ''}. Happy testing! :test_tube::test_tube:
51+
Built from${appPr ? ` App PR Expensify/App#${appPr}` : ''}${mobileExpensifyPr ? ` Mobile-Expensify PR Expensify/Mobile-Expensify#${mobileExpensifyPr}` : ''}.
4252
| Android :robot: | iOS :apple: |
4353
| ------------- | ------------- |
44-
| Android :robot::arrows_counterclockwise: | iOS :apple::arrows_counterclockwise: |
4554
| ${result.ANDROID.link} | ${result.IOS.link} |
4655
| ${result.ANDROID.qrCode} | ${result.IOS.qrCode} |
56+
4757
| Desktop :computer: | Web :spider_web: |
58+
| ------------- | ------------- |
4859
| ${result.DESKTOP.link} | ${result.WEB.link} |
4960
| ${result.DESKTOP.qrCode} | ${result.WEB.qrCode} |
5061
@@ -72,21 +83,28 @@ async function commentPR(REPO: string, PR: number, message: string) {
7283
}
7384

7485
async function run() {
75-
const PR_NUMBER = Number(core.getInput('PR_NUMBER', {required: true}));
86+
const APP_PR_NUMBER = Number(core.getInput('APP_PR_NUMBER', {required: false}));
87+
const MOBILE_EXPENSIFY_PR_NUMBER = Number(core.getInput('MOBILE_EXPENSIFY_PR_NUMBER', {required: false}));
7688
const REPO = String(core.getInput('REPO', {required: true}));
7789

7890
if (REPO !== CONST.APP_REPO && REPO !== CONST.MOBILE_EXPENSIFY_REPO) {
7991
core.setFailed(`Invalid repository used to place output comment: ${REPO}`);
8092
return;
8193
}
8294

95+
if ((REPO === CONST.APP_REPO && !APP_PR_NUMBER) || (REPO === CONST.MOBILE_EXPENSIFY_REPO && !MOBILE_EXPENSIFY_PR_NUMBER)) {
96+
core.setFailed(`Please provide ${REPO} pull request number`);
97+
return;
98+
}
99+
100+
const destinationPRNumber = REPO === CONST.APP_REPO ? APP_PR_NUMBER : MOBILE_EXPENSIFY_PR_NUMBER;
83101
const comments = await GithubUtils.paginate(
84102
GithubUtils.octokit.issues.listComments,
85103
{
86104
owner: CONST.GITHUB_OWNER,
87105
repo: REPO,
88106
// eslint-disable-next-line @typescript-eslint/naming-convention
89-
issue_number: PR_NUMBER,
107+
issue_number: destinationPRNumber,
90108
// eslint-disable-next-line @typescript-eslint/naming-convention
91109
per_page: 100,
92110
},
@@ -105,7 +123,7 @@ async function run() {
105123
}
106124
`);
107125
}
108-
await commentPR(REPO, PR_NUMBER, getTestBuildMessage());
126+
await commentPR(REPO, destinationPRNumber, getTestBuildMessage(APP_PR_NUMBER, MOBILE_EXPENSIFY_PR_NUMBER));
109127
}
110128

111129
if (require.main === module) {

.github/scripts/getNewPatchedRNVersion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PACKAGE_VERSIONS="$(gh api "/orgs/Expensify/packages/maven/com.expensify.${PACKA
2121
PACKAGE_VERSIONS="$(echo "$PACKAGE_VERSIONS" | grep "$VERSION")"
2222

2323
# Grab the highest patch version from there
24-
LATEST_PATCHED_VERSION="$(echo "$PACKAGE_VERSIONS" | sort | tail -n1)"
24+
LATEST_PATCHED_VERSION="$(echo "$PACKAGE_VERSIONS" | sort -V | tail -n1)"
2525

2626
if [[ -n "$LATEST_PATCHED_VERSION" ]]; then
2727
PATCH_ITERATION=${LATEST_PATCHED_VERSION##*-}

.github/scripts/validateActionsAndWorkflows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title 'Validating the Github Actions and workflows using the json schemas provid
77
function downloadSchema {
88
[[ $1 = 'github-action.json' ]] && SCHEMA_NAME='GitHub Action' || SCHEMA_NAME='GitHub Workflow'
99
info "Downloading $SCHEMA_NAME schema..."
10-
if curl "https://json.schemastore.org/$1" --output "./tempSchemas/$1" --silent; then
10+
if curl "https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/$1" --output "./tempSchemas/$1" --silent; then
1111
success "Successfully downloaded $SCHEMA_NAME schema!"
1212
else
1313
error "Failed downloading $SCHEMA_NAME schema"

.github/workflows/cherryPick.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237
gh pr create \
238238
--title "🍒 Cherry pick PR #${{ steps.getPRInfo.outputs.PR_NUMBER }} to ${{ inputs.TARGET }} 🍒" \
239239
--body "$PR_DESCRIPTION" \
240-
--label "Engineering,Hourly" \
240+
--label "Engineering,Hourly,${{ inputs.TARGET == 'staging' && 'CP Staging' || 'CP Production' }}" \
241241
--base "${{ inputs.TARGET }}"
242242
sleep 5
243243
env:

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
attachments: [{
274274
color: "#DB4545",
275275
pretext: `<!subteam^S4TJJ3PSL>`,
276-
text: `💥 Android HybridApp production <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|deploy run> failed. Please <https://stackoverflowteams.com/c/expensify/questions/5738|manually submit> ${{ needs.prep.outputs.APP_VERSION }} in the <https://play.google.com/console/u/0/developers/8765590895836334604/app/4974129597497161901/releases/overview|Google Play Store>. 💥 But first check the workflow, it's likely that the release was successful and <https://github.com/Expensify/Expensify/issues/488492|this error> is occuring)`,
276+
text: `💥 Android HybridApp production <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|deploy run> failed. Please <https://stackoverflowteams.com/c/expensify/questions/5738|manually submit> ${{ needs.prep.outputs.APP_VERSION }} in the <https://play.google.com/console/u/0/developers/8765590895836334604/app/4974129597497161901/releases/overview|Google Play Store> 💥`,
277277
}]
278278
}
279279
env:

.github/workflows/lint-changed.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,47 @@ jobs:
1717
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
1818
runs-on: ubuntu-latest
1919
steps:
20+
- name: Count commits between merge base and HEAD
21+
id: count
22+
run: |
23+
# Compare the base commit and HEAD to get the count of commits after base
24+
# up to and including HEAD. Add 2 to this total when fetching history.
25+
#
26+
# When opening a PR, GitHub will create a merge commit that squashes
27+
# your changes for use in the workflow. So your history locally
28+
# may look like
29+
# o---o---o---B - development
30+
# /
31+
# ---o---1---C---o---o---A - main
32+
# Note that the `1` is the merge-base of development and main. The
33+
# number of commits after `1` upto and including `A` is 4.
34+
# In the workflow, GitHub squashs development, so it becomes:
35+
# ---o---1---C---o---o---A - main
36+
# \--M - PR branch
37+
# Where `M`` is the new squashed commit. To fetch enough history to
38+
# include the merge base, we need to fetch `M`, `A` through `C` and
39+
# `1` for total of 4+2=6 commits. The +2 commits accounts for the
40+
# base `1` and merge commit `M`.
41+
RAW_COUNT="$(gh api "repos/$REPO/compare/${BASE}...main" | jq -r '.total_commits')"
42+
ADJUSTED_COUNT=$((RAW_COUNT + 2))
43+
echo "count=$ADJUSTED_COUNT" >> "$GITHUB_OUTPUT"
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
BASE: ${{ github.event.pull_request.base.sha }}
47+
REPO: ${{ github.repository }}
48+
2049
- name: Checkout
2150
# v4
2251
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
52+
with:
53+
fetch-depth: ${{ fromJSON(steps.count.outputs.count) }}
2354

2455
- name: Setup Node
2556
uses: ./.github/actions/composite/setupNode
2657
with:
2758
IS_DESKTOP_BUILD: true
28-
59+
2960
- name: Run ESLint to check for deprecation warnings
3061
run: |
31-
# This will just fetch the latest commit from main
32-
git fetch origin main --no-tags --depth=1
33-
3462
# shellcheck disable=SC2046
3563
npm run lint-changed

0 commit comments

Comments
 (0)