← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/download-cache-git into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/download-cache-git into lp:launchpad.

Commit message:
Convert lp-source-dependencies to git.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/download-cache-git/+merge/333931

I pushed a simple "bzr fast-export | git fast-import" conversion.  As expected, the repository sizes are almost the same (830MiB for bzr, 811MiB for git), but a --depth=1 shallow clone is much smaller (178MiB).  Since shallow clones seem to work pretty well in git these days and can be deepened on demand, I took that approach.

We'll need to change buildbot's master.cfg and various bits of deployment code before we can commit to this; in the meantime, lp-source-dependencies changes should continue to go to the bzr branch, and I can keep the git import up-to-date manually.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/download-cache-git into lp:launchpad.
=== modified file 'doc/buildout.txt'
--- doc/buildout.txt	2017-05-11 15:02:41 +0000
+++ doc/buildout.txt	2017-11-18 10:02:58 +0000
@@ -175,7 +175,7 @@
 
 ::
 
-    bzr co lp:lp-source-dependencies download-cache
+    git clone --depth=1 lp:lp-source-dependencies download-cache
 
 Then run ``make`` in the trunk.
 
@@ -204,7 +204,7 @@
 cannot find a version of a dependency, do the following, from within the
 branch::
 
-    bzr up download-cache
+    git -C download-cache pull
 
 After this, retry your make (or run ``bin/buildout`` from the branch).
 
@@ -339,7 +339,7 @@
     The ``download-cache`` directory is a set of downloaded distributions--that
     is, exact copies of the items that would typically be obtained from the
     Python Package Index ("PyPI"), or another download source. We manage the
-    download cache as a shared resource across all of our developers with a bzr
+    download cache as a shared resource across all of our developers with a git
     branch in a Launchpad project called ``lp-source-dependencies``.
 
     When we run buildout, Buildout reads a special key and value in the
@@ -467,16 +467,16 @@
     are unsure.  A rule of thumb is that it's worth starting this
     investigation if the replacement has already been in use by the
     Launchpad tree for more than a month.  You can approximate this
-    information by using ``bzr log`` on the newer (replacement)
+    information by using ``git log`` on the newer (replacement)
     download-cache/dist file for the particular package.
 
 7.  Now you need to share your package changes with the rest of the
     team.  You must do this before submitting your Launchpad branch to
     PQM or else your branch will not build properly anywhere else,
     including buildbot.  Commit the changes (``cd download-cache``,
-    bzr add the needed files, ``bzr up``, ``bzr commit -m 'Add
-    lazr.foom 1.1.2 and depdendencies to the download cache'``) to the
-    shared download cache when you are sure it is what you want.
+    git add the needed files, ``git pull``, ``git commit -m 'Add
+    lazr.foom 1.1.2 and dependencies'``) to the shared download cache
+    when you are sure it is what you want.
 
 *Never* modify a package in the download-cache.  A change in code must mean a
 change in version number, or else very bad inconsistencies and

=== modified file 'utilities/rocketfuel-get'
--- utilities/rocketfuel-get	2012-01-11 13:25:48 +0000
+++ utilities/rocketfuel-get	2017-11-18 10:02:58 +0000
@@ -45,9 +45,9 @@
 # Get/update the download cache.
 if [ -d "$LP_DOWNLOAD_CACHE_PATH" ]
 then
-    bzr up "$LP_DOWNLOAD_CACHE_PATH"
+    git -C "$LP_DOWNLOAD_CACHE_PATH" pull
 else
-    bzr co lp:lp-source-dependencies "$LP_DOWNLOAD_CACHE_PATH"
+    git clone --depth=1 lp:lp-source-dependencies "$LP_DOWNLOAD_CACHE_PATH"
 fi
 
 # Add or update sourcepackages.

=== modified file 'utilities/rocketfuel-setup'
--- utilities/rocketfuel-setup	2017-01-10 17:24:08 +0000
+++ utilities/rocketfuel-setup	2017-11-18 10:02:58 +0000
@@ -195,7 +195,7 @@
 of the following steps:
 $ bzr branch lp:launchpad devel
 $ cd devel
-$ bzr branch lp:~launchpad/lp-source-dependencies/trunk/ download-cache
+$ git clone --depth=1 lp:~launchpad/lp-source-dependencies/trunk/ download-cache
 $ utilities/update-sourcecode
 $ utilities/launchpad-database-setup
 $ make schema
@@ -269,6 +269,19 @@
   echo ""
 fi
 
+# Make sure "git clone lp:..." works.  Yes, it's pretty odd to use bzr to
+# help configure git, but it knows how to check whether the user has SSH
+# keys.  If we eventually want to drop our dependency on bzr then we can
+# write this out longhand in Python.
+echo "Configuring git..."
+if [ "$(git ls-remote --get-url lp:launchpad)" = lp:launchpad ]; then
+  if bzr launchpad-login --verbose 2>/dev/null | grep -q 'has SSH keys'; then
+    git config --global url.git+ssh://git.launchpad.net/.insteadof lp:
+  else
+    git config --global url.https://git.launchpad.net/.insteadof lp:
+  fi
+fi
+
 cd $LP_SHARED_REPO
 if [ ! -d $LP_TRUNK_NAME ]; then
   echo "Making local branch of Launchpad trunk, this may take a while..."

=== modified file 'utilities/update-download-cache'
--- utilities/update-download-cache	2017-01-17 22:23:39 +0000
+++ utilities/update-download-cache	2017-11-18 10:02:58 +0000
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-bzr up "$(dirname "$0")/../download-cache"
+git -C "$(dirname "$0")/../download-cache" pull


Follow ups