mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1844298 - gecko_taskgraph: assert payload/index builders names are unique r=taskgraph-reviewers,gabriel DONTBUILD
The task transform module keeps registries of payload and index builders, identified by a "name" string; AFAICT nothing prevents registering different functions under the same name, which seems potentially confusing. Differential Revision: https://phabricator.services.mozilla.com/D183960
This commit is contained in:
parent
7a3c472494
commit
7a64e09ef6
@ -291,6 +291,7 @@ def payload_builder(name, schema):
|
||||
)
|
||||
|
||||
def wrap(func):
|
||||
assert name not in payload_builders, f"duplicate payload builder name {name}"
|
||||
payload_builders[name] = PayloadBuilder(schema, func)
|
||||
return func
|
||||
|
||||
@ -303,6 +304,7 @@ index_builders = {}
|
||||
|
||||
def index_builder(name):
|
||||
def wrap(func):
|
||||
assert name not in index_builders, f"duplicate index builder name {name}"
|
||||
index_builders[name] = func
|
||||
return func
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user