From 9a3702bc1a0b3c479b88caa948539c53ba67d36e Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 3 Mar 2025 19:01:47 +0100 Subject: [PATCH] Avoid loading add-on store repositories too early (#5716) When initially loading the store manager, update_repositories makes sure that all repositories are actually present. If they are for some reason corrupted or content is missing, we currently still trying to load them which leads to an unnecessary warning: ``` 2025-03-03 11:55:54.324 WARNING (SyncWorker_1) [supervisor.store.data] No repository information exists at /data/addons/git/a0d7b954 ... 2025-03-03 11:55:54.343 INFO (MainThread) [supervisor.store.git] Cloning add-on https://github.com/hassio-addons/repository repository ``` Since update_repositories always loads the data, simply remove the superfluous earlier loading attempt. While at it, also improve the cloning/update log messages to make it clear what repository is cloned/updated. --- supervisor/store/__init__.py | 2 -- supervisor/store/git.py | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/supervisor/store/__init__.py b/supervisor/store/__init__.py index 787e560d1..0fc2ef52b 100644 --- a/supervisor/store/__init__.py +++ b/supervisor/store/__init__.py @@ -75,8 +75,6 @@ class StoreManager(CoreSysAttributes, FileConfiguration): async def load(self) -> None: """Start up add-on management.""" - await self.data.update() - # Init custom repositories and load add-ons await self.update_repositories( self._data[ATTR_REPOSITORIES], add_with_errors=True diff --git a/supervisor/store/git.py b/supervisor/store/git.py index f0bb3a7b0..2c2b86aaf 100644 --- a/supervisor/store/git.py +++ b/supervisor/store/git.py @@ -97,7 +97,9 @@ class GitRepo(CoreSysAttributes): } try: - _LOGGER.info("Cloning add-on %s repository", self.url) + _LOGGER.info( + "Cloning add-on %s repository from %s", self.path, self.url + ) self.repo = await self.sys_run_in_executor( ft.partial( git.Repo.clone_from, self.url, str(self.path), **git_args @@ -128,7 +130,7 @@ class GitRepo(CoreSysAttributes): return async with self.lock: - _LOGGER.info("Update add-on %s repository", self.url) + _LOGGER.info("Update add-on %s repository from %s", self.path, self.url) try: branch = self.repo.active_branch.name