From b54cf5dabd550428292d17c2d0ad0c8466fbac00 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sun, 29 Mar 2026 20:42:51 +0200 Subject: [PATCH 1/2] tools: respect 7 days wait commit-queue with one approval --- tools/actions/commit-queue.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index 2ee7694aedd200..d462ad2d2ba826 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -45,6 +45,17 @@ for pr in "$@"; do continue fi + # Skip PR if it has only one approval and was created less than 7 days ago + pr_meta=$(gh pr view "$pr" --json reviews,createdAt) + approvals=$(echo "$pr_meta" | jq '[.reviews[] | select(.state == "APPROVED")] | unique_by(.author.login) | length') + created_at=$(echo "$pr_meta" | jq -r '.createdAt') + created_epoch=$(date -d "$created_at" +%s) + seven_days_ago=$(date -d "7 days ago" +%s) + if [ "$approvals" -le 1 ] && [ "$created_epoch" -gt "$seven_days_ago" ]; then + echo "pr ${pr} skipped, only one approval and created less than 7 days ago" + continue + fi + # Delete the commit queue label gh pr edit "$pr" --remove-label "$COMMIT_QUEUE_LABEL" From 83c3b3f596eae1b479c6f9b9d7a5e7e4f5849af2 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sun, 29 Mar 2026 20:50:47 +0200 Subject: [PATCH 2/2] fixup! tools: respect 7 days wait commit-queue with one approval --- tools/actions/commit-queue.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index d462ad2d2ba826..1ac60490d4b042 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -47,7 +47,7 @@ for pr in "$@"; do # Skip PR if it has only one approval and was created less than 7 days ago pr_meta=$(gh pr view "$pr" --json reviews,createdAt) - approvals=$(echo "$pr_meta" | jq '[.reviews[] | select(.state == "APPROVED")] | unique_by(.author.login) | length') + approvals=$(echo "$pr_meta" | jq '[.reviews[] | select(.state == "APPROVED" and .authorAssociation == "MEMBER")] | unique_by(.author.login) | length') created_at=$(echo "$pr_meta" | jq -r '.createdAt') created_epoch=$(date -d "$created_at" +%s) seven_days_ago=$(date -d "7 days ago" +%s)