← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:retry-depwait-disabled-das into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:retry-depwait-disabled-das into launchpad:master.

Commit message:
Don't retry dep-wait builds for disabled DASes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/415303

If a `DistroArchSeries` is disabled, then we won't create any new builds for it; this is used when decommissioning obsolete architectures.  In this situation, it also doesn't make sense to automatically retry builds in the dependency-wait state.

(There is currently one build for trusty powerpc that's occasionally being retried for this reason, and I'd like it to stop.)
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:retry-depwait-disabled-das into launchpad:master.
diff --git a/lib/lp/soyuz/scripts/retrydepwait.py b/lib/lp/soyuz/scripts/retrydepwait.py
index 9f86c24..862d33d 100644
--- a/lib/lp/soyuz/scripts/retrydepwait.py
+++ b/lib/lp/soyuz/scripts/retrydepwait.py
@@ -60,10 +60,11 @@ class RetryDepwaitTunableLoop(TunableLoop):
             PocketChroot.chroot != None)
         chroot_series = {chroot.distroarchseriesID for chroot in chroots}
         for build in bpbs:
-            if (build.distro_arch_series.distroseries.status ==
-                    SeriesStatus.OBSOLETE
-                or not build.can_be_retried
-                or build.distro_arch_series_id not in chroot_series):
+            das = build.distro_arch_series
+            if (das.distroseries.status == SeriesStatus.OBSOLETE
+                    or not build.can_be_retried
+                    or das.id not in chroot_series
+                    or not das.enabled):
                 continue
             try:
                 build.updateDependencies()
diff --git a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
index 68d4bd4..5a097f8 100644
--- a/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
+++ b/lib/lp/soyuz/scripts/tests/test_retrydepwait.py
@@ -74,6 +74,14 @@ class TestRetryDepwait(TestCaseWithFactory):
         self.setChroot()
         self.assertStatusAfterLoop(BuildStatus.NEEDSBUILD)
 
+    def test_ignores_when_das_is_disabled(self):
+        # Builds for a disabled distroarchseries are not retried.
+        self.build.distro_arch_series.enabled = False
+        self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT)
+
+        self.build.distro_arch_series.enabled = True
+        self.assertStatusAfterLoop(BuildStatus.NEEDSBUILD)
+
     def test_dry_run_aborts(self):
         # Changes are thrown away when in dry run mode.
         self.assertStatusAfterLoop(BuildStatus.MANUALDEPWAIT, dry_run=True)