Skip to content

Commit 02481e8

Browse files
committed
Merge branch 'main' of github.com:IlyasShabi/node into ishabi/near-heap-limit-profile
2 parents 5c31170 + 984e46f commit 02481e8

5,428 files changed

Lines changed: 405484 additions & 128103 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.

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
/deps/ada @nodejs/url
207207
/lib/internal/url.js @nodejs/url
208208
/lib/url.js @nodejs/url
209+
/src/node_url_pattern.* @nodejs/url
209210
/src/node_url.* @nodejs/url
210211
/test/fixtures/wpt/url @nodejs/url
211212

‎.github/workflows/auto-start-ci.yml‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This action uses the following secrets:
2+
# JENKINS_USER: GitHub user whose Jenkins token is defined below
3+
# JENKINS_TOKEN: Jenkins token, to be used to start CI
14
name: Auto Start CI
25

36
on:
@@ -36,11 +39,13 @@ jobs:
3639
-t '{{ range . }}{{ .number }} {{ end }}' \
3740
--limit 5)" >> "$GITHUB_OUTPUT"
3841
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GH_TOKEN: ${{ github.token }}
4043
start-ci:
4144
permissions:
45+
checks: read
4246
contents: read
4347
pull-requests: write
48+
statuses: read
4449
needs: get-prs-for-ci
4550
if: needs.get-prs-for-ci.outputs.numbers != ''
4651
runs-on: ubuntu-slim
@@ -59,16 +64,15 @@ jobs:
5964
ncu-config set token "$GH_TOKEN"
6065
ncu-config set jenkins_token "$JENKINS_TOKEN"
6166
ncu-config set owner "$GITHUB_REPOSITORY_OWNER"
62-
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
67+
ncu-config set repo "${GITHUB_REPOSITORY#*/}"
6368
env:
6469
USERNAME: ${{ secrets.JENKINS_USER }}
65-
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
70+
GH_TOKEN: ${{ github.token }}
6671
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
6772

6873
- name: Start the CI
6974
run: |
7075
curl -fsSL "https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/start-ci.sh" \
7176
| sh -s -- ${{ needs.get-prs-for-ci.outputs.numbers }}
7277
env:
73-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74-
GH_REPO: ${{ github.repository }}
78+
GH_TOKEN: ${{ github.token }}

‎.github/workflows/benchmark.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
env:
9393
EXPECTED_SHA: ${{ inputs.commit }}
9494

95-
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
95+
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
9696
with:
9797
extra_nix_config: sandbox = true
9898

@@ -141,7 +141,7 @@ jobs:
141141
--arg devTools '[]' \
142142
--arg benchmarkTools '[]' \
143143
--run '
144-
make -j4 V=1
144+
make build-ci -j4 V=1
145145
'
146146
147147
- name: Run benchmark
@@ -211,7 +211,7 @@ jobs:
211211
merge-multiple: true
212212
path: raw-results
213213

214-
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
214+
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
215215
with:
216216
extra_nix_config: sandbox = true
217217

‎.github/workflows/build-shared.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
required: false
2323
type: string
2424
default: ''
25+
pkcs11-store-test:
26+
description: Whether to enable the PKCS#11-backed crypto STORE test
27+
required: false
28+
type: boolean
29+
default: false
2530
secrets:
2631
CACHIX_AUTH_TOKEN:
2732
description: Cachix auth token for nodejs.cachix.org.
@@ -48,7 +53,7 @@ jobs:
4853
tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
4954
echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
5055
51-
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
56+
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
5257
with:
5358
extra_nix_config: sandbox = true
5459

@@ -84,6 +89,7 @@ jobs:
8489
--arg ccache "${NIX_SCCACHE:-null}" \
8590
--arg devTools '[]' \
8691
--arg benchmarkTools '[]' \
92+
--arg pkcs11 ${{ inputs.pkcs11-store-test }} \
8793
${{ inputs.extra-nix-flags }} \
8894
--run '
8995
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"

‎.github/workflows/build-tarball.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**
@@ -78,7 +80,7 @@ jobs:
7880
with:
7981
persist-credentials: false
8082
- name: Set up Python ${{ env.PYTHON_VERSION }}
81-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
83+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
8284
with:
8385
python-version: ${{ env.PYTHON_VERSION }}
8486
allow-prereleases: true
@@ -112,15 +114,15 @@ jobs:
112114
with:
113115
clang-version: ${{ env.CLANG_VERSION }}
114116
- name: Set up Python ${{ env.PYTHON_VERSION }}
115-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
117+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
116118
with:
117119
python-version: ${{ env.PYTHON_VERSION }}
118120
allow-prereleases: true
119121
- name: Set up sccache
120122
if: github.base_ref == 'main' || github.ref_name == 'main'
121-
uses: Mozilla-Actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
123+
uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
122124
with:
123-
version: v0.16.0
125+
version: v0.17.0
124126
- name: Download tarball
125127
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
126128
with:

