diff --git a/doc/guides/commit-queue.md b/doc/guides/commit-queue.md index dec153196ea30e..edb9c7ad4a877f 100644 --- a/doc/guides/commit-queue.md +++ b/doc/guides/commit-queue.md @@ -25,7 +25,7 @@ From a high-level, the Commit Queue works as follow: 2. Check if the last Jenkins CI is finished running (if it is not, skip this PR) 3. Remove the `commit-queue` label - 4. Run `git node land ` + 4. Run `git node land --oneCommitMax` 5. If it fails: 1. Abort `git node land` session 2. Add `commit-queue-failed` label to the PR @@ -37,6 +37,12 @@ From a high-level, the Commit Queue works as follow: 3. Close the PR 4. Go to next PR in the queue +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. + ## Current limitations The Commit Queue feature is still in early stages, and as such it might not diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index 22f306cc36b684..7272c71b4db0ac 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -70,7 +70,15 @@ for pr in "$@"; do # Delete the commit queue label gitHubCurl "$(labelsUrl "$pr")"/"$COMMIT_QUEUE_LABEL" DELETE - git node land --autorebase --yes "$pr" >output 2>&1 || echo "Failed to land #${pr}" + if gitHubCurl "$(labelsUrl "$pr")" GET | jq -e 'map(.name) | index("commit-queue-squash")'; then + MULTIPLE_COMMIT_POLICY="--fixupAll" + elif gitHubCurl "$(labelsUrl "$pr")" GET | jq -e 'map(.name) | index("commit-queue-rebase")'; then + MULTIPLE_COMMIT_POLICY="" + else + MULTIPLE_COMMIT_POLICY="--oneCommitMax" + fi + + git node land --autorebase --yes $MULTIPLE_COMMIT_POLICY "$pr" >output 2>&1 || echo "Failed to land #${pr}" # cat here otherwise we'll be supressing the output of git node land cat output