Commit Graph

27 Commits

Author SHA1 Message Date
Antoine du Hamel
13d6950a6c
tools: add util scripts to land and rebase PRs
PR-URL: https://github.com/nodejs/node/pull/54656
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2024-09-06 09:08:24 +02: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
Antoine du Hamel
3fe35dc5af
Revert "tools: add --certify-safe to nci-ci"
This reverts commit 0fa07d4442.

PR-URL: https://github.com/nodejs/node/pull/53098
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-05-24 09:47:50 +00:00
Matteo Collina
0fa07d4442
tools: add --certify-safe to nci-ci
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/52940
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-12 06:33:11 +00:00
Antoine du Hamel
a3874dd637
tools: fix request-ci-failed comment
PR-URL: https://github.com/nodejs/node/pull/45291
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2022-11-03 02:14:40 +00:00
Antoine du Hamel
1422e51a5b
tools: fix request-ci-failed comment
Refs: https://github.com/nodejs/node/pull/45209#issuecomment-1294239904
PR-URL: https://github.com/nodejs/node/pull/45218
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2022-10-28 11:45:35 +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
Rich Trott
5cc4b69fd4
tools: be intentional about masking possible error in start-ci.sh
Revise start-ci.sh to conform with shellcheck 0.8.0 default checks.

Refs: https://www.shellcheck.net/wiki/SC2312

PR-URL: https://github.com/nodejs/node/pull/41284
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-12-24 19:25:06 +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
Mary Marchini
e0d181cf2b
build: increase startCI verbosity and fix job name
Ref: https://github.com/nodejs/node/issues/34594#issuecomment-669245839

PR-URL: https://github.com/nodejs/node/pull/34635
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-08-05 10:18:36 -07:00
Mary Marchini
6cab3b0e26
build: auto start Jenkins CI via PR labels
Add an Action that will find every PR with the `request-ci` label and
will start a Jenkins CI for each of these Pull Requests. The scheduler
event is used to circumvent GitHub Actions limitations on Pull Requests
from forks (where secrets are not accessible and the GITHUB_TOKEN is
read-only).

If the Action fails to start a CI, it will add a `request-ci-failed`
label and will leave a comment with the error message from NCU.

Fixes: https://github.com/nodejs/github-bot/issues/234

PR-URL: https://github.com/nodejs/node/pull/34089
Reviewed-By: Christian Clauss <cclauss@me.com>
2020-07-31 16:09:41 -07:00