ConvertingToGit

Initial conversion

Support for flavor seeds being managed in Git-based repositories rather than Bazaar-based repositories has landed in the Ubuntu cdimage tooling in early January of 2018. These are the steps you can follow to convert your flavor from using the old style Bazaar branches to a completely Git-based workflow.

This guide assumes that you represent an active, recognized Ubuntu flavor and your team agrees that this is the way to go. It also assumes that you have the necessary tools installed to build your respective flavor metapackage from source and work with tools like Git and Bazaar.

NOTE - Ensure that both bzr and git-remote-bzr have been installed.

Here are the steps you can follow:

  1. Convert each of your Bazaar branches to one single branch in a Git repository. It makes things easier if you use a tool like git-remote-bzr so you can use a script like the following (which uses Lubuntu's seeds as an example, you should change this to fit your own needs):

    flavor=lubuntu; for i in <SUPPORTED RELEASES>; do
        git clone bzr::lp:~$flavor-dev/ubuntu-seeds/$flavor.$i $flavor.$i
        (cd $flavor.$i && git checkout -b $i && git push git+ssh://launchpad-id@git.launchpad.net/~$flavor-dev/ubuntu-seeds/+git/$flavor $i);
    done

    Please note that if your Bazaar branch was located at lp:~lubuntu-dev/ubuntu-seeds/lubuntu.bionic (for example) you need to keep the same Launchpad team (so that you have the same access rights), the same project (so that people can easily propose to merge requests into your seed and it shows up on the central seeds page), and it needs to be just the name of the flavor without a .RELEASE suffix. So the new Git branch for lp:~lubuntu-dev/ubuntu-seeds/lubuntu.bionic would now be located at lp:~lubuntu-dev/ubuntu-seeds/+git/lubuntu with the bionic branch existing there.

  2. In the Launchpad web interface (i.e. https://code.launchpad.net/~lubuntu-dev/ubuntu-seeds/+git/lubuntu/ - you can find this in Change repository details), change the default branch on the newly created Git repository to the current development release (for example, refs/heads/bionic).

  3. In your metapackage source, in the update script, where it says exec germinate-update-metapackage --bzr, change it to exec germinate-update-metapackage --vcs ; this is so germinate-update-metapackage can autodetect the VCS being used, so when we make a change to update.cfg in the next step, you can have both Git and Bazaar branches working.

  4. In your update.cfg file, where it has these two lines (Lubuntu's change to the Bionic metapackage is used as an example here, modify to your needs):

    [bionic/bzr]
    seed_base: bzr+ssh://bazaar.launchpad.net/~lubuntu-dev/ubuntu-seeds/ bzr+ssh://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/

    You then need to convert the first of these lines to say vcs and the second line to have the location for your new seed:

    [bionic/vcs]
    seed_base: git+ssh://git.launchpad.net/~lubuntu-dev/ubuntu-seeds/+git/ bzr+ssh://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/

    You don't need to modify anything else in your metapackage, because germinate-update-metapackage should automatically detect the correct branch and VCS to use, and clone appropriately.

  5. Run ./update for good measure, and make sure it completes the update process successfully.

  6. Upload your metapackage to the development release (and in the rare case that your metapackage needs an SRU, make sure to make these changes there as well). Make sure it lands in devel before continuing to minimize disruption.

  7. Clone lp:ubuntu-archive-scripts, and propose an MP that changes update-seeds to reflect your new URL and pass the git="yes" argument (like in Lubuntu's lines).

  8. After landing the changes to lp:ubuntu-archive-scripts, ask the ubuntu-archive team to remove the existing bzr checkouts on snakefruit and re-run update-seeds.
  9. Clone the lp:ubuntu-cdimage source, either by running bzr branch lp:ubuntu-cdimage or if you use the example above, git clone bzr::lp:ubuntu-cdimage.

  10. There is a seed_sources function in lib/cdimage/germinate.py that lists the Germinate sources for each flavor. Assuming you correctly followed the naming convention that was listed above, finding your flavor and changing bzrpattern to gitpattern should be sufficient. Also, be sure to fix the tests, as described here.

  11. Propose an MP to lp:ubuntu-cdimage with your changes, and once this is approved, ask someone with access to nusakan to make the appropriate change there. Once this merge proposal is approved and nusakan changes are made, your flavor ISO uses the Git branch instead of the Bazaar one, and you can now delete the Bazaar one.

  12. For each supported release that you converted over, you should delete the Bazaar one, assuming that there are identical commits in the Git repository. This is so that nobody is mistaken and uses your Bazaar branch by accident, and only uses the Git repository (and there should be no use for the Bazaar branch anyway if you did everything correctly). Note that deleting the bzr branches also deletes MP history; if you wish to preserve this history you may wish to set your branch status to 'Abandoned' in Launchpad but keep the branches.

Congratulations! Your seed is now in Git. The archive tooling should now seamlessly pick up this change, and future development releases will be created automatically in this Git repository.

Deprecating releases

If you want to avoid clutter in your new Git repository, you could (optionally) move the branch for a specific release to another repository entirely. Here's a script that makes it easy, edit the variables at the top for the release you want to deprecate:

REPOPATH="lubuntu"
RELEASE="zesty"
REMOTE="git+ssh://git.launchpad.net/~lubuntu-dev/ubuntu-seeds/+git/lubuntu"

git -C $REPOPATH checkout $RELEASE
git -C $REPOPATH push "$REMOTE" ":$RELEASE"
git -C $REPOPATH push "${REMOTE}.deprecated"

Feedback

If you have any comments or suggestions about this page or you run into any issues, contact Simon Quigley.

Germinate/ConvertingToGit (last edited 2018-05-31 20:04:15 by tsimonq2)