Commit Graph

133 Commits (manual_trigger_entity-fix-availability)

Author SHA1 Message Date
Erik Montnemery 228a4eb391
Improve error handling in CoreBackupReaderWriter (#139508) 2025-02-28 14:25:35 +01:00
Erik Montnemery ee01aa73b8
Improve error message when failing to create backups (#139262)
* Improve error message when failing to create backups

* Check for expected error message in tests
2025-02-26 13:44:09 +01:00
Erik Montnemery a910fb879c
Bump securetar to 2025.2.1 (#139273) 2025-02-25 19:23:32 +02:00
Martin Hjelmare 27f7085b61
Create repair for configured unavailable backup agents (#137382)
* Create repair for configured not loaded agents

* Rework to repair issue

* Extract logic to config function

* Update test

* Handle empty agend ids config update

* Address review comment

* Update tests

* Address comment
2025-02-25 16:27:56 +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
Martin Hjelmare 119b296c26
Make backup config update a callback (#138925) 2025-02-20 11:11:34 +00:00
Erik Montnemery ad7780291e
Correct backup date when reading a backup created by supervisor (#138860) 2025-02-19 22:40:03 +01:00
Erik Montnemery b70c5710a9
Correct invalid automatic backup settings when loading from store (#138716)
* Correct invalid automatic backup settings when loading from store

* Improve docstring

* Improve tests
2025-02-19 16:24:30 +01:00
Erik Montnemery 22c634e626
Don't allow setting backup retention to 0 days or copies (#138771)
* Don't allow setting backup retention to 0 days or copies

* Add tests
2025-02-18 15:16:44 +01:00
Erik Montnemery 10180cd464
Fix BackupManager.async_delete_backup (#138286) 2025-02-11 14:53:07 +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 2f116eab9e
Adjust logic for per-backup agent encryption (#137420) 2025-02-05 12:14:06 +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 bfbf95f515
Allow creating backup if at least one agent is available (#137409) 2025-02-05 10:14:39 +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 ffc6aa0035
Report progress while restoring supervisor backup (#137313) 2025-02-04 12:55:36 +00:00
Erik Montnemery ca53d97a6d
Improve shutdown of _CipherBackupStreamer (#137257)
* Improve shutdown of _CipherBackupStreamer

* Catch the right exception
2025-02-04 12:24:30 +01: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 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 e18dc063ba
Make backup file names more user friendly (#136928)
* Make backup file names more user friendly

* Strip backup name

* Strip backup name

* Underscores
2025-01-31 17:33:30 +01:00
Joost Lekkerkerker c3b0bc3e0d
Show name of the backup agents in issue (#136925)
* Show name of the backup agents in issue

* Show name of the backup agents in issue

* Update homeassistant/components/backup/manager.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-01-30 18:15:54 +01:00
Erik Montnemery bab616fa61
Fix handling of renamed backup files in the core writer (#136898)
* Fix handling of renamed backup files in the core writer

* Adjust mocking

* Raise BackupAgentError instead of KeyError in get_backup_path

* Add specific error indicating backup not found

* Fix tests

* Ensure backups are loaded

* Fix tests
2025-01-30 15:25:16 +01:00
Erik Montnemery aca9607e2f
Bump backup store to version 1.3 (#136870)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2025-01-29 14:58:06 -06: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 660653e226
Interrupt _CipherBackupStreamer workers (#136845)
* Interrupt _CipherBackupStreamer workers

* Fix cleanup

* Only abort live threads
2025-01-29 17:44:29 +01:00
Erik Montnemery b2ec72d75f
Persist backup restore status after core restart (#136838)
* Persist backup restore status after core restart

* Don't blow up if restore result file can't be removed

* Update tests
2025-01-29 16:58:33 +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 7249c02655
Add backup endpoints to the onboarding integration (#136051)
* Add backup endpoints to the onboarding integration

* Add backup as after dependency of onboarding

* Add test snapshots

* Fix stale docstrings

* Add utility function for getting the backup manager instance

* Return backup_id when uploading backup

* Change /api/onboarding/backup/restore to accept a JSON body

* Fix with_backup_manager
2025-01-29 12:32:18 +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 e120a7b59c
Fix deadlock in WS command backup/can_decrypt_on_download (#136707) 2025-01-28 13:48:42 +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
Erik Montnemery d2138fe45b
Bump securetar to 2025.1.4 (#136639) 2025-01-27 17:28:45 +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 ea9be01c7c
Indicate in WS API when scheduling additional automatic backup (#136155) 2025-01-22 18:01:46 +00:00
Erik Montnemery a2cbaef264
Prepare backup store to read version 2 (#136149) 2025-01-21 14:37:44 +01:00
Erik Montnemery a60d2b69e3
Add service backup.create_automatic (#136152) 2025-01-21 12:40:54 +00:00
Ville Skyttä 40eb8b91cc
Adjust to recommended propcache.api import paths (#136150) 2025-01-21 10:58:22 +01:00
Erik Montnemery fb4df00e3c
Add support for custom weekly backup schedule (#136079)
* Add support for custom weekly backup schedule

* Rename the new flag to custom_days

* Make the store change backwards compatible

* Improve comments
2025-01-21 08:27:41 +01:00
Erik Montnemery 760168de83
Allow backup writer to update progress during restore (#135975)
* Allow backup writer to update progress during restore

* Clarify comment
2025-01-20 12:58:17 +01:00
Erik Montnemery 43da828a51
Make the time for automated backups configurable (#135825)
* Make the time for automated backups configurable

* Store time as a string, use None to indicate default time

* Don't add jitter if the time is set by user

* Include time of next automatic backup in response to backup/info

* Update tests

* Rename recurrence to state

* Include scheduled backup time in backup/config/info response

* Address review comments

* Update cloud test

* Add test for store migration

* Address review comments
2025-01-20 12:57:46 +01:00
Erik Montnemery 2e189480a5
Improve backup decrypt exceptions (#135765) 2025-01-16 16:07:13 +02:00
Joost Lekkerkerker 9f7a38f189
Enable RUF022 (#135767) 2025-01-16 13:48:24 +01:00
Erik Montnemery 6cbe18ebbd
Bump securetar to 2025.1.3 (#135762)
* Bump securetar to 2025.1.3

* Remove outdated fixture
2025-01-16 13:26:52 +01:00
Erik Montnemery 9db6be11f7
Support decrypting backups when downloading (#135728)
* Support decrypting backups when downloading

* Close stream

* Use test helper

* Wait for worker to finish

* Simplify

* Update backup.json

* Simplify

* Revert change from the future
2025-01-16 12:36:12 +01:00