2019-09-12 12:06:28 +00:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
from taskgraph.transforms.task import index_builder
|
|
|
|
|
2019-09-24 17:54:44 +00:00
|
|
|
# Please ping the performance testing team (whawkins at the moment) if these routes change.
|
|
|
|
# In the future, notifying consumers may be easier (https://bugzilla.mozilla.org/show_bug.cgi?id=1548810), but
|
|
|
|
# we need to remember to tell users for the time being
|
2019-09-12 12:06:28 +00:00
|
|
|
SIGNING_ROUTE_TEMPLATES = [
|
2020-05-13 09:01:08 +00:00
|
|
|
"index.{trust-domain}.v2.{project}.{variant}.latest.{abi}",
|
|
|
|
"index.{trust-domain}.v2.{project}.{variant}.{build_date}.revision.{head_rev}.{abi}",
|
|
|
|
"index.{trust-domain}.v2.{project}.{variant}.{build_date}.latest.{abi}",
|
|
|
|
"index.{trust-domain}.v2.{project}.{variant}.revision.{head_rev}.{abi}",
|
2019-09-12 12:06:28 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
@index_builder("signing")
|
|
|
|
def add_signing_indexes(config, task):
|
|
|
|
if config.params["level"] != "3":
|
|
|
|
return task
|
|
|
|
|
|
|
|
subs = config.params.copy()
|
|
|
|
subs["build_date"] = time.strftime(
|
|
|
|
"%Y.%m.%d", time.gmtime(config.params["build_date"])
|
|
|
|
)
|
|
|
|
subs["trust-domain"] = config.graph_config["trust-domain"]
|
|
|
|
subs["variant"] = task["attributes"]["build-type"]
|
|
|
|
|
2020-05-13 09:01:08 +00:00
|
|
|
unique_routes = set()
|
2019-09-12 12:06:28 +00:00
|
|
|
for tpl in SIGNING_ROUTE_TEMPLATES:
|
2020-05-13 09:01:08 +00:00
|
|
|
for abi in task["attributes"]["apks"].keys():
|
|
|
|
subs["abi"] = abi
|
|
|
|
unique_routes.add(tpl.format(**subs))
|
|
|
|
|
|
|
|
task.setdefault("routes", sorted(list(unique_routes)))
|
2019-09-12 12:06:28 +00:00
|
|
|
return task
|