Skip to content

Validate component usage#23037

Merged
balloob merged 13 commits intodevfrom
validate-component-usage
Apr 13, 2019
Merged

Validate component usage#23037
balloob merged 13 commits intodevfrom
validate-component-usage

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Apr 12, 2019

Description:

Update our manifest validator. Make it easier to support different checks.

Adds a new check to make sure that all other integrations an integration uses, are defined in dependencies. This is obviously not realistic right now and so Circle will fail. The idea is that we come up with an approach to make this actually work. I have now made it warnings, not fatal errors. Trying to find solution in home-assistant/architecture#196

New change: we will not generate things based off manifests unless all other things are valid.

Work related to #23004

Current output:

› python3 -m script.hassfest validate
Warning: webhook references integration websocket_api but it's not a dependency
Warning: persistent_notification references integration websocket_api but it's not a dependency
Warning: mobile_app references integration cloud but it's not a dependency
Warning: calendar references integration frontend but it's not a dependency
Warning: proxy references integration camera but it's not a dependency
Warning: html5 references integration websocket_api but it's not a dependency
Warning: system_health references integration websocket_api but it's not a dependency
Warning: config references integration frontend but it's not a dependency
Warning: config references integration websocket_api but it's not a dependency
Warning: auth references integration onboarding but it's not a dependency
Warning: auth references integration websocket_api but it's not a dependency
Warning: mailbox references integration frontend but it's not a dependency
Warning: camera references integration websocket_api but it's not a dependency
Warning: updater references integration hassio but it's not a dependency
Warning: cloud references integration websocket_api but it's not a dependency
Warning: history references integration frontend but it's not a dependency
Warning: google_assistant references integration camera but it's not a dependency
Warning: mysensors references integration mqtt but it's not a dependency
Warning: media_player references integration websocket_api but it's not a dependency
Warning: onboarding references integration person but it's not a dependency
Warning: lovelace references integration frontend but it's not a dependency
Warning: lovelace references integration system_health but it's not a dependency
Warning: lovelace references integration websocket_api but it's not a dependency
Warning: shopping_list references integration conversation but it's not a dependency
Warning: shopping_list references integration frontend but it's not a dependency
Warning: shopping_list references integration websocket_api but it's not a dependency
Warning: owntracks references integration mqtt but it's not a dependency
Integrations: 817
Invalid integrations: 0

@homeassistant homeassistant added cla-signed small-pr PRs with less than 30 lines. labels Apr 12, 2019
@ghost ghost assigned balloob Apr 12, 2019
@ghost ghost added the in progress label Apr 12, 2019
Comment thread script/manifest_validate/dependencies.py Outdated
@balloob balloob force-pushed the validate-component-usage branch from 38463c0 to 51eee6e Compare April 12, 2019 17:15
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hassfest 😆

Comment thread CODEOWNERS Outdated




Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all the blank lines intended?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh lol, no, should not have committed. That was a test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a new thing where we don't generate if validation failed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about allowing the current get_component references, but not allowing new ones, while we figure out how to deal with calls to hass.components. Thinking about introducing a new "soft" dependency, integrations you want available, but don't need set up. Does that make sense?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I definitely think we need that soft dependency. Eg some components, like owntracks, mysensors, need mqtt only in some cases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread script/hassfest/model.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2019

Codecov Report

Merging #23037 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #23037      +/-   ##
==========================================
+ Coverage   93.94%   93.94%   +<.01%     
==========================================
  Files         450      451       +1     
  Lines       36754    36813      +59     
==========================================
+ Hits        34527    34585      +58     
- Misses       2227     2228       +1
Impacted Files Coverage Δ
homeassistant/components/websocket_api/commands.py 95.89% <100%> (-0.06%) ⬇️
homeassistant/requirements.py 98.33% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f269135...8145505. Read the comment docs.

1 similar comment
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2019

Codecov Report

Merging #23037 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #23037      +/-   ##
==========================================
+ Coverage   93.94%   93.94%   +<.01%     
==========================================
  Files         450      451       +1     
  Lines       36754    36813      +59     
==========================================
+ Hits        34527    34585      +58     
- Misses       2227     2228       +1
Impacted Files Coverage Δ
homeassistant/components/websocket_api/commands.py 95.89% <100%> (-0.06%) ⬇️
homeassistant/requirements.py 98.33% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f269135...8145505. Read the comment docs.

@balloob balloob merged commit e834345 into dev Apr 13, 2019
@ghost ghost removed the in progress label Apr 13, 2019
@delete-merged-branch delete-merged-branch Bot deleted the validate-component-usage branch April 13, 2019 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants