Skip to content

Commit

Permalink
fix(release_promotion): add missing build_number parameter
Browse files Browse the repository at this point in the history
Shipit needs to be able to set the build number when triggering the
relpro action. This adds the missing input/parameter to support that.
ahal committed Jan 4, 2024
1 parent dd739da commit 92c52cf
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/mozilla_taskgraph/actions/release_promotion.py
Original file line number Diff line number Diff line change
@@ -28,6 +28,16 @@
"default": "<REPLACE ME>",
"enum": sorted(graph_config["release-promotion"]["flavors"].keys()),
},
"build_number": {
"type": "integer",
"default": 1,
"minimum": 1,
"title": "The release build number",
"description": (
"The release build number. Starts at 1 per "
"release version, and increments on rebuild."
),
},
"do_not_optimize": {
"type": "array",
"description": (
@@ -63,6 +73,7 @@
},
"required": [
"release_promotion_flavor",
"build_number",
],
},
)
@@ -107,6 +118,7 @@ def release_promotion_action(parameters, graph_config, input, task_group_id, tas
)
parameters["do_not_optimize"] = do_not_optimize
parameters["target_tasks_method"] = target_tasks_method
parameters["build_number"] = int(input["build_number"])

# When doing staging releases, we still want to reuse tasks from previous
# graphs.
10 changes: 8 additions & 2 deletions test/actions/test_release_promotion.py
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@ def test_release_promotion(parameters, setup, run_action, datadir):
expected_params = parameters.copy()
expected_params.update(
{
"build_number": 2,
"do_not_optimize": [],
"existing_tasks": {"a": 0, "b": 1},
"optimize_target_tasks": True,
@@ -87,7 +88,7 @@ def test_release_promotion(parameters, setup, run_action, datadir):
}
)

input = {"release_promotion_flavor": "promote"}
input = {"build_number": "2", "release_promotion_flavor": "promote"}
mock = run_action("release-promotion", parameters, input)
assert_call(datadir, mock, expected_params)

@@ -128,7 +129,11 @@ def test_release_promotion_combine_previous_graphs(
}
)

input = {"release_promotion_flavor": "ship", "previous_graph_ids": ["d0", "d1"]}
input = {
"build_number": "1",
"release_promotion_flavor": "ship",
"previous_graph_ids": ["d0", "d1"],
}
mock = run_action("release-promotion", parameters, input)
assert_call(datadir, mock, expected_params)

@@ -156,6 +161,7 @@ def test_release_promotion_rebuild_kinds(parameters, setup, run_action, datadir)
)

input = {
"build_number": "1",
"release_promotion_flavor": "promote",
"rebuild_kinds": ["rebuild"],
"previous_graph_ids": ["d0"],

0 comments on commit 92c52cf

Please sign in to comment.