Project

General

Profile

Actions

HOWTO backport commits » History » Revision 9

« Previous | Revision 9/52 (diff) | Next »
Loïc Dachary, 04/02/2015 04:38 PM


Backport issues

  • Pick one entry with the highest Severity field in the list of issues linked from the top level page (for instance firefly issues) and look for more information about it in the inventory page (for instance the firefly inventory page 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.
  • git clone a fork of http://github.com/ceph/ceph
  • git cherry-pick -x the commits from the pull request that was targeting master (not from the pull requests targeting stable branches)
    redmine_key=b586c588d4333
    github_token=bc275830c635
    issue=$1
    component=rgw
    # can't seem to extract the release number with the api
    release=giant ; release_number=2
    release=firefly ; release_number=3
    git checkout -b wip-$issue-$release origin/$release
    git cherry-pick -x .....
    git push origin wip-$issue-$release ; sleep 2 # let github catch up
    eval title=$(curl --silent 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key | jq .issue.subject) ; echo $title
    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)
    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
    firefox https://github.com/ceph/ceph/pull/$number
    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
    firefox http://tracker.ceph.com/issues/$issue
    
  • if there is a conflict explain how it was resolved in the commit message, below the Conflicts line. For instance:
    commit c60da2f3c34e7325c748d2d6e55140a0a30013fd
    Author: Samuel Just <sjust@redhat.com>
    Date:   Thu Nov 20 15:15:08 2014 -0800
    
        PGLog: include rollback_info_trimmed_to in (read|write)_log
    
        Fixes: #10157
        Backport: firefly, giant
        Signed-off-by: Samuel Just <sjust@redhat.com>
        (cherry picked from commit 1fe8b846641486cc294fe7e1d2450132c38d2dba)
    
        Conflicts:
            src/osd/PGLog.cc
                in the context coll_t::META_COLL was replaced with META_COLL
    
  • if the conflict is difficult to resolve, seek help from the author of the original commit (see librbd: deadlock in image refresh for instance)
  • create a pull request with the backport and a URL to the issue and set the milestone to giant
  • add the URL of the pull request in the issue
  • if the make check bot finds a problem, fix it
  • assign the pull request to the lead after it passed integration and upgrade tests

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.

Updated by Loïc Dachary about 9 years ago · 9 revisions