From e75c85f6791bd41993591d0f9b5e52b2c0ad387d Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 13 Jan 2023 10:08:15 +0100 Subject: [PATCH] Downgrade integrations without code owner (#85752) --- .../components/directv/manifest.json | 2 +- .../homematicip_cloud/manifest.json | 2 +- script/hassfest/manifest.py | 23 +++++++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/directv/manifest.json b/homeassistant/components/directv/manifest.json index d6fc946ab79..99b1d6a0100 100644 --- a/homeassistant/components/directv/manifest.json +++ b/homeassistant/components/directv/manifest.json @@ -4,7 +4,7 @@ "documentation": "https://www.home-assistant.io/integrations/directv", "requirements": ["directv==0.4.0"], "codeowners": [], - "quality_scale": "gold", + "quality_scale": "silver", "config_flow": true, "ssdp": [ { diff --git a/homeassistant/components/homematicip_cloud/manifest.json b/homeassistant/components/homematicip_cloud/manifest.json index 073d54fcf1e..cf1f8afe67a 100644 --- a/homeassistant/components/homematicip_cloud/manifest.json +++ b/homeassistant/components/homematicip_cloud/manifest.json @@ -5,7 +5,7 @@ "documentation": "https://www.home-assistant.io/integrations/homematicip_cloud", "requirements": ["homematicip==1.0.13"], "codeowners": [], - "quality_scale": "platinum", + "quality_scale": "silver", "iot_class": "cloud_push", "loggers": ["homematicip"] } diff --git a/script/hassfest/manifest.py b/script/hassfest/manifest.py index 5a41d71be21..c2a73e0bed1 100644 --- a/script/hassfest/manifest.py +++ b/script/hassfest/manifest.py @@ -309,25 +309,19 @@ def validate_manifest(integration: Integration, core_components_dir: Path) -> No "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") - if ( - not integration.core - and (core_components_dir / integration.manifest["domain"]).exists() - ): + if not integration.core and (core_components_dir / domain).exists(): integration.add_warning( "manifest", "Domain collides with built-in core integration" ) - if ( - integration.manifest["domain"] in NO_IOT_CLASS - and "iot_class" in integration.manifest - ): + if domain in NO_IOT_CLASS and "iot_class" in integration.manifest: integration.add_error("manifest", "Domain should not have an IoT Class") if ( - integration.manifest["domain"] not in NO_IOT_CLASS + domain not in NO_IOT_CLASS and "iot_class" not in integration.manifest 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", ) + 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: validate_version(integration)