1
0
Fork 0

Do not put Treeherder route when on untrusted repo (#2921)

master
Johan Lorenzo 2019-07-04 10:54:58 +02:00 committed by GitHub
parent 57ca75139b
commit fb4cfb1cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -77,8 +77,12 @@ tasks:
requires: all-completed # Must be explicit because of Chain of Trust
retries: 5
routes:
- statuses # Automatically added by taskcluster-github. It must be explicit because of Chain of Trust
- tc-treeherder.v2.fenix.${head_rev}
$flatten:
- statuses # Automatically added by taskcluster-github. It must be explicit because of Chain of Trust
- $if: 'trust_level == 3'
then:
- tc-treeherder.v2.fenix.${head_rev}
else: []
payload:
maxRunTime: 600 # Decision should remain fast enough to schedule a handful of tasks
image: mozillamobile/fenix:1.4

View File

@ -362,6 +362,9 @@ class TaskBuilder(object):
deadline = taskcluster.fromNow('1 day')
expires = taskcluster.fromNow(DEFAULT_EXPIRES_IN)
if self.trust_level == 3:
routes.append('tc-treeherder.v2.fenix.{}'.format(self.commit))
return {
"provisionerId": provisioner_id,
"workerType": worker_type,
@ -375,9 +378,7 @@ class TaskBuilder(object):
"priority": self.tasks_priority,
"dependencies": [self.task_id] + dependencies,
"requires": "all-completed",
"routes": routes + [
"tc-treeherder.v2.fenix.{}".format(self.commit)
],
"routes": routes,
"scopes": scopes,
"payload": payload,
"extra": {