Skip to content

Fix built-in repository slugs and add origin URL migration support - #7114

Open
mdegat01 wants to merge 2 commits into
mainfrom
fix/builtin-repository-fixed-slugs
Open

Fix built-in repository slugs and add origin URL migration support#7114
mdegat01 wants to merge 2 commits into
mainfrom
fix/builtin-repository-fixed-slugs

Conversation

@mdegat01

@mdegat01 mdegat01 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Proposed change

Hard-code the existing slugs for built-in app repositories so they remain stable even if the backing repository URLs change in the future. This keeps installed app slugs consistent for the built-in Community Apps, ESPHome, and Music Assistant repositories, matching the existing fixed-slug behavior for core and local.

Additionally, when a built-in git repository already exists on disk, Supervisor now checks whether origin matches the configured repository URL and updates origin when it does not. This allows URL migrations without changing repository slugs/paths on disk.

Error handling for this origin-url migration is split from fsck handling:

  • fsck failures continue to follow existing StoreGitError behavior.
  • origin URL update failures raise a dedicated StoreGitRemoteURLUpdateError.
  • startup issue-on-error paths no longer create EXECUTE_RESET for this case; they log and continue so Supervisor can retry later.

Tests were added/updated to cover:

  • fixed slugs for built-in repositories
  • origin URL update on existing clones
  • startup behavior for origin URL update failures
  • explicit add/update error-path expectations

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

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:

@home-assistant home-assistant Bot added cla-signed refactor A code change that neither fixes a bug nor adds a feature labels Aug 7, 2026
@mdegat01
mdegat01 requested review from agners and a lite review from Copilot August 7, 2026 03:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors built-in app repository handling so their slugs remain stable (and paths on disk remain consistent) even if the built-in repository URLs are changed later, aligning Community Apps/ESPHome/Music Assistant with the existing fixed-slug behavior of core and local.

Changes:

  • Introduces a BuiltinRepository.slug property that hard-codes the current slugs for built-in repositories.
  • Updates built-in repository creation to use the fixed slug (instead of URL hashing) for both slug and on-disk path.
  • Adds tests asserting built-in repositories keep fixed slugs independent of URL hashing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
supervisor/store/const.py Adds a fixed slug property for each built-in repository.
supervisor/store/repository.py Uses builtin.slug to determine built-in repo slug and git repo path.
tests/store/test_builtin_stores.py Adds coverage verifying built-in repositories have stable/fixed slugs.

Comment thread supervisor/store/repository.py
@mdegat01 mdegat01 changed the title Refactor built-in repository slugs Fix built-in repository slugs and add origin URL migration support Aug 10, 2026
@mdegat01 mdegat01 added new-feature A new feature and removed refactor A code change that neither fixes a bug nor adds a feature labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants