Bug 1318438 - [taskcluster] Look for build_type under 'treeherder/platform' if not specified in name, r?dustin
This patch also removes the superfluous build type in the names of all the source-check tasks.
MozReview-Commit-ID: JwL1NAR4bnY
--- a/taskcluster/ci/source-check/doc.yml
+++ b/taskcluster/ci/source-check/doc.yml
@@ -1,9 +1,9 @@
-sphinx/opt:
+sphinx:
description: Generate the Sphinx documentation
treeherder:
symbol: tc(Doc)
kind: test
tier: 1
platform: lint/opt
worker-type: aws-provisioner-v1/b2gtest
worker:
--- a/taskcluster/ci/source-check/mozlint.yml
+++ b/taskcluster/ci/source-check/mozlint.yml
@@ -1,9 +1,9 @@
-mozlint-eslint/opt:
+mozlint-eslint:
description: JS lint check
treeherder:
symbol: ES
kind: test
tier: 1
platform: lint/opt
worker-type: aws-provisioner-v1/b2gtest
worker:
@@ -37,17 +37,17 @@ mozlint-eslint/opt:
- '**/*eslintrc*'
# The plugin implementing custom checks.
- 'tools/lint/eslint/eslint-plugin-mozilla/**'
# Other misc lint related files.
- 'python/mozlint/**'
- 'tools/lint/**'
- 'testing/docker/lint/**'
-mozlint-flake8/opt:
+mozlint-flake8:
description: flake8 run over the gecko codebase
treeherder:
symbol: f8
kind: test
tier: 1
platform: lint/opt
worker-type: aws-provisioner-v1/b2gtest
worker:
@@ -63,17 +63,17 @@ mozlint-flake8/opt:
when:
files-changed:
- '**/*.py'
- '**/.flake8'
- 'python/mozlint/**'
- 'tools/lint/**'
- 'testing/docker/lint/**'
-wptlint-gecko/opt:
+wptlint-gecko:
description: web-platform-tests linter
treeherder:
symbol: W
kind: test
tier: 1
platform: lint/opt
worker-type: aws-provisioner-v1/b2gtest
worker:
--- a/taskcluster/ci/source-check/python-tests.yml
+++ b/taskcluster/ci/source-check/python-tests.yml
@@ -1,9 +1,9 @@
-taskgraph-tests/opt:
+taskgraph-tests:
description: taskcluster/taskgraph unit tests
treeherder:
symbol: tg
kind: test
tier: 2
platform: linux64/opt
worker-type: aws-provisioner-v1/b2gtest
worker:
@@ -17,17 +17,17 @@ taskgraph-tests/opt:
- integration
- release
when:
files-changed:
- 'taskcluster/**/*.py'
- 'config/mozunit.py'
- 'python/mach/**/*.py'
-mozharness/opt:
+mozharness:
description: mozharness integration tests
treeherder:
symbol: MH
kind: test
tier: 2
platform: lint/opt
worker-type: aws-provisioner-v1/b2gtest
worker:
--- a/taskcluster/taskgraph/transforms/build_attrs.py
+++ b/taskcluster/taskgraph/transforms/build_attrs.py
@@ -12,17 +12,25 @@ transforms = TransformSequence()
def set_build_attributes(config, jobs):
"""
Set the build_platform and build_type attributes based on the job name.
Although not all jobs using this transform are actual "builds", the try
option syntax treats them as such, and this arranges the attributes
appropriately for that purpose.
"""
for job in jobs:
- build_platform, build_type = job['name'].split('/')
+ try:
+ build_platform, build_type = job['name'].split('/')
+ except ValueError:
+ if 'treeherder' not in job or 'platform' not in job['treeherder']:
+ raise
+
+ # if build_type not in name, grab it from treeherder platform
+ build_platform = job['name']
+ build_type = job['treeherder']['platform'].split('/')[-1]
# pgo builds are represented as a different platform, type opt
if build_type == 'pgo':
build_platform = build_platform + '-pgo'
build_type = 'opt'
attributes = job.setdefault('attributes', {})
attributes.update({