28 Commits
Author SHA1 Message Date
Filip Skokan c96226ecf1 tools: fix commit queue error summary matching
Recognize the error symbol emitted by core-validate-commit so validation
failures appear outside the collapsed output.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65913
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-09-10 15:19:25 +00:00
Filip Skokan 7276858621 tools: label PRs lacking second approval
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65538
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
2026-08-27 23:41:51 +02:00
Filip Skokan f411275331 tools: improve commit queue failure comment
Commit Queue failure comments hid the actionable reason inside the
collapsed landing transcript.

Surface the reason and retry instructions before the full output. Add
specific guidance for a missing multi-commit policy and explicit reasons
for push and squash-merge failures.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65433
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-08-22 14:24:44 +00:00
Antoine du Hamel 12eb296a31 tools: make env variables consistent in cron jobs
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65168
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-08-20 19:15:56 +00:00
Antoine du Hamel e53d87a57c tools: remove skip logic in commit-queue.sh
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65162
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-08-11 10:56:18 +00:00
Antoine du Hamel 21b28801a5 tools: delay removal of commit-queue label
The removes the possiblity for a PR to drop from the queue if the CQ job
is cancelled (or times out) in the middle of handling a PR.
This increases the window for two concurrent CQ jobs to pick up the same
PR, but that's an unlikely scenario.

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65101
Refs: https://github.com/nodejs/node/issues/64972
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-08-09 10:42:30 +00:00
Antoine du Hamel d7ed670da2 tools: lazy-abort failed PR merges in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65004
Refs: https://github.com/nodejs/node/issues/64972
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-08-07 09:16:36 +00:00
Antoine du Hamel d5b3dbb0f5 tools: do not use temp files when merging PRs
PR-URL: https://github.com/nodejs/node/pull/57790
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-04-10 22:37:31 +00:00
Nathan Baulch 0f375db9c6 tools: fix typos
PR-URL: https://github.com/nodejs/node/pull/55061
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-10-15 13:59:49 +00:00
Aviv Keller 53483a1344 meta: use HTML entities in commit-queue comment
PR-URL: https://github.com/nodejs/node/pull/53744
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-07-08 16:29:43 +00:00
Feng Yu b6c6cc7000 tools: update main branch name
PR-URL: https://github.com/nodejs/node/pull/43440
Refs: https://github.com/nodejs/node/issues/33864
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-06-17 08:48:18 +01:00
Xuguang Mei 8f07452206 tools: fix skip PR if CI is still running
resolve: https://github.com/nodejs/node/issues/40330

PR-URL: https://github.com/nodejs/node/pull/42377
Fixes: https://github.com/nodejs/node/issues/40330
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2022-03-21 04:33:11 +00:00
Rich Trott 5f07d00c60 tools: remove last of error-masking in commit-queue.sh
Remove the lats of the unintentional error-masking in commit-queue.sh.

With this change, `tools/lint-sh.js . --from-npx` at last passes.

PR-URL: https://github.com/nodejs/node/pull/41356
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-01-01 17:25:36 +00:00
Rich Trott e7a924e086 tools: do not mask errors on multiple commit retrieval
In commit-queue.sh, the assignment to `commits` will succeed and the
script will continue if one of the two `git` commands fails, even with
`-e` set. Split it into three separate assignments so that failures in
the `git` commands will be clearly logged and cause the script to exit
with a failure status code.

PR-URL: https://github.com/nodejs/node/pull/41340
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2021-12-30 05:57:57 +00:00
Rich Trott 67cd4a61ac tools: simplify commit-queue.sh merge command
The mergeUrl() function is only used in one place. It's a one-liner and
inlining it makes the script easier to understand, I think. It also
means no future shellcheck complaints about needing to add error
handling.

PR-URL: https://github.com/nodejs/node/pull/41314
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-12-27 14:48:07 +00:00
Michaël Zasso 873119385f tools: simplify and fix commit queue
Use `gh` CLI for CI and commit queue jobs, and use the correct token
to merge PRs.

