Bug 1455407: [releaserunner3] Pass the trust domain when finding the decision task in trigger-action. r=mtabara
authorTom Prince <mozilla@hocat.ca>
Mon, 11 Jun 2018 15:40:44 +0000
changeset 8424 54446ea4e817
parent 8423 db9d67c3554f
child 8425 316bb57741ab
push id6151
push usermozilla@hocat.ca
push dateMon, 11 Jun 2018 15:45:08 +0000
reviewersmtabara
bugs1455407
Bug 1455407: [releaserunner3] Pass the trust domain when finding the decision task in trigger-action. r=mtabara Differential Revision: https://phabricator.services.mozilla.com/D1603
buildfarm/release/trigger_action.py
--- a/buildfarm/release/trigger_action.py
+++ b/buildfarm/release/trigger_action.py
@@ -27,16 +27,23 @@ SUPPORTED_ACTIONS = [
     "ship_fennec_rc",
     "ship_firefox",
     "ship_firefox_rc",
     "push_thunderbird",
     "ship_thunderbird",
 ]
 
 
+def get_trust_domain(releases_config, product):
+    for entry in releases_config:
+        if entry['product'] == product:
+            return entry['trust_domain']
+    raise RuntimeError("Unknown product %s", product)
+
+
 def get_task(task_id):
     queue = taskcluster.Queue()
     return queue.task(task_id)
 
 
 # https://www.peterbe.com/plog/best-practice-with-retries-with-requests
 def requests_retry_session(
     retries=5,
@@ -112,17 +119,22 @@ def main():
     else:
         params_yaml = get_artifact_text(queue, args.action_task_id, 'public/parameters.yml')
 
     parameters = yaml.safe_load(params_yaml)
     project = parameters["project"]
     revision = parameters["head_rev"]
 
     if not decision_task_id:
-        decision_task_id = find_decision_task_id(project, revision)
+        product = args.action_flavor.split('_')[1]
+        trust_domain = get_trust_domain(release_runner_config['releases'], product)
+        decision_task_id = find_decision_task_id(
+            trust_domain=trust_domain,
+            project=project, revision=revision,
+        )
 
     previous_graph_ids = []
     if args.previous_graph_ids:
         previous_graph_ids.extend(args.previous_graph_ids.split(','))
     if decision_task_id not in previous_graph_ids:
         previous_graph_ids.insert(0, decision_task_id)
     action_task_input.update({
         "release_promotion_flavor": args.action_flavor,