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

Remove strict connection #117933

Merged
merged 3 commits into from
May 24, 2024
Merged

Remove strict connection #117933

merged 3 commits into from
May 24, 2024

Conversation

edenhaus
Copy link
Contributor

@edenhaus edenhaus commented May 22, 2024

Breaking change

Proposed change

Remove strict connection for both (cloud and non-cloud)

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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

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

Code owner commands

Code owners of cloud can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign cloud Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (auth) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of auth can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign auth Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (http) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of http can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign http Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@edenhaus edenhaus force-pushed the edenhaus-remove-strict-connection branch from b09963c to 9b2bac7 Compare May 22, 2024 16:49
@edenhaus edenhaus added this to the 2024.6.0b0 milestone May 24, 2024
@edenhaus
Copy link
Contributor Author

Frontend PR: home-assistant/frontend#20861

@coderabbitai review

Copy link

coderabbitai bot commented May 24, 2024

@edenhaus, thank you for providing the details. I've reviewed the list of files changed in the PR and the PR description. Here's a summary of the review:

Files Changed

The PR modifies several files related to authentication and cloud components, including:

  • Core authentication logic (homeassistant/auth/__init__.py, session.py)
  • Cloud component files (homeassistant/components/cloud/*)
  • HTTP component modifications (homeassistant/components/http/*)
  • Various tests for cloud and HTTP components

PR Description and Objectives

  • Objective: The PR aims to remove strict connections for both cloud and non-cloud configurations. This is a significant change as it affects how Home Assistant handles connections and authentication.
  • Checklist Compliance: The checklist items such as local testing, code formatting with Ruff, and addition of tests to verify new code functionality are marked as incomplete. It's crucial that these steps are completed to ensure the stability and quality of the code.

Recommendations

  1. Complete the PR Checklist: Ensure that all the checklist items are addressed. This includes testing the changes locally and ensuring all tests pass.
  2. Add More Tests: Given the scope of the changes, particularly in authentication and cloud components, it's important to have comprehensive tests to ensure that no existing functionality is broken.
  3. Documentation: If there are user-facing changes or significant alterations in how connections are handled, updating the documentation will be crucial for end-users.

Please let me know if you need further details on specific files or if there's anything else I can assist with!

Analysis chain
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Fetch the list of files changed in the PR
gh pr view https://github.com/home-assistant/core/pull/117933 --json files --jq '.files[].path'

# Fetch the PR description and checklist items
gh pr view https://github.com/home-assistant/core/pull/117933 --json body

Length of output: 6483

Actions Performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

coderabbitai bot commented May 24, 2024

Walkthrough

The recent updates involve the removal of the SessionManager class and the StrictConnectionMode feature across various components of Home Assistant. This includes eliminating related imports, constants, functions, and test cases. The changes aim to simplify the authentication and cloud connection mechanisms by removing unused or deprecated features and dependencies, such as aiohttp_session.

Changes

File(s) Change Summary
homeassistant/auth/__init__.py Removed SessionManager class and its initialization/setup in AuthManager.
homeassistant/components/auth/__init__.py Removed StrictConnectionTempTokenView class, STRICT_CONNECTION_URL constant, and async_create_session calls.
homeassistant/components/cloud/__init__.py Refactored imports, removed unused ones, and simplified service handling and URL generation functions.
homeassistant/components/cloud/client.py Removed strict_connection parameter from async_cloud_connection_info function.
homeassistant/components/cloud/const.py Removed PREF_STRICT_CONNECTION constant.
homeassistant/components/cloud/http_api.py Removed http import and PREF_STRICT_CONNECTION related logic.
homeassistant/components/cloud/icons.json Removed create_temporary_strict_connection_url service icon reference.
homeassistant/components/cloud/prefs.py Removed PREF_STRICT_CONNECTION references and related handling.
homeassistant/components/cloud/strings.json Removed exception messages and service related to strict connection URL creation.
homeassistant/components/http/__init__.py Removed various imports and declarations related to ServiceCall, ServiceResponse, and CONF_STRICT_CONNECTION.
homeassistant/components/http/auth.py Refactored authentication middleware by removing strict connection mode handling and related imports.
homeassistant/components/http/const.py Removed StrictConnectionMode enum.
homeassistant/package_constraints.txt, requirements.txt Removed aiohttp_session package version 2.12.0.
tests/components/cloud/test_client.py Removed StrictConnectionMode import and references in tests.
tests/components/cloud/test_http_api.py Removed StrictConnectionMode references in websocket status and preferences tests.
tests/components/cloud/test_init.py Removed imports, updated function signatures, and eliminated tests related to strict connection URLs.
tests/components/http/test_auth.py Removed various imports and test cases related to StrictConnectionMode and strict connection handling.
tests/components/http/test_init.py Removed StrictConnectionMode imports, functions, and test cases.
tests/helpers/test_service.py Adjusted assertions related to the number of descriptions checked in tests.
tests/scripts/test_check_config.py Removed StrictConnectionMode import and reference in a test function.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@edenhaus edenhaus marked this pull request as ready for review May 24, 2024 13:09
@edenhaus edenhaus requested a review from a team as a code owner May 24, 2024 13:09
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @edenhaus 👍

../Frenck

@frenck frenck merged commit cb62f42 into dev May 24, 2024
38 checks passed
@frenck frenck deleted the edenhaus-remove-strict-connection branch May 24, 2024 13:50
@github-actions github-actions bot locked and limited conversation to collaborators May 25, 2024
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.

2 participants