Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
bug 846104 - self-serve nightly wildcard matching should be stricter …
Browse files Browse the repository at this point in the history
…- r=catlee
  • Loading branch information
Gijs Kruitbosch committed Jan 14, 2014
1 parent 97b31c9 commit 4b92057
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions buildapi/scripts/selfserve-agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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']
Expand All @@ -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):
Expand Down

0 comments on commit 4b92057

Please sign in to comment.