Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Commit

Permalink
Adding function to download latest full-tasks.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
martiansideofthemoon committed May 31, 2016
1 parent 919b320 commit d5cd532
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mozci/taskcluster/tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
TC_TASK_INSPECTOR = "%s/task-inspector/#" % TC_TOOLS_HOST
TC_TASK_GRAPH_INSPECTOR = "%s/task-graph-inspector/#" % TC_TOOLS_HOST
TC_SCHEMA_URL = 'http://schemas.taskcluster.net/scheduler/v1/task-graph.json'

TC_INDEX_URL = 'https://index.taskcluster.net/v1/task/'

class TaskClusterManager(BaseCIManager):

Expand Down Expand Up @@ -405,3 +405,13 @@ def authenticate():
"""
LOG.info("We're going to open a new tab and authenticate you with TaskCluster.")
return taskcluster_client.authenticate()

def get_full_task(repo_name="mozilla-inbound"):
"""
This function fetches the latest full-task-graph file
for a given repository.
"""
namespace = "gecko.v2." + repo_name + ".latest.firefox.decision"
full_tasks_url = TC_INDEX_URL + namespace + "/artifacts/public/full-task-graph.json"
full_tasks = requests.get(full_tasks_url).json()
return full_tasks

0 comments on commit d5cd532

Please sign in to comment.