同步操作将从 weolar/mininodejs20 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Stability: 1 - Experimental
tl;dr: You can land pull requests by adding the commit-queue
label to it.
Commit Queue is an experimental feature for the project which simplifies the
landing process by automating it via GitHub Actions. With it, collaborators can
land pull requests by adding the commit-queue
label to a PR. All
checks will run via node-core-utils, and if the pull request is ready to land,
the Action will rebase it and push to main
.
This document gives an overview of how the Commit Queue works, as well as implementation details, reasoning for design choices, and current limitations.
From a high-level, the Commit Queue works as follow:
commit-queue
label to pull requests ready to landrequest-ci
label (if it has, skip this PR
since it's pending a CI run)commit-queue
labelgit node land <pr> --oneCommitMax
git node land
sessioncommit-queue-failed
label to the PRgit node land
Landed in ...
To make the Commit Queue squash all the commits of a pull request into the
first one, add the commit-queue-squash
label.
To make the Commit Queue land a pull request containing several commits, add the
commit-queue-rebase
label. When using this option, make sure
that all commits are self-contained, meaning every commit should pass all tests.
The Commit Queue feature is still in early stages, and as such it might not work for more complex pull requests. These are the currently known limitations of the commit queue:
fixup!
commit that will be correctly handled by the --autosquash
optionThe action will run on scheduler events every five minutes. Five minutes is the smallest number accepted by the scheduler. The scheduler is not guaranteed to run every five minutes, it might take longer between runs.
Using the scheduler is preferable over using pull_request_target for two reasons:
issue_comment
event
has the same limitation.pull_request_target
will only run if the Action exists on the base commit
of a pull request, and it will run the Action version present on that
commit, meaning we wouldn't be able to use it for already opened PRs
without rebasing them first.node-core-utils
is configured with a personal token and
a Jenkins token from
@nodejs-github-bot.
octokit/graphql-action
is used to fetch all pull requests with the
commit-queue
label. The output is a JSON payload, so jq
is used to turn
that into a list of PR ids we can pass as arguments to
commit-queue.sh
.
The personal token only needs permission for public repositories and to read profiles, we can use the GITHUB_TOKEN for write operations. Jenkins token is required to check CI status.
commit-queue.sh
receives the following positional arguments:
The script will iterate over the pull requests. ncu-ci
is used to check if
the last CI is still pending, and calls to the GitHub API are used to check if
the PR is waiting for CI to start (request-ci
label). The PR is skipped if CI
is pending. No other CI validation is done here since git node land
will fail
if the last CI failed.
The script removes the commit-queue
label. It then runs git node land
,
forwarding stdout and stderr to a file. If any errors happen,
git node land --abort
is run, and then a commit-queue-failed
label is added
to the PR, as well as a comment with the output of git node land
.
If no errors happen during git node land
, the script will use the
GITHUB_TOKEN
to push the changes to main
, and then will leave a
Landed in ...
comment in the PR, and then will close it. Iteration continues
until all PRs have done the steps above.
Reverting broken commits is done manually by collaborators, just like when
commits are landed manually via git node land
. An easy way to revert is a
good feature for the project, but is not explicitly required for the Commit
Queue to work because the Action lands PRs just like collaborators do today. If
once we start using the Commit Queue we notice that the number of required
reverts increases drastically, we can pause the queue until a Revert Queue is
implemented, but until then we can enable the Commit Queue and then work on a
Revert Queue as a follow-up.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。