Skip to content

Commit ffaa3ae

Browse files
committed
Merge branch 'main' into improve-lineheight-calc-ios
2 parents 582e1be + f21e61f commit ffaa3ae

641 files changed

Lines changed: 14360 additions & 14636 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.

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module.exports = {
7575
'lint/no-react-native-imports': 2,
7676
'lint/require-extends-error': 2,
7777
'lint/no-react-node-imports': 2,
78+
'lint/no-react-default-imports': 2,
7879
},
7980
},
8081
{

.github/actions/build-hermesc-linux/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ runs:
1414
shell: bash
1515
run: |
1616
sudo apt update
17-
sudo apt install -y git openssh-client cmake build-essential \
17+
sudo apt install -y git openssh-client build-essential \
1818
libreadline-dev libicu-dev jq zip python3
19+
20+
# Install cmake 3.28.3-1build7
21+
sudo apt-get install cmake=3.28.3-1build7
22+
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
1923
- name: Restore Hermes workspace
2024
uses: ./.github/actions/restore-hermes-workspace
2125
- name: Linux cache

.github/actions/build-hermesc-windows/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ runs:
3939
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
4040
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
4141
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
42+
- name: Downgrade CMake
43+
shell: powershell
44+
run: choco install cmake --version 3.31.6 --force
4245
- name: Build HermesC for Windows
4346
shell: powershell
4447
run: |

.github/actions/lint/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ runs:
4444
- name: Check formatting
4545
shell: bash
4646
run: yarn run format-check
47+
- name: Lint markdown
48+
shell: bash
49+
run: yarn run lint-markdown

.github/actions/yarn-install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
ATTEMPT=0
1010
WAIT_TIME=20
1111
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
12-
yarn install --non-interactive --frozen-lockfile && break
12+
yarn install --non-interactive --frozen-lockfile --ignore-engines && break
1313
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
1414
sleep $WAIT_TIME
1515
ATTEMPT=$((ATTEMPT + 1))
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
*/
9+
10+
const {extractIssueOncalls} = require('../extractIssueOncalls');
11+
12+
const userMap = {
13+
'@g': '1785',
14+
'@c': '1781',
15+
'@s': '1272',
16+
'@d': '1332',
17+
'@m': '9555',
18+
'@p': '6097',
19+
'@f': '7565',
20+
};
21+
22+
const schedule = {
23+
'2025-04-01': ['@m', '@f'],
24+
'2025-04-08': ['@g', '@d'],
25+
};
26+
27+
describe('extractIssueOncalls', () => {
28+
beforeEach(() => {
29+
jest.clearAllMocks();
30+
jest.useFakeTimers('modern');
31+
});
32+
33+
afterEach(() => {
34+
jest.useRealTimers();
35+
});
36+
it('extracts m and f on 6 of April', () => {
37+
jest.setSystemTime(new Date(2025, 3, 6));
38+
const oncalls = extractIssueOncalls(schedule, userMap);
39+
expect(oncalls).toEqual([userMap['@m'], userMap['@f']]);
40+
});
41+
42+
it('extracts m and f on 7 of April', () => {
43+
jest.setSystemTime(new Date(2025, 3, 7));
44+
const oncalls = extractIssueOncalls(schedule, userMap);
45+
expect(oncalls).toEqual([userMap['@m'], userMap['@f']]);
46+
});
47+
48+
it('extracts g and d on 8 of April', () => {
49+
jest.setSystemTime(new Date(2025, 3, 8));
50+
const oncalls = extractIssueOncalls(schedule, userMap);
51+
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
52+
});
53+
54+
it('extracts g and d on 9 of April', () => {
55+
jest.setSystemTime(new Date(2025, 3, 9));
56+
const oncalls = extractIssueOncalls(schedule, userMap);
57+
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
58+
});
59+
60+
it('extracts g and d on 10 of April', () => {
61+
jest.setSystemTime(new Date(2025, 3, 10));
62+
const oncalls = extractIssueOncalls(schedule, userMap);
63+
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
64+
});
65+
66+
it('extracts g and d on 11 of April', () => {
67+
jest.setSystemTime(new Date(2025, 3, 11));
68+
const oncalls = extractIssueOncalls(schedule, userMap);
69+
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
70+
});
71+
72+
it('extracts g and d on 12 of April', () => {
73+
jest.setSystemTime(new Date(2025, 3, 12));
74+
const oncalls = extractIssueOncalls(schedule, userMap);
75+
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
76+
});
77+
78+
it('extracts g and d on 13 of April', () => {
79+
jest.setSystemTime(new Date(2025, 3, 13));
80+
const oncalls = extractIssueOncalls(schedule, userMap);
81+
expect(oncalls).toEqual([userMap['@g'], userMap['@d']]);
82+
});
83+
});
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
*/
9+
10+
const fs = require('fs');
11+
const path = require('path');
12+
13+
function readOutcomes() {
14+
const baseDir = '/tmp';
15+
let outcomes = {};
16+
fs.readdirSync(baseDir).forEach(file => {
17+
const fullPath = path.join(baseDir, file);
18+
if (fullPath.endsWith('outcome') && fs.statSync(fullPath).isDirectory) {
19+
fs.readdirSync(fullPath).forEach(subFile => {
20+
const subFullPath = path.join(fullPath, subFile);
21+
if (subFullPath.endsWith('outcome')) {
22+
const [library, status] = String(fs.readFileSync(subFullPath, 'utf8'))
23+
.trim()
24+
.split(':');
25+
const platform = subFile.includes('android') ? 'Android' : 'iOS';
26+
console.log(
27+
`[${platform}] ${library} completed with status ${status}`,
28+
);
29+
outcomes[library.trim()] = {
30+
platform,
31+
status: status.trim(),
32+
};
33+
}
34+
});
35+
} else if (fullPath.endsWith('outcome')) {
36+
const [library, status] = String(fs.readFileSync(fullPath, 'utf8'))
37+
.trim()
38+
.split(':');
39+
const platform = file.includes('android') ? 'Android' : 'iOS';
40+
console.log(`[${platform}] ${library} completed with status ${status}`);
41+
outcomes[library.trim()] = {
42+
platform,
43+
status: status.trim(),
44+
};
45+
}
46+
});
47+
return outcomes;
48+
}
49+
50+
function printFailures(outcomes) {
51+
console.log('Printing failures...');
52+
let failures = 0;
53+
Object.entries(outcomes).forEach(([library, value]) => {
54+
if (value.status !== 'success') {
55+
console.log(
56+
`❌ [${value.platform}] ${library} failed with status ${value.status}`,
57+
);
58+
failures++;
59+
}
60+
});
61+
return failures > 0;
62+
}
63+
64+
function collectResults() {
65+
const outcomes = readOutcomes();
66+
const failures = printFailures(outcomes);
67+
if (failures) {
68+
process.exit(1);
69+
}
70+
console.log('✅ All tests passed!');
71+
}
72+
module.exports = {
73+
collectResults,
74+
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
*/
9+
10+
const fs = require('fs');
11+
12+
const MSEC_IN_DAY = 1000 * 60 * 60 * 24;
13+
14+
function formatUsers(users) {
15+
console.log(`${users[0]} ${users[1]}`.trim());
16+
}
17+
18+
function extractUsersFromScheduleAndDate(schedule, userMap, date) {
19+
const year = date.getFullYear();
20+
const month = date.getMonth() + 1; // 0 is January, 1 is February
21+
const day = date.getDate();
22+
const dateStr = `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day}`;
23+
const user1 = userMap[schedule[dateStr][0]];
24+
const user2 = userMap[schedule[dateStr][1]];
25+
return [user1, user2];
26+
}
27+
28+
function main() {
29+
const configuration = process.argv[2];
30+
const {userMap, schedule} = JSON.parse(configuration);
31+
extractIssueOncalls(schedule, userMap);
32+
}
33+
34+
function extractIssueOncalls(schedule, userMap) {
35+
const now = new Date();
36+
const dayOfTheWeek = now.getDay(); // 0 is Sunday, 1 is Monday, etc.
37+
let users;
38+
if (dayOfTheWeek === 2) {
39+
// exact match in the schedule
40+
users = extractUsersFromScheduleAndDate(schedule, userMap, now);
41+
} else if (dayOfTheWeek < 2) {
42+
// sunday
43+
// go to the tuesday of the last week
44+
const lastWeekTuesday = new Date(now - (5 + dayOfTheWeek) * MSEC_IN_DAY);
45+
users = extractUsersFromScheduleAndDate(schedule, userMap, lastWeekTuesday);
46+
} else if (dayOfTheWeek > 1) {
47+
// go to the previous tuesday
48+
const thisWeekTuesday = new Date(now - (dayOfTheWeek - 2) * MSEC_IN_DAY);
49+
users = extractUsersFromScheduleAndDate(schedule, userMap, thisWeekTuesday);
50+
}
51+
formatUsers(users);
52+
return users;
53+
}
54+
55+
if (require.main === module) {
56+
void main();
57+
}
58+
59+
module.exports = {
60+
extractIssueOncalls,
61+
};

.github/workflow-scripts/publishTemplate.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ module.exports.verifyPublishedTemplate = async (
6969
retries = MAX_RETRIES,
7070
) => {
7171
try {
72+
if (version.startsWith('v')) {
73+
version = version.slice(1);
74+
}
7275
await verifyPublishedPackage(
7376
TEMPLATE_NPM_PKG,
7477
version,

.github/workflows/monitor-new-issues.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,33 @@ on:
55
- cron: "0 0,6,12,18 * * *"
66
workflow_dispatch:
77

8+
# Reminder for when we have to update the schedule (before Jan 2026):
9+
# the secrets.ONCALL_SCHEDULE secret must be on a single line and must have all the `"` escaped as `\"`.
10+
# Only a meta engineer can update it through the OSS internal portal.
11+
812
jobs:
913
monitor-issues:
1014
runs-on: ubuntu-latest
1115
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
1218
- name: Set up Node.js
1319
uses: actions/setup-node@v4
1420
with:
1521
node-version: '20'
22+
- name: Install dependencies
23+
uses: ./.github/actions/yarn-install
24+
- name: Extract next oncall
25+
run: |
26+
ONCALLS=$(node ./.github/workflow-scripts/extractIssueOncalls.js "${{ secrets.ONCALL_SCHEDULE }}")
27+
ONCALL1=$(echo $ONCALLS | cut -d ' ' -f 1)
28+
ONCALL2=$(echo $ONCALLS | cut -d ' ' -f 2)
29+
echo "oncall1=$ONCALL1" >> $GITHUB_ENV
30+
echo "oncall2=$ONCALL2" >> $GITHUB_ENV
31+
- name: Print oncalls
32+
run: |
33+
echo "oncall1: ${{ env.oncall1 }}"
34+
echo "oncall2: ${{ env.oncall2 }}"
1635
- name: Monitor New Issues
1736
uses: react-native-community/repo-monitor@v1.0.1
1837
with:
@@ -23,5 +42,5 @@ jobs:
2342
repo_owner: "facebook"
2443
repo_name: "react-native"
2544
discord_webhook_url: "${{ secrets.DISCORD_WEBHOOK_URL }}"
26-
discord_id_type: "role"
27-
discord_ids: "1339243367841927228"
45+
discord_id_type: "user"
46+
discord_ids: "${{ env.oncall1 }},${{ env.oncall2 }}"

0 commit comments

Comments
 (0)