Skip to content

Commit 4cae05e

Browse files
abhishekmadan30ahal
authored andcommitted
Updated it to only impact index routes
1 parent 781e0cb commit 4cae05e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/taskgraph/util/verify.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,21 +223,21 @@ def verify_routes_notification_filters(
223223
)
224224
)
225225

226+
226227
@verifications.add("full_task_graph")
227-
def verify_routes_invalid_slash(
228-
task, taskgraph, scratch_pad, graph_config, parameters
229-
):
228+
def verify_index_route(task, taskgraph, scratch_pad, graph_config, parameters):
230229
"""
231230
This function ensures that routes do not contain forward slashes.
232231
"""
233232
if task is None:
234233
return
235234
task_dict = task.task
236235
routes = task_dict.get("routes", [])
236+
route_prefix = "index."
237237

238238
for route in routes:
239-
# Check for invalid / in the route
240-
if "/" in route:
239+
# Check for invalid / in the index route
240+
if route.startswith(route_prefix) and "/" in route:
241241
raise Exception(
242242
f"{task.label} has invalid route with forward slash: {route}"
243243
)

test/test_util_verify.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,19 @@ def make_task_treeherder(label, symbol, platform="linux/opt"):
200200
id="routes_notfication_filter: deprecated",
201201
),
202202
pytest.param(
203-
"verify_routes_invalid_slash",
203+
"verify_index_route",
204204
make_graph(
205205
make_task(
206206
"invalid_slash",
207207
task_def={
208208
"routes": [
209-
"[email protected]/address2.on-completed"
209+
"index.example.com/foobar.v2.latest.taskgraph.decision"
210210
]
211211
},
212212
),
213213
),
214214
Exception,
215-
id="routes_invalid_slash: invalid slash in route",
215+
id="verify_index_route: invalid slash in route",
216216
),
217217
),
218218
)

0 commit comments

Comments
 (0)