Add generated integration domain registry - #5512
Draft
thomasgregg wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
integration/domains.jsonMotivation
Home Assistant Analytics currently filters public custom-integration statistics through the legacy
home-assistant/brandsdomain list. Custom integrations can now ship branding locally, so newer integrations are no longer guaranteed to enter that list. This leaves valid integrations absent from the public Analytics dataset.The Analytics discussion suggested using presence in HACS as the trust boundary instead of removing the guardrail entirely:
HACS already publishes the required domain information in
integration/data.json. This change exposes the same validated data through a small, purpose-specific endpoint:This does not add analytics or tracking to HACS and does not change HACS runtime or UI behavior. It only publishes a stable registry derived from the existing default integration dataset. Home Assistant Analytics can consume this endpoint in a separate change and union it with the legacy Brands list.
Why a dedicated endpoint?
Analytics could technically parse the existing
integration/data.json, but that file is repository metadata rather than a purpose-specific domain-registry contract. It is currently about 2.1 MB, while the derived domain list is approximately 47 KB.Publishing
domains.jsonkeeps downstream consumers independent of the internal repository-data structure and gives HACS explicit control over the definition of a trusted default integration. The file is generated from the same validated data, so it introduces no additional source of truth or maintenance burden.The intended Analytics behavior is:
Unknown custom domains would remain excluded. This restores visibility for reviewed HACS integrations without removing the existing publication guardrail.
Future possibilities
A stable domain registry would allow ecosystem tools to associate reviewed HACS integrations with other public, domain-indexed datasets without depending on HACS's full repository-metadata format.
If Home Assistant Analytics adopts this registry, downstream tools could combine release activity with anonymized, opt-in installation reporting, store historical snapshots, and show weekly or monthly adoption trends. The registry itself would contain no usage data and would not change HACS's privacy model.
Validation
python -m pytest tests/scripts/data/test_generate_category_data.py --no-cov -q— 24 passedruff check scripts/data/generate_category_data.py tests/scripts/data/test_generate_category_data.pyruff format --check scripts/data/generate_category_data.py