Bug 1275613 - Always schedule a 'file_patterns' job when its task definition has changed, r=dustin

Currently, jobs which has 'file_patterns' set will only be run if a file matching one
of those patterns has been modified. This means that unless the task definition of the
job was explicitly included in those 'file_patterns', the job won't run when we modify
it!

I think it is safe to assume that when making changes to a job's task, we want it to be
run no matter what. So let's add the task definition to 'file_patterns' automatically.

Here's a try run which modifies the marionette harness task:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=01e6cf9d8599c64d61ac8ecb5320c1c4209e0a8b

MozReview-Commit-ID: AUSfUFzhiA1

--HG--
extra : rebase_source : de9d66d1d17de90dc83681e51134637616a0652e
This commit is contained in:
Andrew Halberstadt 2016-05-25 11:56:38 -04:00
Родитель 7f6fa15abf
Коммит 7f3e0d8258
2 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -191,6 +191,8 @@ class LegacyKind(base.Kind):
# of the changed files.
file_patterns = when.get('file_patterns', None)
if file_patterns and changed_files:
# Always consider changes to the task definition itself
file_patterns.append('testing/taskcluster/{task}'.format(task=task['task']))
for pattern in file_patterns:
for path in changed_files:
if mozpackmatch(path, pattern):

Просмотреть файл

@ -311,6 +311,8 @@ class Graph(object):
# of the changed files.
file_patterns = when.get('file_patterns', None)
if file_patterns and changed_files:
# Always consider changes to the task definition itself
file_patterns.append('testing/taskcluster/{task}'.format(task=task['task']))
for pattern in file_patterns:
for path in changed_files:
if mozpackmatch(path, pattern):