repackage_routes.py (1421B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 """ 5 Add indexes to repackage kinds 6 """ 7 8 from taskgraph.transforms.base import TransformSequence 9 10 transforms = TransformSequence() 11 12 13 @transforms.add 14 def add_indexes(config, jobs): 15 for job in jobs: 16 repackage_type = job["attributes"].get("repackage_type") 17 if repackage_type and job["attributes"]["build_type"] != "debug": 18 build_platform = job["attributes"]["build_platform"] 19 job_name = f"{build_platform}-{repackage_type}" 20 if job.get("shipping-product", "").startswith("thunderbird"): 21 product = job.get("index", {}).get("product", "thunderbird") 22 else: 23 product = job.get("index", {}).get("product", "firefox") 24 index_type = "generic" 25 if job["attributes"].get("shippable") and job["attributes"].get("locale"): 26 index_type = "shippable-l10n" 27 if job["attributes"].get("shippable"): 28 index_type = "shippable" 29 if job["attributes"].get("locale"): 30 index_type = "l10n" 31 job["index"] = { 32 "job-name": job_name, 33 "product": product, 34 "type": index_type, 35 } 36 37 yield job