‎.github/workflows/close-stalled.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.repository == 'nodejs/node'
2121
runs-on: ubuntu-slim
2222
steps:
23-
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
23+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
2424
with:
2525
repo-token: ${{ secrets.GITHUB_TOKEN }}
2626
days-before-close: 30

‎.github/workflows/codeql.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828

2929
# Initializes the CodeQL tools for scanning.
3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
31+
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
3232
with:
3333
languages: ${{ matrix.language }}
3434
config-file: ./.github/codeql-config.yml
3535

3636
- name: Autobuild
37-
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
37+
uses: github/codeql-action/autobuild@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
40+
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
4141
with:
4242
category: /language:${{matrix.language}}

‎.github/workflows/commit-queue.yml‎

Lines changed: 117 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,78 +22,152 @@ permissions:
2222
contents: read
2323

2424
jobs:
25-
get_mergeable_prs:
25+
get_candidate_prs:
2626
permissions:
2727
pull-requests: read
2828
if: github.repository == 'nodejs/node'
2929
runs-on: ubuntu-slim
3030
outputs:
31-
numbers: ${{ steps.get_mergeable_prs.outputs.numbers }}
31+
candidates: ${{ steps.get_candidate_prs.outputs.candidates }}
3232
steps:
33-
- name: Get Pull Requests
34-
id: get_mergeable_prs
33+
- name: Get Pull Request Candidates
34+
id: get_candidate_prs
3535
run: |
36-
prs=$(gh pr list \
36+
list_prs() {
37+
gh pr list \
3738
--repo "$GITHUB_REPOSITORY" \
3839
--base "$GITHUB_REF_NAME" \
3940
--label 'commit-queue' \
41+
"$@" \
4042
--json 'number' \
41-
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
4243
-t '{{ range . }}{{ .number }} {{ end }}' \
43-
--limit 100)
44-
fast_track_prs=$(gh pr list \
45-
--repo "$GITHUB_REPOSITORY" \
46-
--base "$GITHUB_REF_NAME" \
47-
--label 'commit-queue' \
44+
--limit 100
45+
}
46+
aged_prs=$(list_prs \
47+
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked")
48+
fast_track_prs=$(list_prs \
4849
--label 'fast-track' \
49-
--search "-label:blocked" \
50-
--json 'number' \
51-
-t '{{ range . }}{{ .number }} {{ end }}' \
52-
--limit 100)
53-
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
54-
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
50+
--search "-label:blocked")
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
52+
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
53+
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5554
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
GH_TOKEN: ${{ github.token }}
5756
commitQueue:
58-
needs: get_mergeable_prs
59-
if: needs.get_mergeable_prs.outputs.numbers != ''
57+
needs: get_candidate_prs
58+
if: needs.get_candidate_prs.outputs.candidates != ''
59+
permissions:
60+
checks: read
61+
contents: read
62+
pull-requests: read
63+
statuses: read
6064
runs-on: ubuntu-slim
6165
steps:
62-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
63-
with:
64-
# A personal token is required because pushing with GITHUB_TOKEN will
65-
# prevent commits from running CI after they land. It needs
66-
# to be set here because `checkout` configures GitHub authentication
67-
# for push as well.
68-
token: ${{ secrets.GH_USER_TOKEN }}
69-
70-
# Install dependencies
7166
- name: Install Node.js
7267
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7368
with:
7469
node-version: ${{ env.NODE_VERSION }}
70+
7571
- name: Install @node-core/utils
7672
run: npm install -g @node-core/utils
7773

78-
- name: Set variables
79-
run: |
80-
echo "REPOSITORY=$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)" >> "$GITHUB_ENV"
81-
8274
- name: Configure @node-core/utils
8375
run: |
84-
ncu-config set branch "${GITHUB_REF_NAME}"
85-
ncu-config set upstream origin
86-
ncu-config set username "$USERNAME"
87-
ncu-config set token "$GITHUB_TOKEN"
88-
ncu-config set jenkins_token "$JENKINS_TOKEN"
89-
ncu-config set repo "${REPOSITORY}"
90-
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
76+
# Keep the config outside the workspace so checkout does not remove it.
77+
ncu-config --global set branch "${GITHUB_REF_NAME}"
78+
ncu-config --global set upstream origin
79+
ncu-config --global set username "$USERNAME"
80+
ncu-config --global set token "$GH_TOKEN"
81+
ncu-config --global set jenkins_token "$JENKINS_TOKEN"
82+
ncu-config --global set repo "${GITHUB_REPOSITORY#*/}"
83+
ncu-config --global set owner "${GITHUB_REPOSITORY_OWNER}"
9184
env:
9285
USERNAME: ${{ secrets.JENKINS_USER }}
93-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
86+
GH_TOKEN: ${{ github.token }}
9487
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
9588

89+
- name: Filter Pull Requests
90+
id: get_mergeable_prs
91+
run: |
92+
readme="${RUNNER_TEMP}/README.md"
93+
curl -fsSLo "$readme" "https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/README.md"
94+
95+
numbers=
96+
# shellcheck disable=SC2086
97+
for pr in $CANDIDATES; do
98+
metadata="${RUNNER_TEMP}/metadata-${pr}.json"
99+
output="${RUNNER_TEMP}/metadata-${pr}.txt"
100+
if git node metadata "$pr" \
101+
--readme "$readme" \
102+
--json > "$metadata" 2> "$output"; then
103+
metadata_status=0
104+
else
105+
metadata_status=$?
106+
fi
107+
108+
if [ -s "$output" ]; then
109+
cat "$output"
110+
fi
111+
112+
case "$metadata_status" in
113+
0|2[0-9]|4[0-9]) ;;
114+
*)
115+
echo "git node metadata failed for pr ${pr} with exit code ${metadata_status}"
116+
exit 1
117+
;;
118+
esac
119+
120+
metadata_exit_code=$(jq -r '.exitCode' "$metadata") || {
121+
echo "failed to parse metadata JSON for pr ${pr}"
122+
exit 1
123+
}
124+
if [ "$metadata_exit_code" != "$metadata_status" ]; then
125+
echo "metadata JSON exitCode mismatch for pr ${pr}"
126+
exit 1
127+
fi
128+
metadata_reason_codes=$(jq -r '.reasonCodes | join(", ")' "$metadata") || {
129+
echo "failed to parse metadata reason codes for pr ${pr}"
130+
exit 1
131+
}
132+
133+
if [ "$metadata_status" -eq 0 ]; then
134+
echo "pr ${pr} is ready for the commit queue"
135+
numbers="$numbers $pr"
136+
continue
137+
fi
138+
139+
if [ "$metadata_status" -ge 20 ] && [ "$metadata_status" -le 29 ]; then
140+
echo "pr ${pr} skipped, not ready to land"
141+
echo "reason codes: ${metadata_reason_codes}"
142+
continue
143+
fi
144+
145+
echo "pr ${pr} will be handled by the commit queue"
146+
echo "reason codes: ${metadata_reason_codes}"
147+
numbers="$numbers $pr"
148+
done
149+
150+
numbers=$(echo "$numbers" | xargs)
151+
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
152+
env:
153+
CANDIDATES: ${{ needs.get_candidate_prs.outputs.candidates }}
154+
GH_TOKEN: ${{ github.token }}
155+
156+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
157+
if: steps.get_mergeable_prs.outputs.numbers != ''
158+
with:
159+
# A personal token is required because pushing with GITHUB_TOKEN will
160+
# prevent commits from running CI after they land. It needs
161+
# to be set here because `checkout` configures GitHub authentication
162+
# for push as well.
163+
token: ${{ secrets.GH_USER_TOKEN }}
164+
96165
- name: Start the Commit Queue
97-
run: ./tools/actions/commit-queue.sh "${GITHUB_REPOSITORY_OWNER}" "${REPOSITORY}" ${{ needs.get_mergeable_prs.outputs.numbers }}
166+
if: steps.get_mergeable_prs.outputs.numbers != ''
167+
run: |
168+
git config --local user.email "github-bot@iojs.org"
169+
git config --local user.name "Node.js GitHub Bot"
170+
ncu-config set token "$GH_TOKEN"
171+
./tools/actions/commit-queue.sh ${{ steps.get_mergeable_prs.outputs.numbers }}
98172
env:
99-
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
173+
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}

‎.github/workflows/coverage-linux-without-intl.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ jobs:
5858
with:
5959
clang-version: ${{ env.CLANG_VERSION }}
6060
- name: Set up Python ${{ env.PYTHON_VERSION }}
61-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
61+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
6262
with:
6363
python-version: ${{ env.PYTHON_VERSION }}
6464
allow-prereleases: true
6565
- name: Set up sccache
6666
if: github.base_ref == 'main' || github.ref_name == 'main'
67-
uses: Mozilla-Actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
67+
uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
6868
with:
69-
version: v0.16.0
69+
version: v0.17.0
7070
- name: Install gcovr
7171
run: pip install gcovr==7.2
7272
- name: Configure

0 commit comments

Comments
 (0)