Bug 827345, Self-serve nightly forcing doesn't work for b2g, r=catlee
authorNick Thomas <nthomas@mozilla.com>
Fri, 11 Jan 2013 15:22:56 +1300
changeset 181 0bb3e16ba8cb538571c3ce454ff80e60826a1d9c
parent 180 ce912451103362673f547ec748f87f06e9c379c8
child 182 853e5d42da536a9125a939e1b4a549b036fd60f6
push id140
push usernthomas@mozilla.com
push dateFri, 11 Jan 2013 02:23:20 +0000
reviewerscatlee
bugs827345
Bug 827345, Self-serve nightly forcing doesn't work for b2g, r=catlee
buildapi/scripts/selfserve-agent.py
--- a/buildapi/scripts/selfserve-agent.py
+++ b/buildapi/scripts/selfserve-agent.py
@@ -371,26 +371,28 @@ class BuildAPIAgent:
         cmd = [self.buildbot, 'sendchange', '--master', pb_url, '--branch',
                 repo_path, '--revision', revision, '--revlink', revlink,
                 '--user', who, '--comments', 'Submitted via self-serve',
                 'dummy']
         log.info("Running %s", cmd)
         subprocess.check_call(cmd)
         return {"errors": False, "msg": "Ok"}
 
-    def _create_build_for_revision(self, who, branch, revision, priority, builder_expression):
+    def _create_build_for_revision(self, who, branch, revision, priority, builder_expression, builder_exclusion='%l10n nightly'):
         now = time.time()
         repo_path = self._get_repo_path(branch)
 
         # Find builders that have been active in the past 2 weeks
         q = """SELECT DISTINCT buildername FROM buildrequests WHERE
                 buildername LIKE :buildername AND
+                buildername NOT LIKE :buildername_exclusion AND
                 submitted_at > :submitted_at"""
         result = self.db.execute(text(q),
                 buildername=builder_expression,
+                buildername_exclusion=builder_exclusion,
                 submitted_at=time.time() - 14*24*3600,
                 )
 
         buildernames = [r[0] for r in result]
         log.debug("buildernames are %s", buildernames)
 
         # Create a sourcestamp
         q = text("""INSERT INTO sourcestamps
@@ -460,17 +462,17 @@ class BuildAPIAgent:
         revision = message_data['body']['revision']
         priority = message_data['body']['priority']
         log.info("New nightly by %s of %s %s", who, branch, revision)
         return self._create_build_for_revision(
                     who,
                     branch,
                     revision,
                     priority,
-                    "%% %s nightly" % branch)
+                    '%'+branch+'%nightly')
 
     def do_cancel_revision(self, message_data, message):
         who = message_data['who']
         branch = message_data['body']['branch']
         revision = "%s%%" % message_data['body']['revision'][:12]
         prefixbranch = "%s%%" % branch
         suffixbranch = "%%%s" % branch