зеркало из https://github.com/mozilla/bugbug.git
Ignore case when looking for components in the component to team data
The case used in the component to team data is not consistent with the actual component names. As a workaround, we ignore case. Fixes #2024
This commit is contained in:
Родитель
67064aba22
Коммит
df8d795321
|
@ -324,6 +324,8 @@ def component_to_team(
|
|||
product: str,
|
||||
component: str,
|
||||
) -> Optional[str]:
|
||||
component = component.lower()
|
||||
|
||||
for team, products_data in component_team_mapping.items():
|
||||
if product not in products_data:
|
||||
continue
|
||||
|
@ -331,9 +333,12 @@ def component_to_team(
|
|||
product_data = products_data[product]
|
||||
if (
|
||||
product_data["all_components"]
|
||||
or component in product_data["named_components"]
|
||||
or any(
|
||||
component.startswith(prefix)
|
||||
component == named_component.lower()
|
||||
for named_component in product_data["named_components"]
|
||||
)
|
||||
or any(
|
||||
component.startswith(prefix.lower())
|
||||
for prefix in product_data["prefixed_components"]
|
||||
)
|
||||
):
|
||||
|
|
|
@ -104,6 +104,13 @@ def component_team_mapping():
|
|||
"prefixed_components": ["GFX", "Graphics"],
|
||||
}
|
||||
},
|
||||
"Javascript": {
|
||||
"Core": {
|
||||
"all_components": False,
|
||||
"named_components": ["js-ctypes"],
|
||||
"prefixed_components": ["Javascript"],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
@ -151,3 +158,8 @@ def test_component_to_team(component_team_mapping: dict) -> None:
|
|||
bugzilla.component_to_team(component_team_mapping, "Core", "Graphics: OK")
|
||||
== "GFX"
|
||||
)
|
||||
|
||||
assert (
|
||||
bugzilla.component_to_team(component_team_mapping, "Core", "JavaScript Engine")
|
||||
== "Javascript"
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче