Bugzilla:Migrating to git: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 33: Line 33:
Pre-migration:
Pre-migration:


# fast-export translation script to preserve bug ID metadata.
# (DONE) fast-export translation script to preserve bug ID metadata.
# git2bzr script to keep bzr in sync with git.
# (DONE) git-to-bzr.pl script to keep bzr in sync with git.
# Write migration instructions similar to https://wiki.mozilla.org/Bugzilla:Moving_From_CVS_To_Bazaar
# Write migration instructions similar to https://wiki.mozilla.org/Bugzilla:Moving_From_CVS_To_Bazaar
# Set up repos (bugzilla and bmo) on git.mozilla.org.
# Set up repos (bugzilla and bmo) on git.mozilla.org.
Line 48: Line 48:
# Perform fast-import/-export migration on all (supported) branches of bugzilla and bmo.
# Perform fast-import/-export migration on all (supported) branches of bugzilla and bmo.
# Commit .gitrev to bzr containing the ID of the last git commit.
# Commit .gitrev to bzr containing the ID of the last git commit.
# Enable travis-ci
 
Soon after:
 
# Enable travis-ci (should be okay to keep using tinderbox with the changes mirrored from git to bzr for a while, yes?).


Eventually:
Eventually:
Line 54: Line 57:
# Turn off tinderbox when we are sure that the test results from travis-ci and tinderbox match.
# Turn off tinderbox when we are sure that the test results from travis-ci and tinderbox match.
# Turn off bzr.
# Turn off bzr.
Migration scripts are in a [https://github.com/markrcote/bugzilla-git-migration GitHub repo].

Revision as of 19:40, 7 January 2014

It has been proposed to move the Bugzilla source from bzr.mozilla.org to git.mozilla.org with a read-only mirror on GitHub.

Rationale

There's no single killer reason to move to git; however, there are a handful of benefits:

  • git is pretty much the de facto standard for VCSs these days. This means many people are familiar with it and like its flexibility.
  • On the other side, Bazaar is almost dead. There are maybe 2-3 commits to trunk every month. The time to fix bugs in Bazaar also seems to be quite long, generally.
  • GitHub is extremely popular, and for good reason, since it's a very powerful system. Exposure via GitHub could mean increased contributions (whether we can keep up with them or not is, of course, another question).
  • Mozilla would very much like to retire Tinderbox, since Bugzilla is the only system still using it. Moving to GitHub means we could use travis-ci, which is really nice.
  • Mozilla would also very much like to retire the Bazaar server, which is used only for Bugzilla.

Limitations

After the migration, the git repo will be the repo of record, that is, while the bzr repo will be maintained, it will be read-only. Similarly, there will be a one-way mirror to GitHub. Users will be able to fork the project, but they will have to push to git.mozilla.org, which in turn will push the changes to GitHub.

Doing a one-time export using bzr fast-export and git fast-import is fairly straightforward. It just requires a bit of translation to preserve commit metadata, which git doesn't support. This is pretty much just the bug ID.

Keeping the two repos in sync, however, is a bit trickier. The bzr-git plugin looked like a good solution but in fact can't automatically pull recent changes from git and apply them to bzr. Launchpad can mirror projects from GitHub, but it is still a manual process and not at all suited for the number of branches Bugzilla uses.

Luckily there is already a script that is currently used to do the bzr-cvs one-way mirror. We can create a new script based on this to copy changes from git to bzr.

It was originally proposed to keep the bzr repo going for only another 9 months, but it was also suggested that we keep it running until all current versions (up to 4.4) are EOLed, since the suggested upgrade path is to pull changes directly from the repo, rather than applying a tarball or diff. However, we do publish tarballs and diffs, so this is about convenience in upgrades, since it is always possible to upgrade via tarball or diff.

Plan

There are a bunch of things we'll need to do to complete this. Some can be done in parallel.

Pre-migration:

  1. (DONE) fast-export translation script to preserve bug ID metadata.
  2. (DONE) git-to-bzr.pl script to keep bzr in sync with git.
  3. Write migration instructions similar to https://wiki.mozilla.org/Bugzilla:Moving_From_CVS_To_Bazaar
  4. Set up repos (bugzilla and bmo) on git.mozilla.org.
  5. Set up repos on GitHub and configure git.m.o repos to mirror there.
  6. Determine which branches should be migrated over (presumably all, but there might be obsolete branches) and estimate how long this will take.
  7. Set up a travis-ci instance with a test migration to GitHub.
  8. Do a trial migration.
  9. Announce date for migration.

Migration:

  1. Disallow commits to bzr aside from those originating from the git2bzr script.
  2. Perform fast-import/-export migration on all (supported) branches of bugzilla and bmo.
  3. Commit .gitrev to bzr containing the ID of the last git commit.

Soon after:

  1. Enable travis-ci (should be okay to keep using tinderbox with the changes mirrored from git to bzr for a while, yes?).

Eventually:

  1. Turn off tinderbox when we are sure that the test results from travis-ci and tinderbox match.
  2. Turn off bzr.

Migration scripts are in a GitHub repo.