← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/lpbuildbot/fix-force-auto-py3 into lp:lpbuildbot

 

Colin Watson has proposed merging lp:~cjwatson/lpbuildbot/fix-force-auto-py3 into lp:lpbuildbot.

Commit message:
Fix build forcing for schedulers with multiple builders.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/lpbuildbot/fix-force-auto-py3/+merge/400792

Now that the AggregatingScheduler instances for devel and db-devel have multiple builders (for Python 2 and 3), forcing a build on one of the relevant builders was incorrectly forcing builds for all the builders attached to the same scheduler.  To avoid this, explicitly pass the builder names that we want to force.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/lpbuildbot/fix-force-auto-py3 into lp:lpbuildbot.
=== modified file 'lpbuildbot/schedulers/aggregating.py'
--- lpbuildbot/schedulers/aggregating.py	2018-05-08 11:12:48 +0000
+++ lpbuildbot/schedulers/aggregating.py	2021-04-08 11:34:27 +0000
@@ -149,19 +149,19 @@
                     self.treeStableTimer, fire_timer)
 
     @defer.inlineCallbacks
-    def scheduleBuild(self, reason='scheduler'):
+    def scheduleBuild(self, reason='scheduler', builderNames=None):
         self._nextBuildTime = None
         classifications = yield self._getChangeClassifications()
         changeids = sorted(classifications)
         log.msg('%s got changeids: %s' % (self, changeids))
         if changeids:
             bsid, _ = yield self.addBuildsetForChanges(
-                reason=reason, changeids=changeids)
+                reason=reason, changeids=changeids, builderNames=builderNames)
             yield self.master.db.schedulers.flushChangeClassifications(
                 self.schedulerid, less_than=changeids[-1] + 1)
         else:  # build forced, so we have no changes
             bsid, _ = yield self.addBuildsetForLatest(
-                reason=reason, branch=self._branch)
+                reason=reason, branch=self._branch, builderNames=builderNames)
         @defer.inlineCallbacks
         def handle_result():
             bsdict = yield self.master.db.buildsets.getBuildset(bsid)

=== modified file 'lpbuildbot/web.py'
--- lpbuildbot/web.py	2020-07-27 17:08:18 +0000
+++ lpbuildbot/web.py	2021-04-08 11:34:27 +0000
@@ -89,7 +89,8 @@
                isinstance(scheduler, AggregatingScheduler)]
         if relevant_schedulers:
             for scheduler in relevant_schedulers:
-                yield scheduler.scheduleBuild(reason=reason)
+                yield scheduler.scheduleBuild(
+                    reason=reason, builderNames=[builder])
         else:
             ssid = yield self.master.db.sourcestamps.addSourceStamp(
                 branch=branch, revision=None, repository=repository,


Follow ups