Skip to content

Commit 6661a99

Browse files
Merge branch 'nodejs:main' into fix-cp-directory-timestamps
2 parents 321146b + 523e583 commit 6661a99

664 files changed

Lines changed: 17816 additions & 5241 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/workflows/auto-start-ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
# optimistic, it can take longer to run.
1010
# To understand why `schedule` is used instead of other events, refer to
1111
# ./doc/contributing/commit-queue.md
12-
- cron: '*/5 * * * *'
12+
- cron: 3/5 * * * *
1313

1414
concurrency: ${{ github.workflow }}
1515

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
# be read-only, and the Action won't have access to any other repository
1212
# secrets, which it needs to access Jenkins API.
1313
schedule:
14-
- cron: '*/5 * * * *'
14+
- cron: 3/5 * * * *
1515

1616
concurrency: ${{ github.workflow }}
1717

@@ -28,6 +28,7 @@ jobs:
2828
if: github.repository == 'nodejs/node'
2929
runs-on: ubuntu-slim
3030
outputs:
31+
aged_prs: ${{ steps.get_candidate_prs.outputs.aged_prs }}
3132
candidates: ${{ steps.get_candidate_prs.outputs.candidates }}
3233
steps:
3334
- name: Get Pull Request Candidates
@@ -50,6 +51,7 @@ jobs:
5051
--search "-label:blocked")
5152
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5253
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
54+
echo "aged_prs=$aged_prs" >> "$GITHUB_OUTPUT"
5355
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5456
env:
5557
GH_TOKEN: ${{ github.token }}
@@ -93,6 +95,7 @@ jobs:
9395
curl -fsSLo "$readme" "https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/README.md"
9496
9597
numbers=
98+
lacks_second_approval_prs=
9699
# shellcheck disable=SC2086
97100
for pr in $CANDIDATES; do
98101
metadata="${RUNNER_TEMP}/metadata-${pr}.json"
@@ -139,6 +142,14 @@ jobs:
139142
if [ "$metadata_status" -ge 20 ] && [ "$metadata_status" -le 29 ]; then
140143
echo "pr ${pr} skipped, not ready to land"
141144
echo "reason codes: ${metadata_reason_codes}"
145+
if jq -e '
146+
(.reasonCodes | index("wait-time")) and
147+
(.pullRequest.labels | index("lacks-second-approval") | not)
148+
' "$metadata" > /dev/null; then
149+
case " $AGED_PRS " in
150+
*" $pr "*) lacks_second_approval_prs="$lacks_second_approval_prs $pr" ;;
151+
esac
152+
fi
142153
continue
143154
fi
144155
@@ -148,11 +159,27 @@ jobs:
148159
done
149160
150161
numbers=$(echo "$numbers" | xargs)
162+
lacks_second_approval_prs=$(echo "$lacks_second_approval_prs" | xargs)
151163
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
164+
echo "lacks_second_approval_prs=$lacks_second_approval_prs" >> "$GITHUB_OUTPUT"
152165
env:
166+
AGED_PRS: ${{ needs.get_candidate_prs.outputs.aged_prs }}
153167
CANDIDATES: ${{ needs.get_candidate_prs.outputs.candidates }}
154168
GH_TOKEN: ${{ github.token }}
155169

