Add allow-nonvoting key

By default we add 'voting:1' to all queries so they are filtered
from the graph.

There are cases where we want to track bugs for non-voting jobs
in the graph, so add an 'allow-nonvoting' key for special bugs
that we want to track while we're trying to stabilize a job.

Updates the docs, adds a test query and unit test for the query
loader, fixes a bad query that was setting voting:1 already, and
removes the TODO in the query for bug 1539271.

Change-Id: I61b1d4b0faaa3f20fc5b04aa3392c68c61990866
This commit is contained in:
Matt Riedemann
2016-02-01 07:55:30 -08:00
parent eee4788a8e
commit e456a7afca
6 changed files with 22 additions and 3 deletions

View File

@@ -30,6 +30,10 @@ def load(directory='queries'):
bugnum = os.path.basename(fname).rstrip('.yaml')
query = yaml.load(open(fname).read())
query['bug'] = bugnum
query['query'] = "%s AND voting:1" % query['query'].rstrip()
# By default we filter out non-voting jobs, but in certain cases we
# want to show failures for non-voting jobs in the graph while we
# stabilize a job, so check for a special 'allow-nonvoting' key.
if not query.get('allow-nonvoting', False):
query['query'] = "%s AND voting:1" % query['query'].rstrip()
data.append(query)
return data