forked from mirrors/gecko-dev
Bug 1921813 - Update verify_routes_notification_filters to align with Taskcluster > 37.5.0. r=taskgraph-reviewers,ahal a=release DONTBUILD
PR #3662 introduced `on-defined`, `on-pending` and `on-running`, and deprecated `on-any` in favor of `on-transition` or `on-resolved`. [jcristau: ported fix from https://github.com/taskcluster/taskgraph/pull/500] Differential Revision: https://phabricator.services.mozilla.com/D224138
This commit is contained in:
parent
01e6bd053c
commit
233dc38e35
1 changed files with 19 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from taskgraph.util.treeherder import join_symbol
|
from taskgraph.util.treeherder import join_symbol
|
||||||
|
|
@ -211,7 +212,17 @@ def verify_routes_notification_filters(
|
||||||
if task is None:
|
if task is None:
|
||||||
return
|
return
|
||||||
route_prefix = "notify."
|
route_prefix = "notify."
|
||||||
valid_filters = ("on-any", "on-completed", "on-failed", "on-exception")
|
valid_filters = (
|
||||||
|
"on-any",
|
||||||
|
"on-completed",
|
||||||
|
"on-defined",
|
||||||
|
"on-failed",
|
||||||
|
"on-exception",
|
||||||
|
"on-pending",
|
||||||
|
"on-resolved",
|
||||||
|
"on-running",
|
||||||
|
"on-transition",
|
||||||
|
)
|
||||||
task_dict = task.task
|
task_dict = task.task
|
||||||
routes = task_dict.get("routes", [])
|
routes = task_dict.get("routes", [])
|
||||||
|
|
||||||
|
|
@ -225,6 +236,13 @@ def verify_routes_notification_filters(
|
||||||
task.label, route_filter
|
task.label, route_filter
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if route_filter == "on-any":
|
||||||
|
warnings.warn(
|
||||||
|
DeprecationWarning(
|
||||||
|
f"notification filter '{route_filter}' is deprecated. Use "
|
||||||
|
"'on-transition' or 'on-resolved'."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@verifications.add("full_task_graph")
|
@verifications.add("full_task_graph")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue