Skip to content

Commit 6e55d18

Browse files
committed
Revert "Defer missing-image autofix until after setup completes"
This reverts commit 183e66f.
1 parent 183e66f commit 6e55d18

3 files changed

Lines changed: 7 additions & 26 deletions

File tree

supervisor/apps/app.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ async def load(self) -> None:
262262
except DockerNotFound:
263263
_LOGGER.info("No %s app Docker image %s found", self.slug, self.image)
264264
if self.need_build:
265-
# Build apps potentially take a long time to set up. Surface
266-
# a repair so the resolution autofix loop handles the build
267-
# after setup completes instead of blocking it.
265+
# Don't run a local build during setup. Surface a repair so
266+
# the resolution autofix loop can handle it off the critical
267+
# path.
268268
self._create_missing_image_issue()
269269
else:
270270
try:
@@ -275,10 +275,9 @@ async def load(self) -> None:
275275
self._create_missing_image_issue()
276276
except DockerError as err:
277277
# Docker error other than a clean "image not found" - we can't
278-
# tell whether the image is actually missing. Log so the issue
279-
# is visible (CRITICAL is captured by the Sentry integration)
280-
# and leave the app detached; the user can attempt a manual
281-
# repair from the UI once the underlying cause is resolved.
278+
# tell whether the image is actually missing. Log and leave the
279+
# addon detached; a future load will reattempt and surface a
280+
# MISSING_IMAGE repair if appropriate.
282281
_LOGGER.critical(
283282
"Docker error loading app %s, leaving detached: %s", self.slug, err
284283
)

supervisor/resolution/fixups/app_execute_repair.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44

5-
from ...const import CoreState
65
from ...coresys import CoreSys
76
from ...exceptions import (
87
DockerBuildError,
@@ -86,9 +85,4 @@ def issues(self) -> list[IssueType]:
8685
@property
8786
def auto(self) -> bool:
8887
"""Return if a fixup can be apply as auto fix."""
89-
# Defer auto-repair until setup completes so a missing image (which
90-
# for build apps means a potentially slow Docker build) doesn't keep
91-
# the system in setup state.
92-
return (
93-
self.sys_core.state != CoreState.SETUP and self.attempts < MAX_AUTO_ATTEMPTS
94-
)
88+
return self.attempts < MAX_AUTO_ATTEMPTS

tests/resolution/fixup/test_app_execute_repair.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pytest
88

99
from supervisor.apps.app import App
10-
from supervisor.const import CoreState
1110
from supervisor.coresys import CoreSys
1211
from supervisor.docker.app import DockerApp
1312
from supervisor.docker.interface import DockerInterface
@@ -101,14 +100,3 @@ async def test_fixup_image_exists(
101100
with patch.object(DockerApp, "install") as install:
102101
await app_execute_repair()
103102
install.assert_not_called()
104-
105-
106-
async def test_fixup_skipped_during_setup(coresys: CoreSys):
107-
"""Test fixup is not auto-applied while Supervisor is still in setup."""
108-
app_execute_repair = FixupAppExecuteRepair(coresys)
109-
110-
await coresys.core.set_state(CoreState.SETUP)
111-
assert app_execute_repair.auto is False
112-
113-
await coresys.core.set_state(CoreState.RUNNING)
114-
assert app_execute_repair.auto is True

0 commit comments

Comments
 (0)