From eda7c827314de9e612926c57a2c36ce21d1cc0d7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 7 Aug 2026 12:32:07 +0200 Subject: [PATCH] tools: delay removal of `commit-queue` label The removes the possiblity for a PR to drop from the queue if the CQ job is cancelled (or times out) in the middle of handling a PR. This increases the window for two concurrent CQ jobs to pick up the same PR, but that's an unlikely scenario. Signed-off-by: Antoine du Hamel --- tools/actions/commit-queue.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index aa63a442377a..b6e62139d626 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -15,7 +15,7 @@ COMMIT_QUEUE_FAILED_LABEL="commit-queue-failed" commit_queue_failed() { pr=$1 - gh pr edit "$pr" --add-label "${COMMIT_QUEUE_FAILED_LABEL}" + gh pr edit "$pr" --add-label "${COMMIT_QUEUE_FAILED_LABEL}" --remove-label "${COMMIT_QUEUE_LABEL}" # shellcheck disable=SC2154 cqurl="${GITHUB_SERVER_URL}/${OWNER}/${REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" @@ -47,9 +47,6 @@ for pr in "$@"; do continue fi - # Delete the commit queue label - gh pr edit "$pr" --remove-label "$COMMIT_QUEUE_LABEL" - if jq -e 'map(.name) | index("commit-queue-squash")' < labels.json; then MULTIPLE_COMMIT_POLICY="--fixupAll" elif jq -e 'map(.name) | index("commit-queue-rebase")' < labels.json; then @@ -114,6 +111,9 @@ for pr in "$@"; do gh pr comment "$pr" --body "Landed in $commits" [ -z "$MULTIPLE_COMMIT_POLICY" ] && gh pr close "$pr" + + # Delete the commit queue label (but ignore errors, it's no big deal if a closed PR still has the label) + gh pr edit "$pr" --remove-label "$COMMIT_QUEUE_LABEL" || true done rm -f labels.json