Permalink
Browse files

bug 846104 - self-serve nightly wildcard matching should be stricter …

…- r=catlee
  • Loading branch information...
1 parent 97b31c9 commit 4b920574ef0d232be8811c680d425793f053945c Gijs Kruitbosch committed Jan 14, 2014
Showing with 8 additions and 5 deletions.
  1. +8 −5 buildapi/scripts/selfserve-agent.py
View
13 buildapi/scripts/selfserve-agent.py
@@ -449,24 +449,27 @@ def do_new_build_at_revision(self, message_data, message):
subprocess.check_call(cmd)
return {"errors": False, "msg": "Ok"}
- def _create_build_for_revision(self, who, branch, revision, priority, builder_expression, builder_exclusions=None):
+ def _create_build_for_revision(self, who, branch, revision, priority, builder_expressions, builder_exclusions=None):
if builder_exclusions is None:
builder_exclusions = ['%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
"""
+ for i, bx in enumerate(builder_expressions):
+ q = q + "buildername LIKE :buildername_expression_%i AND " % i
+
for i, bx in enumerate(builder_exclusions):
q = q + "buildername NOT LIKE :buildername_exclusion_%i AND " % i
q = q + """
submitted_at > :submitted_at"""
qparams = {
- 'buildername': builder_expression,
'submitted_at': time.time() - 14 * 24 * 3600,
}
+ for i, bx in enumerate(builder_expressions):
+ qparams['buildername_expression_%i' % i] = builder_expressions[i]
for i, bx in enumerate(builder_exclusions):
qparams['buildername_exclusion_%i' % i] = builder_exclusions[i]
result = self.db.execute(text(q), qparams)
@@ -536,7 +539,7 @@ def do_new_pgobuild_at_revision(self, message_data, message):
branch,
revision,
priority,
- "%% %s pgo-build" % branch)
+ ["%% %s pgo-build" % branch])
def do_new_nightly_at_revision(self, message_data, message):
who = message_data['who']
@@ -549,7 +552,7 @@ def do_new_nightly_at_revision(self, message_data, message):
branch,
revision,
priority,
- '%' + branch + '%nightly',
+ ['%\_' + branch + '\_%nightly', '% ' + branch + ' %nightly%'],
['%' + branch + '_v%nightly', '%l10n nightly'])
def do_cancel_revision(self, message_data, message):

0 comments on commit 4b92057

Please sign in to comment.