Project

General

Profile

HOWTO backport commits » History » Version 8

Loïc Dachary, 04/02/2015 04:34 PM

1 1 Loïc Dachary
h3. Backport issues
2
3 8 Loïc Dachary
* Pick one entry with the highest *Severity* field in the list of issues linked from [[the top level page|HOWTO]] (for instance "firefly issues":http://tracker.ceph.com/projects/ceph/issues?query_id=75) and look for more information about it in the inventory page (for instance the "firefly inventory page":http://workbench.dachary.org/ceph/ceph-backports/wikis/firefly#issues-that-need-backporting not only shows issues but also discovers pull requests, commits and backports to other stable branches).
4 7 Loïc Dachary
* git clone a fork of http://github.com/ceph/ceph
5 1 Loïc Dachary
* git cherry-pick -x the commits from the pull request that was targeting master (not from the pull requests targeting stable branches)
6 7 Loïc Dachary
<pre>
7
redmine_key=b586c588d4333
8
github_token=bc275830c635
9
issue=$1
10
component=rgw
11
# can't seem to extract the release number with the api
12
release=giant ; release_number=2
13
release=firefly ; release_number=3
14
git checkout -b wip-$issue-$release origin/$release
15
git cherry-pick -x .....
16
git push origin wip-$issue-$release ; sleep 2 # let github catch up
17
eval title=$(curl --silent 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key | jq .issue.subject) ; echo $title
18
number=$(curl --silent --data-binary '{"title":"'"$title"'","head":"dachary:wip-'$issue-$release'","base":"'$release'","body":"http://tracker.ceph.com/issues/'$issue'"}' 'https://api.github.com/repos/ceph/ceph/pulls?access_token='$github_token | jq .number)
19
component=core ; curl --silent --data-binary '{"milestone":"'$release_number'","assignee":"dachary","labels":["bug fix","'$component'"]}' 'https://api.github.com/repos/ceph/ceph/issues/'$number'?access_token='$github_token
20
firefox https://github.com/ceph/ceph/pull/$number
21
curl --verbose -X PUT --header 'Content-type: application/json' --data-binary '{"issue":{"notes":"* '$release' backport https://github.com/ceph/ceph/pull/'$number'"}}' 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key
22
firefox http://tracker.ceph.com/issues/$issue
23
</pre>
24 2 Loïc Dachary
* if there is a conflict explain how it was resolved in the commit message, below the Conflicts line. For instance:
25
<pre>
26
commit c60da2f3c34e7325c748d2d6e55140a0a30013fd
27
Author: Samuel Just <sjust@redhat.com>
28
Date:   Thu Nov 20 15:15:08 2014 -0800
29
30
    PGLog: include rollback_info_trimmed_to in (read|write)_log
31
    
32
    Fixes: #10157
33
    Backport: firefly, giant
34
    Signed-off-by: Samuel Just <sjust@redhat.com>
35
    (cherry picked from commit 1fe8b846641486cc294fe7e1d2450132c38d2dba)
36
    
37
    Conflicts:
38
    	src/osd/PGLog.cc
39
            in the context coll_t::META_COLL was replaced with META_COLL
40
</pre>
41
* if the conflict is difficult to resolve, seek help from the author of the original commit (see "librbd: deadlock in image refresh":https://github.com/ceph/ceph/pull/4176 for instance)
42
* create a pull request with the backport and a URL to the issue and set the milestone to giant
43
* add the URL of the pull request in the issue
44 1 Loïc Dachary
* if the make check bot finds a problem, fix it
45 6 Loïc Dachary
* assign the pull request to the [[HOWTO#Leads|lead]] after it passed [[HOWTO run integration and upgrade tests|integration and upgrade tests]]
46 3 Loïc Dachary
47 5 Loïc Dachary
All commits being backported must be cherry-picked from master. There are exceptions to this rule (see https://github.com/ceph/ceph/pull/4175 for instance: it fixes a regression introduced by an incorrect resolution of a backport) but they are rare. When a backport is done to fix a bug that shows in the integration tests or upgrade tests run by cron, testing the backport in an integration branch is redundant because the existing tests will keep failing.