Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Huawei LTE SSDP inclusion #85572

Merged
merged 3 commits into from
Jan 12, 2023
Merged

Conversation

scop
Copy link
Member

@scop scop commented Jan 9, 2023

Proposed change

More or less as expected, the loosening of SSDP/UPnP data matches done in #81643 started to yield false positives, as in #85402.

Coming up with robust matches solely based on the SSDP/UPnP data still does not seem possible, so keep the matches as loose as they were made, but additionally invoke a probe request on the API to determine if the device looks like a supported one.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Jan 9, 2023

Hey there @fphammerle, mind taking a look at this pull request as it has been labeled with an integration (huawei_lte) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of huawei_lte can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign huawei_lte Removes the current integration label and assignees on the issue, add the integration domain after the command.

@emontnemery emontnemery marked this pull request as draft January 10, 2023 08:49
@emontnemery
Copy link
Contributor

I marked this as draft since the tests are failing

@scop scop changed the title Probe Huawei LTE API for device support on SSDP match Huawei LTE authentication, SSDP probe fixes Jan 10, 2023
@scop scop marked this pull request as ready for review January 10, 2023 22:20
@rytilahti
Copy link
Member

It would be great to have more smaller PRs than one that does many things, i.e., separate version bumps especially when it bumps over multiple releases. If possible, I'd avoid the version bump in this PR and handle it on its own.

That being said, if it's necessary to have them in one PR, it would be great to have a link to the changes so anyone doing a review can easily perform a review on those.

@balloob balloob added this to the 2023.1.4 milestone Jan 11, 2023
@scop
Copy link
Member Author

scop commented Jan 11, 2023

It would be great to have more smaller PRs than one that does many things, i.e., separate version bumps especially when it bumps over multiple releases. If possible, I'd avoid the version bump in this PR and handle it on its own.

I know. No problem doing that here if there are reviewers available. Historically more/smaller PR's has not helped with that in my experience, on the contrary more often it has been the case that reviewers have asked more, not strictly in-scope changes during their review. It's quite impossible to know beforehand. But just say the word and I'll split this up.

That being said, if it's necessary to have them in one PR, it would be great to have a link to the changes so anyone doing a review can easily perform a review on those.

I added a link to the complete diff in the description yesterday, Salamek/huawei-lte-api@1.6.7...1.6.11

@scop
Copy link
Member Author

scop commented Jan 11, 2023

Note to self, mostly: if we split this up, I'll make this one stack on top of the huawei-lte-api dep bump PR and not rework the code to work independently of it.

huawei-lte-api changes in another form: https://github.com/Salamek/huawei-lte-api/releases (no release notes for 1.6.11, seems it's a brown paper bag fixup one).

@scop
Copy link
Member Author

scop commented Jan 11, 2023

Case in point for "reviewers asking more" is #84019

The whole PR was initially created in part to address a (post-approval) comment not in scope of the original PR and unchanged by it in #83904 (comment)

When it entered review, thankfully a reviewer emerged quickly, however asking some more changes that were ok with the general theme of the PR, but weren't strictly necessary and caused the diff to grow substantially: #84019 (comment). I made those changes a few days later, dropped a note about them, then pinged back a week later. It's now been 3 weeks since my last ping. Sure, holiday season and all, but in principle.

@scop scop mentioned this pull request Jan 11, 2023
19 tasks
@scop
Copy link
Member Author

scop commented Jan 11, 2023

Split the lib upgrade out already in #85669 to save one possible roundtrip, will rework this on top of it if we decide to merge that first.

@scop
Copy link
Member Author

scop commented Jan 11, 2023

Another case (unrelated to huawei_lte) where a reviewer asks for quite substantially more than what would be required for the scope of the submitted PR as such is at #68718 (comment) -- that stuff could very well be done in a followup PR.

Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

LGTM, this is ready to go after being rebased on top of the current dev, thanks @scop! 👍

@rytilahti
Copy link
Member

I know. No problem doing that here if there are reviewers available. Historically more/smaller PR's has not helped with that in my experience, on the contrary more often it has been the case that reviewers have asked more, not strictly in-scope changes during their review. It's quite impossible to know beforehand. But just say the word and I'll split this up.

I feel your frustration as I have also been on the receiving end of hung PRs. The problem is that there are not enough knowledgeable reviewers, and having more changes means in practice more time that needs to be spent on reviewing the code, which is painful especially if one doesn't have a test device. I personally find it fine to remind an earlier reviewer just in case they have forgotten (or clicked the ignore) after some time has gone by, but not everyone may agree on that... :-)

Alas, there are no easy solutions for the lack of willing reviewers. I created home-assistant/developers.home-assistant#1553 some time back as a reminder to start collecting items to check to make the code reviews easier in hopes of making it easier to offload the review burden. But as it often happens, other higher-priority things came up... Also, as a casual reviewer, this would require quite a bit of effort from my side to go through historical code reviews (and the relevant parts in the docs...) to collect checklist items that oftentimes come up (either pre or post-merge), something which may turn out to be a total waste of time without buy-in from the core developers.

More or less as expected, the loosening of SSDP/UPnP data matches done
in #81643 started to yield false positives, as in #85402.

Coming up with robust matches solely based on the SSDP/UPnP data still
does not seem possible, so keep the matches as loose as they were made,
but additionally invoke a probe request on the API to determine if the
device looks like a supported one.
Prevents throwaway probes for discoveries already in progress.
@scop scop force-pushed the scop-huawei-lte-ssdp-api-probe branch from d49eee2 to ef83330 Compare January 11, 2023 22:44
@scop scop changed the title Huawei LTE authentication, SSDP probe fixes Improve Huawei LTE SSDP inclusion Jan 11, 2023
@scop
Copy link
Member Author

scop commented Jan 11, 2023

Rebased, summary + description and list of fixed bugs updated.

Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @scop, let's get this into the next point release! 👍

@rytilahti rytilahti merged commit c625051 into dev Jan 12, 2023
@rytilahti rytilahti deleted the scop-huawei-lte-ssdp-api-probe branch January 12, 2023 05:47
balloob pushed a commit that referenced this pull request Jan 12, 2023
* Probe Huawei LTE API for device support on SSDP match

More or less as expected, the loosening of SSDP/UPnP data matches done
in #81643 started to yield false positives, as in #85402.

Coming up with robust matches solely based on the SSDP/UPnP data still
does not seem possible, so keep the matches as loose as they were made,
but additionally invoke a probe request on the API to determine if the
device looks like a supported one.

* Probe only after unique id checks

Prevents throwaway probes for discoveries already in progress.

* Fix SSDP result URL test, add missing assert on it
@balloob balloob mentioned this pull request Jan 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Huawei-LTE detects more then just the LTE gateway
4 participants