gecko-dev/taskcluster/taskgraph/transforms/try_job.py
Dustin J. Mitchell a3a9e7939f Bug 1345863: set the job_try_name for all tasks governed by -j; r=gps
We have a `unittest_try_name` for all unit test tasks, and similarly a
`talos_try_name`. The `-j` flag controls tasks known as "jobs" (although the
word has dozens of other meanings, too). Some of those set `job_try_name`, but
others do not and have special-case support in `try_option_syntax.py`. With
this change, all "jobs" set `job_try_name` and the special-case is removed.

MozReview-Commit-ID: 9hvW7wBIl2B

--HG--
extra : rebase_source : 120b5e9e7aa8f81fe49e72f4dadafdbd145ac357
2017-04-28 11:12:31 -04:00

20 lines
669 B
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
from taskgraph.transforms.base import TransformSequence
transforms = TransformSequence()
@transforms.add
def set_job_try_name(config, jobs):
"""
For a task which is governed by `-j` in try syntax, set the `job_try_name`
attribute based on the job name.
"""
for job in jobs:
job.setdefault('attributes', {}).setdefault('job_try_name', job['name'])
yield job