Bug 1876318 - android_taskgraph: update release-type and release promotion filters. r=gbrown,releng-reviewers

Ensure firefox-android release promotion picks up the right tasks.

Differential Revision: https://phabricator.services.mozilla.com/D201477
This commit is contained in:
Julien Cristau 2023-09-28 14:57:59 +02:00
parent ce1e8c7b9d
commit a0a6b8dc65
2 changed files with 8 additions and 11 deletions

View file

@ -4,8 +4,9 @@
def does_task_match_release_type(task, release_type):
return (
# TODO: only use a single attribute to compare to `release_type`
task.attributes.get("build-type") == release_type
or task.attributes.get("release-type") == release_type
if task.attributes.get("build-type", task.attributes.get("release-type")) is None:
return True
return bool(
{task.attributes.get("build-type"), task.attributes.get("release-type")}
& {release_type}
)

View file

@ -101,19 +101,15 @@ def _filter_release_promotion(
return True
# TODO: get rid of this release_type match
if task.attributes.get(
"shipping_phase"
) == shipping_phase and does_task_match_release_type(
task, parameters["release_type"]
):
return True
if (
task.attributes.get("shipping_phase") == shipping_phase
and task.attributes.get("shipping_product") == parameters["release_product"]
and does_task_match_release_type(task, parameters["release_type"])
):
return True
return False
return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]