From: Nathan Cutler Date: Mon, 23 Mar 2020 15:46:02 +0000 (+0100) Subject: script/ceph-backport.sh: set target_branch in API case X-Git-Tag: v16.1.0~2825^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6f8129f4da7dc8f883a8898bf53a68460de4dd22;p=ceph.git script/ceph-backport.sh: set target_branch in API case When we falling back to the GitHub API to determine the milestone number, we were not initializing target_branch, so the script was broken for octopus backports. Signed-off-by: Nathan Cutler --- diff --git a/src/script/ceph-backport.sh b/src/script/ceph-backport.sh index 5b969263ac64..c37821fd3ed0 100755 --- a/src/script/ceph-backport.sh +++ b/src/script/ceph-backport.sh @@ -895,7 +895,6 @@ function milestone_number_from_remote_api { local mtt="$1" # milestone to try local mn="" # milestone number local milestones - warning "Milestone ->$mtt<- unknown to script - falling back to GitHub API" remote_api_output=$(curl -u ${github_user}:${github_token} --silent -X GET "https://api.github.com/repos/ceph/ceph/milestones") mn=$(echo "$remote_api_output" | jq --arg milestone "$mtt" '.[] | select(.title==$milestone) | .number') if [ "$mn" -gt "0" ] >/dev/null 2>&1 ; then @@ -1620,10 +1619,12 @@ fi milestone_number=$(try_known_milestones "$milestone") if [ "$milestone_number" -gt "0" ] >/dev/null 2>&1 ; then - target_branch="$milestone" + debug "Milestone ->$milestone<- is known to have number ->$milestone_number<-: skipping remote API call" else + warning "Milestone ->$milestone<- is unknown to the script: falling back to GitHub API" milestone_number=$(milestone_number_from_remote_api "$milestone") fi +target_branch="$milestone" info "milestone/release is $milestone" debug "milestone number is $milestone_number"