Only raise integrationnotfound for dependencies#48241
Only raise integrationnotfound for dependencies#48241balloob merged 8 commits intohome-assistant:devfrom
Conversation
Co-authored-by: J. Nick Koston <nick@koston.org>
c10b648 to
8d22b03
Compare
|
Should we only allow this behavior on custom integrations? As for our core integrations, should not depend on external or non-existing ones (no matter if after or not). |
|
I agree. We should only accept this behavior for custom components 👍 |
bdraco
left a comment
There was a problem hiding this comment.
Please make this only apply to non-core integrations per the discussion above
|
Then shouldn't we block after dependencies for core components since it's the exact same as dependencies? The only distinction was the optionality. |
The difference is the allowing to silently fail on non-existing after dependencies (non-existing integrations). In your linked issue, |
|
But that's not what the described behavior in the documentation is. If core treats both dependencies the same, it's not a useful field for core integrations to have after dependencies because it's not optional. They will fail if the after dependency is missing. In theory a core integration could enable extra functionality if a custom component was available. That's what the field apparently was supposed to allow. If the core component should fail if that optional dependency is missing, the field should be removed for core. |
|
Specifically:
https://developers.home-assistant.io/docs/creating_integration_manifest/#after-dependencies If |
|
Yes, this requires a change to the developer documentation as well. Nevertheless, it should be implemented as suggested above.
No, we should not allow that, that was the whole point of the review. |
|
Yes, but why are we offering two options that behave identically for core components? Shouldn't after_dependencies be marked as not allowed for core? Again, I'm not arguing against implementation, I'm arguing that the existence of two identical options in manifest.json is confusing. I haven't heard a response on that point. |
Nope, for example, an integration can use cloud webhooks, but if a user doesn't have the cloud integration, then that is fine too. So within the core, this is actually used and needed. |
|
Change implemented and clarification to docs submitted. |
|
Lgtm once the pylint is fixed |
Breaking change
Proposed change
Change the behavior of integrationnotfound to only raise for dependencies and not after_dependencies.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Checklist
black --fast 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..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: