B2G/Gaia Uplifting

From MozillaWiki
< B2G
Jump to: navigation, search

Background

In support of Firefox OS version 1.0.1 and 1.1, we used a branching strategy where there was a master branch which represented the next major version and two release branches (v1.0.1 and v1-train, respectively) that represented their matching versions. There was also a closely related v1.1.0hd branch, which had most of the contents of v1-train. We cherry picked commits from master to v1-train or from master to v1-train then v1.0.1 as requested by release drivers.

John Ford wrote some tooling to minimize the human time involved.

Installation

This program is written in Python and uses PyPi to install dependencies. A virtualenv is highly recommended.

Create a virtualenv (this is done once, at the beginning):

sudo pip install virtualenv # Or sudo easy-install virtualenv if that fails
git clone git@github.com:jhford/uplift.git gaia-uplifting
cd gaia-uplifting
virtualenv .
source bin/activate
python setup.py develop # Instead of install, so updating from git will go live instantly

Each time you want to do uplifing or merging, you need to set up your environment:

cd gaia-uplifting
source bin/activate

You'll need to have a file that has your Bugzilla credentials in your home directory. The file needs to be a json file with a single dict containing a username and password key, each with the corresponding value as a string

{
    "username": "your_bugzilla@email.com",
    "password": "password1234"
}

Doing an uplift

I don't want to write documentation for this right now. It's longer and more complicated and hopefully going away soon, but the important commands are:

uplift show # Gather information about bugs to uplift
uplift uplift # As above, then do the work
uplift comments # Will redo commenting/flag setting if push failed.  caution: it'll double comment without prompting

Note: There are many, many, caveats to this program. It's grown up from a quick and dirty script that did practically nothing before, so please keep in mind that sometimes it does weird things.

Doing a merge

This is a lot easier than doing a normal uplift.

The first thing you'll want to do is attempt the merge:

uplift merge <dst_branch> <src_branch>

e.g.

uplift merge v1.1.0hd v1-train

If this passes, it'll ask if you want to push, then will comment on the bugs. If the push or merge fails, you can initiate the commenting by running:

uplift merge-comments <dst_branch> <start>..<end>

e.g.

uplift merge-comments v1.1.0hd abcd123..dcba321

When doing the commenting, the tool will scan the commits in that commit range. If only one bug number is found, it will ask a yes/no question whether or not you want to use it. If there is more than one bug number found, it will present a list of those bugs and ask which to use.

Once all the commits have been gone through, the tool will start commenting and setting flags on the bugs