Commit Graph

308 Commits

Author SHA1 Message Date
Erik Montnemery
8e74f63d47 Create repair issue if not all add-ons or folders were backed up (#144999)
* Create repair issue if not all add-ons or folders were backed up

* Fix spelling

* Fix _collect_errors

* Make time patching by freezegun work with mashumaro

* Addd test to hassio

* Add fixture

* Fix generating list of folders

* Add issue creation tests

* Include name of failing add-on in message

* Improve code formatting

* Rename AddonError to AddonErrorData
2025-05-20 15:23:52 +02:00
Simone Chemelli
484a547758 Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
Eliz
c73383ded3 Fix missing head forwarding in ingress (#144231)
* Add support for connect, head and trace in ingress

* added tests

* update the testutil

* fix

* fix empty space

* removed connect

* remove trace
2025-05-05 19:11:41 +02:00
Stefan Agner
f1b8c8855e Push country config to Supervisor (#143871) 2025-04-30 18:02:18 +02:00
Stefan Agner
a584ccb8f7 Remove add-on changelog from cached information (#143526) 2025-04-24 22:14:46 +02:00
Michael
fbe2370df7 Remove deprecated action call addon_update from Supervisor (#143404)
remove deprecated action call addon_update
2025-04-22 10:39:17 +02:00
J. Nick Koston
9b1ab34352 Fix hassio mocking in ESPHome dashboard tests (#143212) 2025-04-18 14:11:36 +02:00
Erik Montnemery
5a09847596 Add backup support to the hassio OS update entity (#142580)
* Add backup support to the hassio OS update entity

* Remove meaningless assert
2025-04-10 20:56:02 +02:00
Erik Montnemery
d5476a1da1 Store update settings in hassio store (#142526) 2025-04-10 11:55:07 +02:00
Erik Montnemery
3ca1f07cc4 Remove meaningless asserts in some hassio tests (#142583) 2025-04-09 12:13:56 +02:00
Erik Montnemery
0ed7348d2d Fix typos in hassio (#142529) 2025-04-08 15:05:19 +02:00
Martin Hjelmare
cb09207cd7 Improve Supervisor addon_running test fixture (#142525) 2025-04-08 14:03:16 +02:00
Erik Montnemery
dfd86d56ec Convert test fixtures to async (#142052) 2025-04-02 14:05:07 +02:00
Marc Mueller
7336178e03 Fix test RuntimeWarnings for hassio (#141883) 2025-03-30 12:00:48 -10:00
Martin Hjelmare
75cd32b742 Fix backup tests typing warnings (#141274) 2025-03-24 12:36:57 +01:00
Erik Montnemery
05c61b7ec3 Rename BackupManager last_non_idle_event to last_action_event (#140291)
* Rename BackupManager last_non_idle_event to last_action_event

* Update snapshots
2025-03-19 17:28:40 +01:00
Erik Montnemery
219b441be0 Don't allow creating backups if Home Assistant is not running (#139499)
* Don't allow creating backups if hass is not running

* Revert "Don't allow creating backups if hass is not running"

This reverts commit 1bf545eb25.

* Set backup manager to idle only after Home Assistant has started

* Update according to discussion, add tests

* Add more test
2025-03-10 14:40:08 +01:00
Erik Montnemery
e86fc88631 Minor improvement of hassio backup tests (#139775) 2025-03-04 18:20:55 +01:00
Erik Montnemery
bf190a8a73 Add backup helper (#139199)
* Add backup helper

* Add hassio to stage 1

* Apply same changes to newly merged `webdav` and `azure_storage` to fix inflight conflict

* Address comments, add tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-02-25 10:19:41 +01:00
Erik Montnemery
351e594fe4 Add flag to backup store to track backup wizard completion (#138368)
* Add flag to backup store to track backup wizard completion

* Add comment

* Update hassio tests

* Update tests

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-24 17:14:47 +01:00
Erik Montnemery
0d8c449ff4 Validate hassio backup settings (#138880)
* Validate hassio backup settings

* Add snapshots

* Don't reset addon and folder settings

* Adapt to changes in BackupConfig.update
2025-02-20 16:06:33 +01:00
Erik Montnemery
e1817d466e Keep one backup per backup agent when executing retention policy (#138189)
* Keep one backup per backup agent when executing retention policy

* Add tests

* Use defaultdict instead of dict.setdefault

* Update hassio tests
2025-02-10 18:09:57 +02:00
Abílio Costa
c2bb376c43 Handle generic agent exceptions when getting and deleting backups (#138145)
* Handle generic agent exceptions when getting backups

* Update hassio test

* Update delete_backup
2025-02-10 01:31:55 +01:00
Erik Montnemery
3f2e6d102c Bump aiohasupervisor to version 0.3.0 (#137437) 2025-02-05 16:58:39 +01:00
Erik Montnemery
27b96160e2 Adjust backup filename scheme (#137424)
* Adjust backup filename scheme

* Update tests
2025-02-05 12:02:58 +01:00
Erik Montnemery
eb5036854f Improve error handling when supervisor backups are deleted (#137331)
* Improve error handling when supervisor backups are deleted

* Move exception definitions
2025-02-04 19:49:55 +01:00
Erik Montnemery
5629b995ce Include extra metadata in backup WS API (#137296)
* Include extra metadata in backup WS API

* Update onboarding backup view

* Update google_drive tests
2025-02-04 15:57:30 +01:00
Erik Montnemery
345cbc62a7 Minor adjustments of hassio backup tests (#137324) 2025-02-04 14:19:48 +01:00
Erik Montnemery
ffc6aa0035 Report progress while restoring supervisor backup (#137313) 2025-02-04 12:55:36 +00:00
Erik Montnemery
650351a7f3 Report progress while creating supervisor backup (#137301)
* Report progress while creating supervisor backup

* Use enum util
2025-02-04 11:36:03 +01:00
Erik Montnemery
58b7be7c2f Check for errors when creating backups using supervisor (#137220)
* Check for errors when creating backups using supervisor

* Improve error reporting when there's no backup reference
2025-02-03 17:33:03 +01:00
Erik Montnemery
9cfe109210 Check for errors when restoring backups using supervisor (#137217)
* Check for errors when restoring backups using supervisor

* Break long line in test

* Improve comments
2025-02-03 11:51:29 +01:00
Erik Montnemery
065cdf421f Delete old addon update backups when updating addon (#136977)
* Delete old addon update backups when updating addon

* Address review comments

* Add tests
2025-01-31 13:33:48 -05:00
Erik Montnemery
64f679ba8f Make supervisor backup file names more user friendly (#137020) 2025-01-31 18:20:30 +01:00
Erik Montnemery
ec53b08e09 Don't blow up when a backup doesn't exist on supervisor (#136907) 2025-01-30 17:32:01 +01:00
Erik Montnemery
52feeedd2b Poll supervisor job state when creating or restoring a backup (#136891)
* Poll supervisor job state when creating or restoring a backup

* Update tests

* Add tests for create and restore jobs finishing early
2025-01-30 11:09:31 +01:00
Erik Montnemery
5286bd8f0c Persist hassio backup restore status after core restart (#136857)
* Persist hassio backup restore status after core restart

* Remove useless condition
2025-01-29 13:55:02 -05:00
Erik Montnemery
823df4242d Add support for per-backup agent encryption flag to hassio (#136828)
* Add support for per-backup agent encryption flag to hassio

* Improve comment

* Set password to None when supervisor should not encrypt
2025-01-29 18:23:25 +01:00
Erik Montnemery
9a687e7f94 Add support for per-backup agent encryption flag (#136622)
* Add support for per-backup agent encryption flag

* Adjust

* Don't attempt decrypting an unprotected backup

* Address review comments

* Add some tests

* Add fixture

* Rename fixture

* Correct condition for when we should encrypt or decrypt

* Update tests in integrations

* Improve test coverage

* Fix onedrive tests

* Add test

* Improve cipher worker shutdown

* Improve test coverage

* Fix google_drive tests

* Move inner class _CipherBackupStreamer._WorkerStatus to module scope
2025-01-29 14:04:17 +01:00
Erik Montnemery
646e0d4626 Bump aiohasupervisor to version 0.2.2b6 (#136814) 2025-01-29 10:42:30 +01:00
epenet
7b1b229718 Standardize homeassistant imports in component tests (a-l) (#136806) 2025-01-29 10:00:45 +01:00
Erik Montnemery
abb58ec785 Include error reason in backup events (#136697)
* Include error reason in backup events

* Update hassio backup tests

* Sort code

* Remove catching BackupError in async_receive_backup
2025-01-28 14:44:09 +01:00
Erik Montnemery
b1abf50a31 Tag backups created when updating addon with supervisor.addon_update (#136690) 2025-01-28 13:48:28 +01:00
Michael
8300fd2de8 Introduce unique_id to BackupAgent (#136651)
* add unique_id to BackupAgent

* adjust tests
2025-01-28 12:06:03 +01:00
epenet
b43379be7d Standardize helpers.xxx_registry imports (#136688)
Standardize registry imports
2025-01-28 08:48:34 +01:00
Erik Montnemery
245ee2498e Update hassio to use the backup integration to make backups before update (#136235)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-01-27 08:25:22 +01:00
Erik Montnemery
a7d5e52ffe Always include SSL folder in backups (#136080) 2025-01-20 15:21:34 +01:00
Erik Montnemery
876b3423ba Improve hassio backup create and restore parameter checks (#134434) 2025-01-02 17:52:50 +01:00
Martin Hjelmare
a329828bdf Handle backup errors more consistently (#133522)
* Add backup manager and read writer errors

* Clean up not needed default argument

* Clean up todo comment

* Trap agent bugs during upload

* Always release stream

* Clean up leftover

* Update test for backup with automatic settings

* Fix use of vol.Any

* Refactor test helper

* Only update successful timestamp if completed event is sent

* Always delete surplus copies

* Fix after rebase

* Fix after rebase

* Revert "Fix use of vol.Any"

This reverts commit 28fd7a544899bb6ed05f771e9e608bc5b41d2b5e.

* Inherit BackupReaderWriterError in IncorrectPasswordError

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-01-02 15:45:46 +01:00
Stefan Agner
fb3105bdc0 Improve Supervisor backup error handling (#134346)
* Raise Home Assistant error in case backup restore fails

This change raises a Home Assistant error in case the backup restore
fails. The Supervisor is checking some common issues before starting
the actual restore in background. This early checks raise an exception
(represented by a HTTP 400 error). This change catches such errors and
raises a Home Assistant error with the message from the Supervisor
exception.

* Add test coverage
2025-01-02 11:37:25 +01:00