Implementing fileIsImportant feature, which allows us to filter changes

This commit is contained in:
Sergio Durigan Junior 2015-02-03 19:33:38 -05:00
parent d608255234
commit 8df4c9d129

View file

@ -598,6 +598,20 @@ all_gdb_filter = ChangeFilter (branch_fn = should_watch_branch)
def DefaultGDBCanStartBuild (builder, buildslave, buildrequest):
return not builder.building
tests_accepted_re = re.compile ("(gdb/|bfd/|binutils/).*")
def DefaultGDBfileIsImportant (change):
"""Implementation of fileIsImportant method, in order to decide which
changes to build on GDB."""
if 'GDB Administrator' in change.who:
return False
for filename in change.files:
if re.match (tests_accepted_re, filename):
return True
return False
###############################
#### Configuration loading ####
###############################
@ -613,6 +627,7 @@ def load_config (c):
passwd = load (open ("lib/passwords.json"))
random.seed ()
c['slaves'] = [BuildSlave (slave['name'], passwd[slave['name']],
max_builds = 1,
properties = { 'jobs' : slave['jobs'],
@ -624,6 +639,7 @@ def load_config (c):
if "change_filter" in s:
s['change_filter'] = globals ()[s['change_filter']]
s['treeStableTimer'] = None
s['fileIsImportant'] = DefaultGDBfileIsImportant
kls = globals ()[s.pop ('type')]
s = dict (map (lambda key_value_pair : (str (key_value_pair[0]),
key_value_pair[1]),