bug 1457034 - fix partner hook + lint. r=me a=release
authorAki Sasaki <asasaki@mozilla.com>
Wed, 09 May 2018 10:21:24 -0700
changeset 463619 3bfc82b371ec
parent 463618 00b58dfcf206
child 463620 75bb42aac094
push id1712
push userasasaki@mozilla.com
push date2018-05-09 17:21 +0000
treeherdermozilla-release@3bfc82b371ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, release
bugs1457034
milestone60.0.1
bug 1457034 - fix partner hook + lint. r=me a=release
taskcluster/taskgraph/actions/release_promotion.py
taskcluster/taskgraph/util/partners.py
--- a/taskcluster/taskgraph/actions/release_promotion.py
+++ b/taskcluster/taskgraph/actions/release_promotion.py
@@ -355,17 +355,17 @@ def release_promotion_action(parameters,
     parameters['release_eta'] = input.get('release_eta', '')
     parameters['release_enable_partners'] = release_enable_partners
     parameters['release_partners'] = input.get('release_partners')
     parameters['release_enable_emefree'] = release_enable_emefree
 
     partner_config = input.get('release_partner_config')
     if not partner_config and (release_enable_emefree or release_enable_partners):
         partner_url_config = get_partner_url_config(
-            parameters, graph_config, enable_emefree=release_enable_emefree,
+            parameters, enable_emefree=release_enable_emefree,
             enable_partners=release_enable_partners
         )
         github_token = get_token(parameters)
         partner_config = get_partner_config(partner_url_config, github_token)
 
     if input.get('release_partner_build_number'):
         parameters['release_partner_build_number'] = input['release_partner_build_number']
 
--- a/taskcluster/taskgraph/util/partners.py
+++ b/taskcluster/taskgraph/util/partners.py
@@ -2,23 +2,31 @@ from __future__ import absolute_import, 
 
 from copy import deepcopy
 import json
 import logging
 import os
 from redo import retry
 import requests
 import xml.etree.ElementTree as ET
+from yaml import safe_load
 
 
 # Suppress chatty requests logging
 logging.getLogger("requests").setLevel(logging.WARNING)
 
 log = logging.getLogger(__name__)
 
+CONFIG_YAML = os.path.join(
+    os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
+    "ci", "config.yml"
+)
+with open(CONFIG_YAML) as fh:
+    graph_config = safe_load(fh)
+
 GITHUB_API_ENDPOINT = "https://api.github.com/graphql"
 PARTNER_BRANCHES = {
     'mozilla-beta': 'release',
     'mozilla-release': 'release',
     'maple': 'release',
     'birch': 'release',
     'jamun': 'release',
 }
@@ -397,17 +405,17 @@ def get_ftp_platform(platform):
 def locales_per_build_platform(build_platform, locales):
     if build_platform.startswith('mac'):
         exclude = ['ja']
     else:
         exclude = ['ja-JP-mac']
     return [locale for locale in locales if locale not in exclude]
 
 
-def get_partner_url_config(parameters, graph_config, enable_emefree=True, enable_partners=True):
+def get_partner_url_config(parameters, enable_emefree=True, enable_partners=True):
     partner_url_config = {}
     project = parameters['project']
     if enable_emefree:
         alias = EMEFREE_BRANCHES[project]
         partner_url_config['release-eme-free-repack'] = \
             graph_config['partner'][alias]['release-eme-free-repack']
     if enable_partners:
         alias = PARTNER_BRANCHES[project]