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/.
7 from taskgraph
.parameters
import extend_parameters_schema
8 from voluptuous
import All
, Any
, Optional
, Range
, Required
11 extend_parameters_schema(
13 Required("pull_request_number"): Any(All(int, Range(min=1)), None),
14 Required("release_type", default
=""): str,
15 Optional("shipping_phase"): Any("build", "ship", None),
16 Required("version", default
=""): str,
17 Required("next_version", default
=""): Any(None, str),
22 def get_decision_parameters(graph_config
, parameters
):
23 parameters
.setdefault("release_type", "")
24 head_tag
= parameters
["head_tag"]
25 parameters
["version"] = head_tag
[1:] if head_tag
else ""
27 pr_number
= os
.environ
.get("MOBILE_PULL_REQUEST_NUMBER", None)
28 parameters
["pull_request_number"] = None if pr_number
is None else int(pr_number
)
29 parameters
.setdefault("next_version", None)