Bug 1359942: rename optimization to skip-unless-changed; r?glandium
MozReview-Commit-ID: 4d4zoDDJYnz
--- a/taskcluster/ci/android-stuff/kind.yml
+++ b/taskcluster/ci/android-stuff/kind.yml
@@ -52,17 +52,17 @@ jobs:
- "/bin/bash"
- "-c"
- "/home/worker/bin/before.sh && /home/worker/bin/build.sh && /home/worker/bin/after.sh && true\n"
max-run-time: 36000
scopes:
- docker-worker:relengapi-proxy:tooltool.download.internal
- docker-worker:relengapi-proxy:tooltool.download.public
optimizations:
- - - files-changed
+ - - skip-unless-changed
- - "mobile/android/config/**"
- "testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py"
- "**/*.gradle"
android-test:
description: "Android armv7 unit tests"
treeherder:
platform: android-4-0-armv7-api15/opt
@@ -99,17 +99,17 @@ jobs:
# NOTE: this could probably be a job description with run.using = 'mozharness'
- "/bin/bash"
- "bin/build.sh"
max-run-time: 36000
scopes:
- docker-worker:relengapi-proxy:tooltool.download.internal
- docker-worker:relengapi-proxy:tooltool.download.public
optimizations:
- - - files-changed
+ - - skip-unless-changed
- - "mobile/android/base/**"
- "mobile/android/tests/background/junit4/**"
android-lint:
description: "Android lint"
treeherder:
platform: android-4-0-armv7-api15/opt
kind: test
@@ -160,17 +160,17 @@ jobs:
# NOTE: this could probably be a job description with run.using = 'mozharness'
- "/bin/bash"
- "bin/build.sh"
max-run-time: 36000
scopes:
- docker-worker:relengapi-proxy:tooltool.download.internal
- docker-worker:relengapi-proxy:tooltool.download.public
optimizations:
- - - files-changed
+ - - skip-unless-changed
- - "mobile/android/**/*.java"
- "mobile/android/**/*.jpeg"
- "mobile/android/**/*.jpg"
- "mobile/android/**/*.png"
- "mobile/android/**/*.svg"
- "mobile/android/**/*.xml" # Manifest & android resources
- "mobile/android/**/*.gradle"
- "mobile/android/**/Makefile.in"
@@ -213,17 +213,17 @@ jobs:
# NOTE: this could probably be a job description with run.using = 'mozharness'
- "/bin/bash"
- "bin/build.sh"
max-run-time: 36000
scopes:
- docker-worker:relengapi-proxy:tooltool.download.internal
- docker-worker:relengapi-proxy:tooltool.download.public
optimizations:
- - - files-changed
+ - - skip-unless-changed
- - "mobile/android/**/checkstyle.xml"
- "mobile/android/**/*.java"
- "mobile/android/**/*.gradle"
- "mobile/android/**/Makefile.in"
- "mobile/android/**/moz.build"
android-findbugs:
description: "Android findbugs"
@@ -265,13 +265,13 @@ jobs:
# NOTE: this could probably be a job description with run.using = 'mozharness'
- "/bin/bash"
- "bin/build.sh"
max-run-time: 36000
scopes:
- docker-worker:relengapi-proxy:tooltool.download.internal
- docker-worker:relengapi-proxy:tooltool.download.public
optimizations:
- - - files-changed
+ - - skip-unless-changed
- - "mobile/android/**/*.java"
- "mobile/android/**/*.gradle"
- "mobile/android/**/Makefile.in"
- "mobile/android/**/moz.build"
--- a/taskcluster/docs/optimization.rst
+++ b/taskcluster/docs/optimization.rst
@@ -18,17 +18,17 @@ in post-order, meaning that each task's
the task itself is optimized.
Each task has a ``task.optimizations`` property describing the optimization
methods that apply. Each is specified as a list of method and arguments. For
example::
task.optimizations = [
['seta'],
- ['files-changed', ['js/**', 'tests/**']],
+ ['skip-unless-changed', ['js/**', 'tests/**']],
]
These methods are defined in ``taskcluster/taskgraph/optimize.py``. They are
applied in order, and the first to return a success value causes the task to
be optimized.
Each method can return either a taskId (indicating that the given task can be
replaced) or indicate that the task can be optimized away. If a task on which
--- a/taskcluster/taskgraph/optimize.py
+++ b/taskcluster/taskgraph/optimize.py
@@ -224,20 +224,20 @@ def opt_seta(task, params):
params.get('pushdate'),
bbb_task):
# Always optimize away low-value tasks
return True, None
else:
return False, None
-@optimization('files-changed')
+@optimization('skip-unless-changed')
def opt_files_changed(task, params, file_patterns):
# pushlog_id == -1 - this is the case when run from a cron.yml job
if params.get('pushlog_id') == -1:
return True, None
changed = files_changed.check(params, file_patterns)
if not changed:
- logger.debug('no files found matching a pattern in `when.files-changed` for ' +
+ logger.debug('no files found matching a pattern in `skip-unless-changed` for ' +
task.label)
return True, None
return False, None
--- a/taskcluster/taskgraph/transforms/job/__init__.py
+++ b/taskcluster/taskgraph/transforms/job/__init__.py
@@ -117,17 +117,18 @@ def rewrite_when_to_optimization(config,
files_changed.extend([
'{}/**'.format(config.path),
'taskcluster/taskgraph/**',
])
if 'in-tree' in job['worker'].get('docker-image', {}):
files_changed.append('taskcluster/docker/{}/**'.format(
job['worker']['docker-image']['in-tree']))
- job.setdefault('optimizations', []).append(['files-changed', files_changed])
+ # "only when files changed" implies "skip if files have not changed"
+ job.setdefault('optimizations', []).append(['skip-unless-changed', files_changed])
assert 'when' not in job
yield job
@transforms.add
def make_task_description(config, jobs):
"""Given a build description, create a task description"""
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -135,17 +135,17 @@ task_description_schema = Schema({
# specified in order. These optimizations are defined in
# taskcluster/taskgraph/optimize.py.
Optional('optimizations'): [Any(
# search the index for the given index namespace, and replace this task if found
['index-search', basestring],
# consult SETA and skip this task if it is low-value
['seta'],
# skip this task if none of the given file patterns match
- ['files-changed', [basestring]],
+ ['skip-unless-changed', [basestring]],
)],
# the provisioner-id/worker-type for the task. The following parameters will
# be substituted in this string:
# {level} -- the scm level of this push
'worker-type': basestring,
# Whether the job should use sccache compiler caching.