PR-URL: https://github.com/nodejs/node/pull/40742
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
2021-11-07 15:26:45 +01:00
Antoine du Hamel 96e00e03cf tools: ensure the PR was not pushed before merging
When using Squash and Merge feature, it would allow to a malicious
actor to push unreviewed code to their PR while the CQ is running and
bypass the usual checks.
This commit adds a check to refuse to land if the head of the PR
branch is different from the one validated by ncu.

PR-URL: https://github.com/nodejs/node/pull/40747
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
2021-11-07 12:08:22 +01:00
Antoine du Hamel 80b8440656 tools: use GitHub Squash and Merge feature when using CQ
PR-URL: https://github.com/nodejs/node/pull/40666
Refs: https://docs.github.com/en/rest/reference/pulls#merge-a-pull-request
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-11-06 08:14:25 +00:00
Antoine du Hamel 9bd6d526e6 tools: abort CQ session when landing several commits
Most PRs are meant to be squashed in one commit when landing. If the
collaborator hasn't been using `fixup!` commits, the CQ lands the PR
as several commits. This change makes the CQ abort by default
when attempting to land several commits, unless there's another
label added to the PR to force squashing or landing as several commits.

Fixes: https://github.com/nodejs/node/issues/40436
Refs: https://github.com/nodejs/node-core-utils/pull/572

PR-URL: https://github.com/nodejs/node/pull/40577
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-11-01 21:02:52 +01:00
Antoine du Hamel 240c8bc190 tools: avoid crashing CQ when git push fails
PR-URL: https://github.com/nodejs/node/pull/36861
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2021-06-11 07:59:49 +00:00
bl-ue 5e5bb69338 tools: fix typo in commit-queue.sh
PR-URL: https://github.com/nodejs/node/pull/39000
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-06-11 06:02:23 +00:00
Antoine du Hamel 0e96dc1f95 tools: lint shell scripts
PR-URL: https://github.com/nodejs/node/pull/36099
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-16 23:45:26 +01:00
Antoine du Hamel 08be03b7cb tools: hide commit queue action link
PR-URL: https://github.com/nodejs/node/pull/36124
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-11-17 00:01:43 +00:00
Antoine du Hamel ac5df63952 build: fix Commit Queue failure comment
Refs: https://github.com/nodejs/node/pull/35206

PR-URL: https://github.com/nodejs/node/pull/35599
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-14 06:11:13 -07:00
Denys Otrishko ce11b1c395 build: fix landed message for multiple commits in commit-queue
PR-URL: https://github.com/nodejs/node/pull/35226
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-10-09 18:37:53 +00:00
Denys Otrishko 5509c1b7e5 build: add Commit Queue actions url to failure comment
PR-URL: https://github.com/nodejs/node/pull/35206
Refs: https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-10-09 11:05:32 -07:00
Denys Otrishko 75d943ed4a build: use autorebase option for git node land
This will allow to land commits with multiple commits and also properly
handle proper `fixup` commits.

Refs: https://github.com/nodejs/node-core-utils/pull/473

PR-URL: https://github.com/nodejs/node/pull/34969
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
2020-08-31 14:22:03 -07:00
Mary Marchini a84716a21b build: implement a Commit Queue in Actions
This is a (still experimental) implementation of a Commit Queue on
GitHub Actions, using labels and the scheduler event to land Pull
Requests. It uses `node-core-utils` to validate Pull Requests and to
prepare the commit message, and then it uses a GitHub personal token to
push changes back to the repository. If the Queue fails to land a Pull
Request, that PR will be removed from the queue and the
`node-core-utils` output will be pasted in the Pull Request.

An overview of the implementation is provided in
doc/guides/commit-queue.md, as well as current limitations.

Ref: https://github.com/mmarchini-oss/automated-merge-test
Ref: https://github.com/nodejs/build/issues/2201

PR-URL: https://github.com/nodejs/node/pull/34112
Refs: https://github.com/mmarchini-oss/automated-merge-test
Refs: https://github.com/nodejs/build/issues/2201
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-08-13 18:47:27 -07:00