Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit be4e7de

Browse files
committed
tools: only include fast-tracked and old enough PRs in CQ
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65197 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 753033c commit be4e7de

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

β€Ž.github/workflows/commit-queue.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
fast_track_prs=$(list_prs \
4949
--label 'fast-track' \
5050
--search "-label:blocked")
51-
queued_prs=$(list_prs \
52-
--search "-label:blocked")
53-
candidates=$(printf '%s %s %s\n' "$aged_prs" "$fast_track_prs" "$queued_prs" |
51+
candidates=$(printf '%s %s\n' "$fast_track_prs" "$aged_prs" |
5452
jq -r -s 'reduce .[] as $pr ([]; if index($pr) then . else . + [$pr] end) | join(" ")')
5553
echo "candidates=$candidates" >> "$GITHUB_OUTPUT"
5654
env:

β€Ždoc/contributing/commit-queue.mdβ€Ž

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@ From a high-level, the Commit Queue works as follows:
2020

2121
1. Collaborators will add `commit-queue` label to pull requests they want the
2222
queue to land. The label can be added before the pull request has completed
23-
its wait time, or before requested CI has finished. Required approvals must
24-
already be in place. The commit queue does not request CI on its own.
23+
its wait time. Required approvals must already be in place, and any required
24+
CI must have completed successfully. The commit queue does not request CI on
25+
its own.
2526
2. On each scheduled run, the queue builds a candidate list from open pull
26-
requests with the `commit-queue` label and without the `blocked` label. The
27-
workflow uses a five-minute cron, but GitHub Actions scheduled workflows are
28-
not guaranteed to run exactly every five minutes. For each candidate, the
29-
queue will:
27+
requests with the `commit-queue` label and without the `blocked` label. A
28+
candidate must also either have been created at least two days earlier or
29+
have the `fast-track` label. Other labeled pull requests retain the label
30+
until they become old enough or are fast-tracked. The workflow uses a
31+
five-minute cron, but GitHub Actions scheduled workflows are not guaranteed
32+
to run exactly every five minutes. For each candidate, the queue will:
3033
1. In the landing job, install and configure `@node-core/utils`, then run a
3134
metadata-only readiness check without checking out the repository
3235
2. If the metadata check exits with a deferrable readiness code, meaning
3336
the PR is only blocked on wait time, keep the `commit-queue` label and
3437
skip this PR until a later queue run
35-
3. Check if the PR also has a `request-ci` label (if it has, skip this PR
36-
since it's pending a CI run)
37-
4. Check whether GitHub checks are still running (if they are, skip this PR)
38-
5. Remove the `commit-queue` label and run `git node land`
39-
6. If it fails:
40-
1. Add the `commit-queue-failed` label to the PR
38+
3. Run `git node land` for ready PRs and PRs with hard or mixed readiness
39+
failures, keeping the `commit-queue` label in place during the attempt
40+
4. If it fails:
41+
1. Replace the `commit-queue` label with the `commit-queue-failed` label
4142
2. Leave a comment on the PR with the output from `git node land`
4243
3. Abort the `git node land` session. If the abort succeeds, continue to
4344
the next PR; otherwise, stop the queue in an unknown state
44-
7. If it succeeds:
45+
5. If it succeeds:
4546
1. Push or merge the changes into nodejs/node
4647
2. Leave a comment on the PR with `Landed in ...`
4748
3. Close the PR
48-
4. Go to next PR in the queue
49+
4. Remove the `commit-queue` label
50+
5. Go to next PR in the queue
4951

5052
To make the Commit Queue squash all the commits of a pull request into the
5153
first one, add the `commit-queue-squash` label.
@@ -94,11 +96,11 @@ reasons:
9496
without rebasing them first.
9597

9698
The workflow starts with a small candidate job that uses GitHub CLI to fetch
97-
pull requests with the `commit-queue` label. It first fetches the same
98-
age-based and fast-track buckets the queue used before accepting early queue
99-
requests, then fetches the broader queue and de-duplicates the result. This
100-
keeps not-yet-ready PRs from crowding out PRs that the previous query would
101-
have selected if GitHub paginates or caps a query result.
99+
open pull requests with the `commit-queue` label and without the `blocked`
100+
label. It fetches two buckets: pull requests created at least two days earlier
101+
and pull requests with the `fast-track` label. The job de-duplicates the
102+
buckets before passing the candidates to the landing job. Pull requests in
103+
neither bucket remain labeled but are not processed during that run.
102104

103105
If there are candidate PRs, the landing job installs and configures
104106
`@node-core/utils` once with a personal token and a Jenkins token from
@@ -123,9 +125,10 @@ states. Unknown filter failures fail the workflow before starting the landing
123125
script and leave PR labels unchanged so the queue can retry on a later
124126
scheduled run. PRs passed through with exit code `40`-`49` continue through
125127
`commit-queue.sh`. The workflow checks out the repository only when at least
126-
one PR remains after filtering. The script still applies its existing
127-
`request-ci` and pending-check deferrals before removing the queue label and
128-
reporting a hard failure.
128+
one PR remains after filtering. The script does not separately skip PRs with a
129+
`request-ci` label or pending GitHub checks. Instead, `git node land` performs
130+
the landing checks and the script reports any failure through the normal queue
131+
failure path.
129132

130133
> The personal token needs permission for public repositories and to read
131134
> profiles. It is used by `@node-core/utils` and by the landing job for
@@ -139,18 +142,20 @@ reporting a hard failure.
139142
3. Every positional argument starting at this one will be a pull request ID of
140143
a pull request with commit-queue set.
141144

142-
The script will iterate over the pull requests. GitHub CLI is used to check if
143-
the PR is waiting for CI to start (`request-ci` label) or still has pending
144-
GitHub checks. The PR is skipped if CI is pending. No other CI validation is
145-
done here since `git node land` will fail if the last CI failed.
146-
147-
The script removes the `commit-queue` label, then runs `git node land`,
148-
forwarding stdout and stderr to a file. PRs that are only blocked on wait time
149-
should have already been filtered by the metadata check. If a hard readiness
150-
failure appears between the metadata filter and `git node land`, the landing
151-
job adds a `commit-queue-failed` label to the PR, leaves a comment with the
152-
output of `git node land`, and then aborts the landing session. If the abort
153-
fails, the queue stops instead of continuing in an unknown state.
145+
The script iterates over the pull requests. For each PR, it uses GitHub CLI to
146+
fetch the labels and select the multiple-commit policy, then runs
147+
`git node land`, forwarding stdout and stderr to a file. It does not perform a
148+
separate CI preflight; `git node land` performs the current readiness and CI
149+
validation.
150+
151+
The script keeps the `commit-queue` label in place while `git node land` is
152+
running. PRs that are only blocked on wait time should have already been
153+
filtered by the metadata check. A hard or mixed readiness failure is passed
154+
through so `git node land` can produce the failure output. If the landing
155+
attempt fails for that or any other reason, the job replaces the
156+
`commit-queue` label with `commit-queue-failed`, leaves a comment with the
157+
output, and then aborts the landing session. If the abort fails, the queue
158+
stops instead of continuing in an unknown state.
154159

155160
Fast-tracked PRs use the metadata check before checkout and the landing script.
156161
If the fast-track request has not yet received enough collaborator thumbs-up,
@@ -164,8 +169,8 @@ If no errors happen during `git node land`, the script either pushes the direct
164169
rebase landing to `main` or uses GitHub's squash merge API for single-commit and
165170
fixup landings. It then leaves a `Landed in ...` comment in the PR. GitHub
166171
closes PRs merged through the merge API automatically; for direct pushes, the
167-
script closes the PR. Iteration continues until all PRs have done the steps
168-
above.
172+
script closes the PR. The script then removes the `commit-queue` label.
173+
Iteration continues until all PRs have done the steps above.
169174

170175
## Reverting broken commits
171176

0 commit comments

Comments
Β (0)