From: Nathan Cutler Date: Wed, 23 Oct 2019 11:24:53 +0000 (+0200) Subject: ceph-backport.sh: refuse to cherry-pick from PR that isn't merged X-Git-Tag: v15.1.0~1116^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c9e40c3c8604bc29722f2b8812a529c72a3a41cb;p=ceph-ci.git ceph-backport.sh: refuse to cherry-pick from PR that isn't merged Signed-off-by: Nathan Cutler --- diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index 09e98f862ff..09585744cc5 100755 --- a/src/script/ceph-backport.sh +++ b/src/script/ceph-backport.sh @@ -123,6 +123,7 @@ function check_tracker_status { function cherry_pick_phase { local base_branch= + local merged= local number_of_commits= local offset=0 local singular_or_plural_commit= @@ -153,6 +154,13 @@ function cherry_pick_phase { info "You can still use the script to stage the backport, though. Just prepare the local branch \"${local_branch}\" manually and re-run the script." false fi + merged=$(echo ${remote_api_output} | jq -r .merged) + if [ "$merged" = "true" ] ; then + true + else + error "${original_pr_url} is not merged yet: cowardly refusing to perform automated cherry-pick" + false + fi number_of_commits=$(echo ${remote_api_output} | jq .commits) if [ "$number_of_commits" -eq "$number_of_commits" ] 2>/dev/null ; then # \$number_of_commits is set, and is an integer