[devel at bb.net] Problem as a possible fix for git.py.

Neil Gilmore ngilmore at grammatech.com
Fri Oct 5 15:31:14 UTC 2018


Hi all,

We're (slowly) moving from subversion to git. Mostly, buildbot has been 
well behaved though this, though some of our VMs run out of disk space 
-- we change builder names to reflect branches, and we have different 
branches on git than subversion.

But because of some other troubles, we have sometimes ended up with our 
local git repos in odd states. Recently, we had some troubles where 
fetch would fail and not get cleaned up (yes, we're using 
clobberOnFailure) . The next build would then fail on its git build step 
and on down the line.

Here's our fix. We're a few versions back, not set up to ask you guys to 
pull, etc. (or yadda yadda if you prefer). The code looks the same, but 
you devs might have different ideas. This is down in the _fech function.

Index: git.py
===================================================================
--- git.py      (revision 149088)
+++ git.py      (revision 149089)
@@ -400,6 +400,7 @@
              if rc == RC_SUCCESS:
                  fetch_required = False

+        abandonOnFailure = not self.retryFetch and not 
self.clobberOnFailure
          if fetch_required:
              command = ['fetch', '-t', self.repourl, self.branch]
              # If the 'progress' option is set, tell git fetch to output
@@ -409,7 +410,12 @@
              if self.prog:
                  command.append('--progress')

-            yield self._dovccmd(command)
+            # GT: made clobberOnFailure work against fetch failures
+            # and not just reset failures
+            res = yield self._dovccmd(command, abandonOnFailure)
+            if res != RC_SUCCESS:
+                defer.returnValue(res)
+                return

          if self.revision:
              rev = self.revision
@@ -416,7 +422,6 @@
          else:
              rev = 'FETCH_HEAD'
          command = ['reset', '--hard', rev, '--']
-        abandonOnFailure = not self.retryFetch and not 
self.clobberOnFailure
          res = yield self._dovccmd(command, abandonOnFailure)


If you find it useful, great! If not, well, it's working for us.

Neil Gilmore
grammatech.com


More information about the devel mailing list