Downgrade integrations without code owner (#85752)

This commit is contained in:
epenet 2023-01-13 10:08:15 +01:00 committed by GitHub
parent 80714c544a
commit e75c85f679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 12 deletions

View File

@ -4,7 +4,7 @@
"documentation": "https://www.home-assistant.io/integrations/directv", "documentation": "https://www.home-assistant.io/integrations/directv",
"requirements": ["directv==0.4.0"], "requirements": ["directv==0.4.0"],
"codeowners": [], "codeowners": [],
"quality_scale": "gold", "quality_scale": "silver",
"config_flow": true, "config_flow": true,
"ssdp": [ "ssdp": [
{ {

View File

@ -5,7 +5,7 @@
"documentation": "https://www.home-assistant.io/integrations/homematicip_cloud", "documentation": "https://www.home-assistant.io/integrations/homematicip_cloud",
"requirements": ["homematicip==1.0.13"], "requirements": ["homematicip==1.0.13"],
"codeowners": [], "codeowners": [],
"quality_scale": "platinum", "quality_scale": "silver",
"iot_class": "cloud_push", "iot_class": "cloud_push",
"loggers": ["homematicip"] "loggers": ["homematicip"]
} }

View File

@ -309,25 +309,19 @@ def validate_manifest(integration: Integration, core_components_dir: Path) -> No
"manifest", f"Invalid manifest: {humanize_error(integration.manifest, err)}" "manifest", f"Invalid manifest: {humanize_error(integration.manifest, err)}"
) )
if integration.manifest["domain"] != integration.path.name: if (domain := integration.manifest["domain"]) != integration.path.name:
integration.add_error("manifest", "Domain does not match dir name") integration.add_error("manifest", "Domain does not match dir name")
if ( if not integration.core and (core_components_dir / domain).exists():
not integration.core
and (core_components_dir / integration.manifest["domain"]).exists()
):
integration.add_warning( integration.add_warning(
"manifest", "Domain collides with built-in core integration" "manifest", "Domain collides with built-in core integration"
) )
if ( if domain in NO_IOT_CLASS and "iot_class" in integration.manifest:
integration.manifest["domain"] in NO_IOT_CLASS
and "iot_class" in integration.manifest
):
integration.add_error("manifest", "Domain should not have an IoT Class") integration.add_error("manifest", "Domain should not have an IoT Class")
if ( if (
integration.manifest["domain"] not in NO_IOT_CLASS domain not in NO_IOT_CLASS
and "iot_class" not in integration.manifest and "iot_class" not in integration.manifest
and integration.manifest.get("integration_type") != "virtual" and integration.manifest.get("integration_type") != "virtual"
): ):
@ -343,6 +337,15 @@ def validate_manifest(integration: Integration, core_components_dir: Path) -> No
"Virtual integration points to non-existing supported_by integration", "Virtual integration points to non-existing supported_by integration",
) )
if (quality_scale := integration.manifest.get("quality_scale")) in {
"gold",
"platinum",
} and not integration.manifest.get("codeowners"):
integration.add_error(
"manifest",
f"{quality_scale} integration does not have a code owner",
)
if not integration.core: if not integration.core:
validate_version(integration) validate_version(integration)