Reject manifest dependencies on core integrations in hassfest#169425
Merged
Conversation
Core integrations (homeassistant, persistent_notification) are loaded unconditionally during bootstrap, so listing them in another integration's manifest dependencies has no effect. Reject these declarations in hassfest and remove the existing offender in recovery_mode. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a hassfest validation rule to prevent integrations from listing bootstrap core integrations as manifest dependencies, reducing manifest noise and enforcing a clearer dependency model.
Changes:
- Add hassfest validation to reject manifest
dependenciesentries that referencehomeassistant.bootstrap.CORE_INTEGRATIONS. - Remove
persistent_notificationfromrecovery_mode’s manifest dependencies as it is unconditionally loaded. - Add unit tests covering allowed vs rejected dependency domains.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
script/hassfest/dependencies.py |
Introduces a new dependency validation rule for core integrations. |
tests/hassfest/test_dependencies.py |
Adds tests for the new _validate_dependencies behavior. |
homeassistant/components/recovery_mode/manifest.json |
Removes an invalid/no-op dependency on a core integration. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This reverts commit 0b76975.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
frenck
approved these changes
Apr 29, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change
Based on feedback from @arturpragacz in #169386
Add a hassfest check that rejects any manifest
dependenciesentry whosedomain is in
homeassistant.bootstrap.CORE_INTEGRATIONS(currentlyhomeassistantandpersistent_notification). These integrations areloaded unconditionally during bootstrap before any other integration
starts, so listing them as a dependency in another integration's manifest
is meaningless and only adds noise.
ALLOWED_USED_COMPONENTSis updated to spreadCORE_INTEGRATIONSinstead of listing the same domains explicitly, so the two stay in sync
by construction.
To avoid pulling
homeassistant.bootstrap(and its eager componentpre-imports) into the hassfest import chain,
CORE_INTEGRATIONSisduplicated locally in
script/hassfest/dependencies.py. A unit testasserts the two sets stay equal so the duplicate cannot drift.
The
recovery_modemanifest was the only integration tripping the newrule, so its
"dependencies": ["persistent_notification"]entry isremoved. The
persistent_notificationimport inrecovery_mode's coderemains valid:
persistent_notificationis inALLOWED_USED_COMPONENTSand is unconditionally loaded before
recovery_modeanyway.Three unit tests for
_validate_dependenciesare added: one assertingthat a core-integration dep produces an error, one asserting that a
non-core dep does not, and one asserting the duplicated
CORE_INTEGRATIONSstays aligned withhomeassistant.bootstrap.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: