diff --git a/automation/taskcluster/decision_task.py b/automation/taskcluster/decision_task.py index a3a7f563f..63c862c12 100644 --- a/automation/taskcluster/decision_task.py +++ b/automation/taskcluster/decision_task.py @@ -14,7 +14,7 @@ import taskcluster from lib import build_variants from lib.tasks import TaskBuilder, schedule_task_graph -from lib.util import ( +from lib.chain_of_trust import ( populate_chain_of_trust_task_graph, populate_chain_of_trust_required_but_unused_files ) diff --git a/automation/taskcluster/lib/chain_of_trust.py b/automation/taskcluster/lib/chain_of_trust.py new file mode 100644 index 000000000..7ef50c02f --- /dev/null +++ b/automation/taskcluster/lib/chain_of_trust.py @@ -0,0 +1,20 @@ +import json + + +def populate_chain_of_trust_required_but_unused_files(): + # Thoses files are needed to keep chainOfTrust happy. However, they have no + # need for android-components, at the moment. For more details, see: + # https://github.com/mozilla-releng/scriptworker/pull/209/files#r184180585 + + for file_names in ('actions.json', 'parameters.yml'): + with open(file_names, 'w') as f: + json.dump({}, f) # Yaml is a super-set of JSON. + + +def populate_chain_of_trust_task_graph(full_task_graph): + # taskgraph must follow the format: + # { + # task_id: full_task_definition + # } + with open('task-graph.json', 'w') as f: + json.dump(full_task_graph, f) diff --git a/automation/taskcluster/lib/util.py b/automation/taskcluster/lib/util.py index 38c46e4fb..8851b1918 100644 --- a/automation/taskcluster/lib/util.py +++ b/automation/taskcluster/lib/util.py @@ -1,4 +1,3 @@ -import json import re @@ -6,22 +5,3 @@ def convert_camel_case_into_kebab_case(string): # Inspired from https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case # noqa: E501 first_pass = re.sub('(.)([A-Z][a-z]+)', r'\1-\2', string) return re.sub('([a-z0-9])([A-Z])', r'\1-\2', first_pass).lower() - - -def populate_chain_of_trust_required_but_unused_files(): - # Thoses files are needed to keep chainOfTrust happy. However, they have no - # need for android-components, at the moment. For more details, see: - # https://github.com/mozilla-releng/scriptworker/pull/209/files#r184180585 - - for file_names in ('actions.json', 'parameters.yml'): - with open(file_names, 'w') as f: - json.dump({}, f) # Yaml is a super-set of JSON. - - -def populate_chain_of_trust_task_graph(full_task_graph): - # taskgraph must follow the format: - # { - # task_id: full_task_definition - # } - with open('task-graph.json', 'w') as f: - json.dump(full_task_graph, f)