Project

General

Profile

HOWTO resolve issues that are Pending Backport » History » Version 4

Loïc Dachary, 03/26/2015 05:05 PM

1 1 Loïc Dachary
Issues in the state *Pending Backport* can be updated to *Resolved* as follows:
2
3 4 Loïc Dachary
* Visit the list of issues [[marked for the release|http://tracker.ceph.com/projects/ceph-releases/wiki/HOWTO#Overview-of-the-backports-in-progress]]
4
* git clone ceph
5
* Find one commit hash that needs backporting (select the most relevant one if there are more than one) and run
6
<pre>
7
$ cat > ../verify-backport.sh <<EOF
8
commit=$1
9
git log --oneline --all --grep "cherry picked from commit $commit" | sed -e 's/"/ /g' | while read h message ; do echo -n "commit:$h $message (in" ; git branch --contains $h | grep -E '^\s+(dumpling|firefly|giant|hammer)$' | perl -pe 's/\n//' ; echo -n '), ' ; done  ; echo
10
EOF
11
$ commit=5ba9b8f21f8010c59dd84a0ef2acfec99e4b048f ; bash ../verify-backport.sh $commit
12
commit:e00270b rados.py: remove Rados.__del__(); it just causes problems (in  firefly), commit:ed8c9af rados.py: remove Rados.__del__(); it just causes problems (in  giant), 
13
</pre>
14
* If the list of branches in which commits cherry-picking the commit from master matches the list of branches in the *Backport* field, the issue can be marked as *Resolved* with the following (where redmine_key is the API key found in the user page of the redmine account used for backporting):
15
<pre>
16
$ cat > ../resolve-backport.sh <<EOF
17
issue=$1
18
commit=$2
19
redmine_key=$3
20
backported=$(bash ../verify-backport.sh $commit)
21
curl --verbose -X PUT --header 'Content-type: application/json' --data-binary '{"issue":{"notes":"'"$backported"'"}}' 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key
22
resolved_id=$(curl --silent http://tracker.ceph.com/issue_statuses.json | jq '.issue_statuses[] | select(.name=="Resolved") | .id')
23
curl --verbose -X PUT --header 'Content-type: application/json' --data-binary '{"issue":{"status_id":"'$resolved_id'"}}' 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key
24
firefox http://tracker.ceph.com/issues/$issue
25
EOF
26
$ bash ../resolve-backport.sh 8797 $commit $redmine_key
27
</pre>