author | Aki Sasaki <asasaki@mozilla.com> |
Wed, 07 Mar 2018 10:37:33 -0800 | |
changeset 413952 | 0ffeb06f9541f6ac7d78c165fd8badc32e699d5a |
parent 413951 | 9f8c088dce9f9ec8a0ca3c708e14ac298e207414 |
child 413953 | d8d0e4665d0bd561b11e195476fc802638aa9e02 |
push id | 33853 |
push user | cbrindusan@mozilla.com |
push date | Tue, 17 Apr 2018 09:51:13 +0000 |
treeherder | mozilla-central@8b0ba3f7d099 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bhearsum |
bugs | 1442793 |
milestone | 61.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/taskcluster/taskgraph/util/taskcluster.py +++ b/taskcluster/taskgraph/util/taskcluster.py @@ -9,16 +9,17 @@ from __future__ import absolute_import, import datetime import functools import yaml import requests import logging from mozbuild.util import memoize from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter +from taskgraph.task import Task _TC_ARTIFACT_LOCATION = \ 'https://queue.taskcluster.net/v1/task/{task_id}/artifacts/public/build/{postfix}' logger = logging.getLogger(__name__) # this is set to true for `mach taskgraph action-callback --test` testing = False @@ -85,16 +86,29 @@ def get_artifact(task_id, path, use_prox return _handle_artifact(path, response) def list_artifacts(task_id, use_proxy=False): response = _do_request(get_artifact_url(task_id, '', use_proxy).rstrip('/')) return response.json()['artifacts'] +def get_artifact_prefix(task): + prefix = None + if isinstance(task, dict): + prefix = task.get('attributes', {}).get("artifact_prefix") + elif isinstance(task, Task): + prefix = task.attributes.get("artifact_prefix") + return prefix or "public/build" + + +def get_artifact_path(task, path): + return "{}/{}".format(get_artifact_prefix(task), path) + + def get_index_url(index_path, use_proxy=False, multiple=False): if use_proxy: INDEX_URL = 'http://taskcluster/index/v1/task{}/{}' else: INDEX_URL = 'https://index.taskcluster.net/v1/task{}/{}' return INDEX_URL.format('s' if multiple else '', index_path)