Skip to content

Improve port conflict detection and resolution across Core and apps#6916

Open
mdegat01 wants to merge 2 commits into
mainfrom
port-conflict-prevention
Open

Improve port conflict detection and resolution across Core and apps#6916
mdegat01 wants to merge 2 commits into
mainfrom
port-conflict-prevention

Conversation

@mdegat01

@mdegat01 mdegat01 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Proposed change

This PR improves Supervisor handling of port conflicts between Home Assistant Core, apps, and plugins.

Main improvements:

  • Add proactive and runtime conflict detection paths for Core and apps.
  • Improve Core startup conflict handling so app conflicts always create repair issues, while only active app conflicts attempt stop/abort behavior.
  • Expand app options port validation against currently used host bindings.
  • Add new resolution checks/fixup for app port conflicts (app_port_conflict, app_port_conflict_core, clear_port_config).
  • Add broad test coverage for API behavior, Core startup conflict handling, app start/restart conflict behavior, and host port binding synthesis/parsing.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • 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:
  • Link to cli pull request:
  • Link to client library 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
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@mdegat01 mdegat01 added missing-documentation Added to pull requests that needs a docs, but none is linked new-feature A new feature needs-client-library Pull requests needs client library changes but none is linked needs-core Pull request needs Home Assistant Core changes but none are linked labels Jun 6, 2026
@mdegat01

mdegat01 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Ok to facilitate review a bit, about half the changeset here is new tests.

Of the production code changeset, the reason every single check and fixup is in here is because I needed a new field in Suggestion and Issue. reference wasn't enough, I needed both the app and the particular port so I added reference_extra. This is why needs-client-library and missing-documentation are added since there's API changes due to this.

This also meant changing CheckBase and FixupBase so all descendents needed modifications. Only checks/app_port_conflict, checks/app_port_conflict_core, and fixups/app_clear_port_config need review of those. The others just had to update a signature but there's no runtime change.

Other changes outside of resolution do need review though as they are the core of this work. Sorry it ended up so big.

@mdegat01 mdegat01 force-pushed the port-conflict-prevention branch from 8ef99c8 to 9961beb Compare June 8, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed missing-documentation Added to pull requests that needs a docs, but none is linked needs-client-library Pull requests needs client library changes but none is linked needs-core Pull request needs Home Assistant Core changes but none are linked new-feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant