HOWTO backport commits » History » Version 10
Loïc Dachary, 04/08/2015 09:14 AM
1 | 1 | Loïc Dachary | h3. Backport issues |
---|---|---|---|
2 | |||
3 | 9 | Loïc Dachary | * Pick one entry with the highest *Severity* field in the list of issues linked from [[HOWTO|the top level page]] (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). Note that *Severity* is different from *Priority*. *Severity* is not used while working on the bug, it's used to prioritize backports only. An issue marked with a high *Priority* may not need to be backported with the same priority. |
4 | 7 | Loïc Dachary | * git clone a fork of http://github.com/ceph/ceph |
5 | 10 | Loïc Dachary | * *git checkout -b wip-$issue-$release origin/$release* to create a branch with a name that reflects the issue being fixed and the target release: this naming is convenient to select all branches containing backports for firefly or select all branches containing backports for a specific issue |
6 | 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) |
7 | 10 | Loïc Dachary | * *git push origin wip-$issue-$release* to publish the branch on github and be able to create a pull request from it |
8 | * create a pull request from the *wip-$issue-$release* branch with the same title as the issue |
||
9 | 7 | Loïc Dachary | <pre> |
10 | 10 | Loïc Dachary | account=myaccount |
11 | 7 | Loïc Dachary | eval title=$(curl --silent 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key | jq .issue.subject) ; echo $title |
12 | 10 | Loïc Dachary | number=$(curl --silent --data-binary '{"title":"'"$title"'","head":"'$account':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) |
13 | </pre> |
||
14 | * assigned the pull request to yourself (because it needs to got through integration tests before it can be approved by the original author), add the relevant labels (rgw, core, bug fix, feature...) and set the milestone to $release |
||
15 | <pre> |
||
16 | component=core ; curl --silent --data-binary '{"milestone":"'$release_number'","assignee":"'$account'","labels":["bug fix","'$component'"]}' 'https://api.github.com/repos/ceph/ceph/issues/'$number'?access_token='$github_token |
||
17 | </pre> |
||
18 | * wait for the make check bot to run the *run-make-check.sh* script on the branch that was pushed and verify it works |
||
19 | * Add a link to the pull request in the issue formatted as follows : *$release backport URL to the pull request* |
||
20 | <pre> |
||
21 | 7 | Loïc Dachary | 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 | 2 | Loïc Dachary | </pre> |
23 | * if there is a conflict explain how it was resolved in the commit message, below the Conflicts line. For instance: |
||
24 | <pre> |
||
25 | commit c60da2f3c34e7325c748d2d6e55140a0a30013fd |
||
26 | Author: Samuel Just <sjust@redhat.com> |
||
27 | Date: Thu Nov 20 15:15:08 2014 -0800 |
||
28 | 1 | Loïc Dachary | |
29 | PGLog: include rollback_info_trimmed_to in (read|write)_log |
||
30 | |||
31 | Fixes: #10157 |
||
32 | Backport: firefly, giant |
||
33 | Signed-off-by: Samuel Just <sjust@redhat.com> |
||
34 | (cherry picked from commit 1fe8b846641486cc294fe7e1d2450132c38d2dba) |
||
35 | |||
36 | Conflicts: |
||
37 | src/osd/PGLog.cc |
||
38 | in the context coll_t::META_COLL was replaced with META_COLL |
||
39 | </pre> |
||
40 | * 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) |
||
41 | * assign the pull request to the [[HOWTO#Leads|lead]] after it passed [[HOWTO run integration and upgrade tests|integration and upgrade tests]] |
||
42 | |||
43 | 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. |
||
44 | 10 | Loïc Dachary | |
45 | |||
46 | Here are the snippets above groupped together for easier copy/paste: |
||
47 | <pre> |
||
48 | redmine_key=b586c588d4333 |
||
49 | github_token=bc275830c635 |
||
50 | issue=$1 |
||
51 | component=rgw |
||
52 | # can't seem to extract the release number with the api |
||
53 | release=giant ; release_number=2 |
||
54 | release=firefly ; release_number=3 |
||
55 | git checkout -b wip-$issue-$release origin/$release |
||
56 | git cherry-pick -x ..... |
||
57 | git push origin wip-$issue-$release ; sleep 2 # let github catch up |
||
58 | eval title=$(curl --silent 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key | jq .issue.subject) ; echo $title |
||
59 | 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) |
||
60 | 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 |
||
61 | firefox https://github.com/ceph/ceph/pull/$number |
||
62 | 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 |
||
63 | firefox http://tracker.ceph.com/issues/$issue |
||
64 | </pre> |