170+
- name: Label Pull Requests Lacking a Second Approval
171+
if: steps.get_mergeable_prs.outputs.lacks_second_approval_prs != ''
172+
run: |
173+
# shellcheck disable=SC2086
174+
for pr in $PULL_REQUESTS; do
175+
if ! gh -R "$GITHUB_REPOSITORY" pr edit "$pr" --add-label 'lacks-second-approval'; then
176+
echo "::warning::Failed to add lacks-second-approval to PR ${pr}"
177+
fi
178+
done
179+
env:
180+
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
181+
PULL_REQUESTS: ${{ steps.get_mergeable_prs.outputs.lacks_second_approval_prs }}
182+
156183
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
157184
if: steps.get_mergeable_prs.outputs.numbers != ''
158185
with:
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Welcome first-time contributors
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
permissions: {}
8+
9+
jobs:
10+
agentscan:
11+
if: >-
12+
github.run_attempt == 1 &&
13+
github.repository == 'nodejs/node' &&
14+
(github.event.pull_request.author_association == 'FIRST_TIMER' ||
15+
github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR')
16+
runs-on: ubuntu-slim
17+
permissions:
18+
contents: read
19+
outputs:
20+
scan_outcome: ${{ steps.agentscan.outcome }}
21+
classification: ${{ steps.agentscan.outputs.classification }}
22+
community_flagged: ${{ steps.agentscan.outputs['community-flagged'] }}
23+
steps:
24+
- name: Scan contributor activity
25+
id: agentscan
26+
# The welcome should still be posted if this advisory scan fails.
27+
continue-on-error: true
28+
uses: MatteoGabriele/agentscan-action@98202262c925c508d4c1424b1dfbe17ee35b0c02 # v2.4.0
29+
with:
30+
github-token: ${{ github.token }}
31+
mode: silent
32+
scan-pull-requests: true
33+
scan-issues: false
34+
auto-close: false
35+
honeypot: false
36+
37+
comment:
38+
needs: agentscan
39+
runs-on: ubuntu-slim
40+
permissions:
41+
pull-requests: write
42+
steps:
43+
- name: Welcome first-time contributor
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NUMBER: ${{ github.event.pull_request.number }}
47+
AGENTSCAN_OUTCOME: ${{ needs.agentscan.outputs.scan_outcome }}
48+
AGENTSCAN_CLASSIFICATION: ${{ needs.agentscan.outputs.classification }}
49+
AGENTSCAN_COMMUNITY_FLAGGED: ${{ needs.agentscan.outputs.community_flagged }}
50+
WELCOME_MESSAGE: >2-
51+
Welcome to Node.js, and thank you for your first contribution!
52+
53+
Before review, please take a moment to read:
54+
55+
* the [guide for first-time contributors](https://github.com/nodejs/node/blob/HEAD/doc/contributing/first-contributions.md)
56+
* the [contribution and automation policies](https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md)
57+
* the [pull request guide](https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md)
58+
* the [AI use policy](https://github.com/nodejs/node/blob/HEAD/doc/contributing/ai-guidelines.md)
59+
* the [Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md)
60+
61+
Please make sure every commit is
62+
[signed off](https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#step-4-commit).
63+
For a first pull request, GitHub Actions require collaborator
64+
approval and Jenkins CI must be started by a collaborator or triager,
65+
so an initial wait is normal.
66+
CAUTION_MESSAGE: >-
67+
> [!CAUTION]
68+
69+
> AgentScan found account activity patterns that may be consistent with
70+
automation. This is a heuristic, not proof that this pull request was
71+
opened by an agent or violates policy. AI-assisted contributions are
72+
permitted, but automated tooling must not open pull requests without
73+
advance approval, and contributors must personally understand, test,
74+
verify, and take responsibility for every submitted change. See the
75+
[AgentScan analysis](https://agentscan.tools/user/${{ github.event.pull_request.user.login }}),
76+
[AI use policy](https://github.com/nodejs/node/blob/HEAD/doc/contributing/ai-guidelines.md),
77+
and
78+
[automation policy](https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md#automation-and-bots)
79+
for additional context.
80+
run: |
81+
add_caution=false
82+
if [[ "$AGENTSCAN_OUTCOME" == "success" ]]; then
83+
case "$AGENTSCAN_CLASSIFICATION" in
84+
mixed|automation)
85+
add_caution=true
86+
;;
87+
esac
88+
if [[ "$AGENTSCAN_COMMUNITY_FLAGGED" == "true" ]]; then
89+
add_caution=true
90+
fi
91+
fi
92+
93+
if [[ "$add_caution" == "true" ]]; then
94+
printf '%s\n\n%s\n' "$WELCOME_MESSAGE" "$CAUTION_MESSAGE"
95+
else
96+
printf '%s\n' "$WELCOME_MESSAGE"
97+
fi | gh pr comment "$NUMBER" --repo "$GITHUB_REPOSITORY" --body-file -

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ install_manifest.txt
163163

164164
# === Rules for AI assistants ===
165165
CLAUDE.md
166-
AGENTS.md
167166

168167
# === Global Rules ===
169168
# Keep last to avoid being excluded

‎AGENTS.md‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Agents and Automated Tools
2+
3+
This document outlines rules and requirements for AI automation agents and automated
4+
tooling that interact with the Node.js project.
5+
6+
Existing Node.js collaborators (as listed in the README.md) may use AI agents to
7+
contribute but must do so responsibly.
8+
9+
New Node.js contributors should avoid using AI agents to interact with the project.
10+
11+
## Code Contributions
12+
13+
* **No unreviewed automation**: Automated pull requests must not be created without
14+
ongoing human oversight. The pull request must be actively maintained by a human
15+
contributor who responds to feedback. The AI agent is not permitted to create pull
16+
requests, open issues, post comments, respond to reviews, or push commits without
17+
ongoing human oversight.
18+
19+
* **Commit responsibility**: Commits created with agent assistance must follow all
20+
Node.js [commit message guidelines](./doc/contributing/pull-requests.md#commit-message-guidelines).
21+
The human contributor opening the PR takes full responsibility for the changes.
22+
23+
* **Testing and verification**: All changes must pass the Node.js continuous integration.
24+
Human judgment must verify that existing tests are not removed or modified inappropriately,
25+
and that new tests correctly validate the intended behavior.
26+
27+
### Requirements
28+
29+
* All commits must be signed off by the human user using `Signed-off-by: <your name> (<your email>)`
30+
as an attestation to the [Developer Certificate of Origin](https://developercertificate.org/).
31+
* AI-assistance must be acknowledged using the `Assisted-by: <agent name>` annotation.
32+
* AI-authored code contributions must be compatible with the project's licensing and
33+
contribution guidelines.
34+
35+
## Prohibited Activities
36+
37+
AI agents **must not**:
38+
39+
* Push to any branch or tag in nodejs/node.
40+
* Create unsupervised pull requests or issues without active human engagement.
41+
* Make claims about code without human verification against actual source code.
42+
* Remove or modify existing tests without human judgment.
43+
* Interact with the repository through means other than those explicitly authorized.
44+
* Use commit messages to promote for-profit AI tools or commercial brands. A single
45+
`Assisted-by: <agent-name>` annotation is required disclosure, not promotion, and is
46+
permitted.
47+
* Post AI-generated messages directly into pull requests, issues, or project communication
48+
channels without direct human review and editing to ensure clarity, accuracy, and respect
49+
for collaborator time.
50+
* Sign off commits using `Signed-off-by: <agent name>` or `Co-authored-by: <agent name>`.
51+
52+
## Violations
53+
54+
Automated interactions that violate these rules may result in:
55+
56+
* Immediate closure of pull requests without review.
57+
* Blocking of the automation tool from further interaction with the project.
58+
* Blocking of the tool's account or its owner from contributing.
59+
* Reports to relevant platforms or organizations operating the automation.
60+
61+
***
62+
63+
For more information on AI use in general contributions (not specific to agents),
64+
see [AI use policy and guidelines](./doc/contributing/ai-guidelines.md).

‎CHANGELOG.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ release.
4141
</tr>
4242
<tr>
4343
<td valign="top">
44-
<b><a href="doc/changelogs/CHANGELOG_V26.md#26.7.0">26.7.0</a></b><br/>
44+
<b><a href="doc/changelogs/CHANGELOG_V26.md#26.8.1">26.8.1</a></b><br/>
45+
<a href="doc/changelogs/CHANGELOG_V26.md#26.8.0">26.8.0</a><br/>
46+
<a href="doc/changelogs/CHANGELOG_V26.md#26.7.0">26.7.0</a><br/>
4547
<a href="doc/changelogs/CHANGELOG_V26.md#26.6.0">26.6.0</a><br/>
4648
<a href="doc/changelogs/CHANGELOG_V26.md#26.5.1">26.5.1</a><br/>
4749
<a href="doc/changelogs/CHANGELOG_V26.md#26.5.0">26.5.0</a><br/>
@@ -53,7 +55,8 @@ release.
5355
<a href="doc/changelogs/CHANGELOG_V26.md#26.0.0">26.0.0</a><br/>
5456
</td>
5557
<td valign="top">
56-
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.19.0">24.19.0</a></b><br/>
58+
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.20.0">24.20.0</a></b><br/>
59+
<a href="doc/changelogs/CHANGELOG_V24.md#24.19.0">24.19.0</a><br/>
5760
<a href="doc/changelogs/CHANGELOG_V24.md#24.18.1">24.18.1</a><br/>
5861
<a href="doc/changelogs/CHANGELOG_V24.md#24.18.0">24.18.0</a><br/>
5962
<a href="doc/changelogs/CHANGELOG_V24.md#24.17.0">24.17.0</a><br/>

‎Makefile‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ ifneq ($(SKIP_SHARED_DEPS), 1)
12881288
cp doc/node.1 $(TARNAME)/doc/node.1
12891289
cp -r out/doc/api/* $(TARNAME)/doc/api/
12901290
endif
1291-
sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix
1291+
sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix
12921292
$(RM) -r $(TARNAME)/.editorconfig
12931293
$(RM) -r $(TARNAME)/.git*
12941294
$(RM) -r $(TARNAME)/.mailmap
@@ -1480,7 +1480,7 @@ else
14801480
LINT_MD_NEWER = -newer tools/.mdlintstamp
14811481
endif
14821482

1483-
LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(filter-out CLAUDE.md AGENTS.md,$(wildcard *.md))
1483+
LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(filter-out CLAUDE.md,$(wildcard *.md))
14841484
LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \
14851485
! -path '*node_modules*' ! -path 'test/fixtures/*' -name '*.md' \
14861486
$(LINT_MD_NEWER))
@@ -1528,7 +1528,8 @@ format-md: tools/lint-md/node_modules/remark-parse/package.json ## Format the ma
15281528
LINT_JS_TARGETS = eslint.config.mjs benchmark doc lib test tools
15291529

15301530
run-lint-js = tools/eslint/node_modules/eslint/bin/eslint.js --cache \
1531-
--max-warnings=0 --report-unused-disable-directives $(LINT_JS_TARGETS)
1531+
--max-warnings=0 --report-unused-disable-directives \
1532+
--concurrency auto $(LINT_JS_TARGETS)
15321533
run-lint-js-fix = $(run-lint-js) --fix
15331534

15341535
tools/eslint/node_modules/eslint/bin/eslint.js: tools/eslint/package-lock.json
@@ -1555,7 +1556,7 @@ jslint: lint-js
15551556

15561557
run-lint-js-ci = tools/eslint/node_modules/eslint/bin/eslint.js \
15571558
--max-warnings=0 --report-unused-disable-directives -f tap \
1558-
-o test-eslint.tap $(LINT_JS_TARGETS)
1559+
--concurrency auto -o test-eslint.tap $(LINT_JS_TARGETS)
15591560

15601561
.PHONY: lint-js-ci
15611562
# On the CI the output is emitted in the TAP format.

0 commit comments

Comments
 (0)