Fix built-in repository slugs and add origin URL migration support - #7114
Open
mdegat01 wants to merge 2 commits into
Open
Fix built-in repository slugs and add origin URL migration support#7114mdegat01 wants to merge 2 commits into
mdegat01 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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.slugproperty 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
coreandlocal.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:
Tests were added/updated to cover:
Type of change
Additional information
Checklist
ruff format supervisor tests)If API endpoints or add-on configuration are added/changed: