Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
Revert "Bug 1396517 - Make Fennec graph 2 not reference graph 1 (#274)…
Browse files Browse the repository at this point in the history
…" (#275)

This reverts commit 233a35b.
  • Loading branch information
JohanLorenzo committed Sep 7, 2017
1 parent 233a35b commit aac1b21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
39 changes: 6 additions & 33 deletions releasetasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DEFAULT_TEMPLATE_DIR = path.join(path.dirname(__file__), "templates")


def make_task_graph(public_key, signing_pvt_key, product, branch, root_home_dir,
def make_task_graph(public_key, signing_pvt_key, product, root_home_dir,
root_template="release_graph.yml.tmpl",
template_dir=DEFAULT_TEMPLATE_DIR,
**template_kwargs):
Expand All @@ -37,7 +37,6 @@ def make_task_graph(public_key, signing_pvt_key, product, branch, root_home_dir,
template = env.get_template(root_template)
template_vars = {
"product": product,
"branch": branch,
"stableSlugId": stable_slug_id(),
"chunkify": chunkify,
"sorted": sorted,
Expand All @@ -61,12 +60,12 @@ def make_task_graph(public_key, signing_pvt_key, product, branch, root_home_dir,
return yaml.safe_load(template.render(**template_vars))


def make_tasks(public_key, signing_pvt_key, product, branch, root_home_dir,
def make_tasks(public_key, signing_pvt_key, product, root_home_dir,
root_template="release_graph.yml.tmpl",
template_dir=DEFAULT_TEMPLATE_DIR,
**template_kwargs):
graph = make_task_graph(
public_key, signing_pvt_key, product, branch, root_home_dir,
public_key, signing_pvt_key, product, root_home_dir,
root_template, template_dir, **template_kwargs)
tasks = graph_to_tasks(graph)
with open(signing_pvt_key) as f:
Expand All @@ -83,7 +82,6 @@ def make_tasks(public_key, signing_pvt_key, product, branch, root_home_dir,
template = env.get_template("atomic_task.yml.tmpl")
template_vars = {
"product": product,
"branch": branch,
"now": arrow.now(),
"never": arrow.now().replace(years=1000),
"sorted": sorted,
Expand All @@ -99,31 +97,6 @@ def make_tasks(public_key, signing_pvt_key, product, branch, root_home_dir,
tasks = add_atomic_task(tasks, (toplevel_task_id, toplevel_task))
taskGroupId = toplevel_task_id
tasks = inject_taskGroupId(tasks, taskGroupId)

graph_2_id = make_fennec_graph_2_not_reference_graph_1(tasks, branch) \
if product == 'fennec' else None

return taskGroupId, sort_tasks(tasks), graph_2_id


def make_fennec_graph_2_not_reference_graph_1(tasks, branch):
# Fennec has one graph in-tree and the other defined here. The in-tree tasks
# need to comply with Chain Of Trust. A decision task has to be defined
# per Chain of Trust. If the in-tree graph (graph 2) lives under graph 1,
# then Chain Of Trust jumps back to graph 1 and verify it's defined in-tree
# as well. This made Chain Of Trust fail. That's why graph 1 and 2 have to
# be independent.
# For more details, see Bug 1396517

graph_2_decision_task_name = '{} candidates_fennec'.format(branch)
graph_2_decision_task_id = [
task_id for task_id, task in tasks.iteritems()
if task['metadata']['name'] == graph_2_decision_task_name
][0]
graph_2_decision_task = tasks[graph_2_decision_task_id]
graph_2_decision_task['taskGroupId'] = graph_2_decision_task_id
# We don't want to depend on anything, otherwise Chain of Trust will verify
# where these tasks are from.
graph_2_decision_task['dependencies'] = []

return graph_2_decision_task_id
# TODO: Only return taskGroupId and sorted task, as taskGroupId and
# toplevel_task_id are now the same ID.
return taskGroupId, toplevel_task_id, sort_tasks(tasks)
1 change: 0 additions & 1 deletion releasetasks/templates/mobile/candidates_fennec.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
task:
provisionerId: aws-provisioner-v1
workerType: gecko-decision
schedulerId: gecko-level-3
created: "{{ now }}"
deadline: "{{ now.replace(days=4) }}"
expires: "{{ never }}"
Expand Down
4 changes: 2 additions & 2 deletions releasetasks/test/desktop/test_make_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ def setUp(self):
"35.0": {"buildNumber": 1, "locales": l10n_changesets.keys()},
},
})
self.taskGroupId, self.tasks, _ = make_tasks(**test_kwargs)
self.taskGroupId, self.toplevel_task_id, self.tasks = make_tasks(**test_kwargs)

def test_deps(self):
for task_id, task in self.tasks.iteritems():
if task_id == self.taskGroupId:
if task_id == self.toplevel_task_id:
assert not task.get("dependencies")
else:
assert task.get("dependencies")
Expand Down

0 comments on commit aac1b21

Please sign in to comment.