From 3cc188b5928ec1929aa544849e132ec0d9f83241 Mon Sep 17 00:00:00 2001 From: Denys Otrishko Date: Wed, 16 Sep 2020 10:51:30 +0300 Subject: [PATCH 1/2] build: fix landed message for multiple commits in commit-queue --- tools/actions/commit-queue.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index 028297217469a0..432e1299f416b5 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -7,6 +7,9 @@ REPOSITORY=$2 GITHUB_TOKEN=$3 shift 3 +UPSTREAM=origin +DEFAULT_BRANCH=master + API_URL=https://api.github.com COMMIT_QUEUE_LABEL='commit-queue' COMMIT_QUEUE_FAILED_LABEL='commit-queue-failed' @@ -76,9 +79,10 @@ for pr in "$@"; do git node land --abort --yes else rm output - git push origin master + git push $UPSTREAM $DEFAULT_BRANCH - gitHubCurl "$(commentsUrl "$pr")" POST --data '{"body": "Landed in '"$(git rev-parse HEAD)"'"}' + commits="$(git merge-base $UPSTREAM/$DEFAULT_BRANCH HEAD)...$(git rev-parse HEAD)" + gitHubCurl "$(commentsUrl "$pr")" POST --data '{"body": "Landed in '"$commits"'"}' gitHubCurl "$(issueUrl "$pr")" PATCH --data '{"state": "closed"}' fi From 10a2f5b1803a2734e7e2c82e6317ad64fa526298 Mon Sep 17 00:00:00 2001 From: Denys Otrishko Date: Wed, 16 Sep 2020 11:00:21 +0300 Subject: [PATCH 2/2] fixup! build: fix landed message for multiple commits in commit-queue --- tools/actions/commit-queue.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/actions/commit-queue.sh b/tools/actions/commit-queue.sh index 432e1299f416b5..e473b9e60d4ae8 100755 --- a/tools/actions/commit-queue.sh +++ b/tools/actions/commit-queue.sh @@ -79,9 +79,11 @@ for pr in "$@"; do git node land --abort --yes else rm output + + commits="$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH)...$(git rev-parse HEAD)" + git push $UPSTREAM $DEFAULT_BRANCH - commits="$(git merge-base $UPSTREAM/$DEFAULT_BRANCH HEAD)...$(git rev-parse HEAD)" gitHubCurl "$(commentsUrl "$pr")" POST --data '{"body": "Landed in '"$commits"'"}' gitHubCurl "$(issueUrl "$pr")" PATCH --data '{"state": "closed"}'