1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-24 17:30:08 +01:00
Commit Graph

72 Commits

Author SHA1 Message Date
Stefan Agner 2a8551138d Reject backup uploads with invalid filenames (#167211)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:34:29 +02:00
Stefan Agner 484d9b0cbe Fix test_receive_backup test error when run in isolation (#167204) 2026-04-02 15:36:24 +02:00
Stefan Agner 3b9a9ca6cb Store received backup in temp backup dir only (#166982) 2026-04-01 09:54:01 +02:00
Stefan Agner 4d7bd49d2c Make SecureTar v3 the default for backup creation (#166272)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 19:10:58 +01:00
Josef Zweck f3c38ba2d3 Add "cleaning_up" stage to backup (#165349) 2026-03-12 07:28:17 +01:00
Josef Zweck 2eb65ab314 Buffer backup upload progress events (#165249)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-03-11 17:29:35 +01:00
Josef Zweck 2ef81a54a5 Allow backups to report the upload progress (#163608)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-03-09 17:12:49 +02:00
Erik Montnemery 74a3f4bbb9 Bump securetar to 2026.2.0 (#163226) 2026-02-23 14:03:43 +01:00
Erik Montnemery e16a8ed20e Don't mock out filesystem operations in backup tests (#162877) 2026-02-13 21:39:34 +01:00
Marc Mueller a8ccf1c6fc Update pytest to 8.4.0 (#146114) 2025-06-04 08:09:19 +02:00
Erik Montnemery 0260a03447 Store information about add-ons and folders which could not be backed up (#145367)
* Store information about add-ons and folders which could not be backed up

* Address review comments
2025-05-26 16:07:33 +02:00
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
Erik Montnemery 36d32eaabc Improve backup exclude filters (#141311)
* Improve backup exclude filters

* Add comment
2025-03-25 09:52:45 +01:00
Erik Montnemery 3132cba51f Improve tests of backup exclusion (#141303) 2025-03-24 18:10:08 +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 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
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 6ef1178a35 Use setup_backup_integration test helper in backup tests (#138362) 2025-02-12 09:49:01 +01:00
Erik Montnemery a6c51440e5 Use test helper for creating a mocked backup agent in backup tests (#138312)
* Use test helper for creating a mocked backup agent in backup tests

* Adjust according to discussion
2025-02-12 08:55:16 +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 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 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 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 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
Martin Hjelmare 1a57992e78 Add restore backup tests (#136538)
* Test restore backup with busy manager

* Test restore backup with agent error

* Test restore backup with file error
2025-01-25 18:20:41 -06:00
Martin Hjelmare dabcc6d55a Clean up remaining backup manager tests (#136335) 2025-01-23 15:23:44 +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 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 1fee0a5aa2 Improve backup store in tests (#135798) 2025-01-16 23:14:19 +01:00
Martin Hjelmare 421f9aa638 Avoid using the backup manager in restore tests (#135757)
* Fix typing

* Refactor test restore backup

* Refactor test restore backup wrong password

* Refactor test restore backup wrong parameters

* Update manager state after rebase

* Remove not needed patch
2025-01-16 12:49:27 +01:00
Martin Hjelmare 77a351f992 Add receive backup tests (#135680)
* Clean up test_receive_backup_busy_manager

* Test receive backup agent error

* Test file write error during backup receive

* Test read tar error during backup receive

* Test non agent upload error during backup receive

* Test file read error during backup receive
2025-01-16 08:41:59 +01:00
epenet 02956f9a83 Improve formatting in component test files (#135267)
Improve formatting in test files
2025-01-10 10:53:45 +01:00
Paulus Schoutsen 0ef254bc9a Fix backup dir not existing (#134506) 2025-01-03 00:21:19 -05: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
Erik Montnemery 0c3489c1b3 Adjust language in backup integration (#134440)
* Adjust language in backup integration

* Update tests
2025-01-02 13:29:46 +01:00
Erik Montnemery 82f54eb9d2 Adjust the default backup name (#133668) 2024-12-21 09:38:59 +01:00
Erik Montnemery 5afb9a5053 Validate password before restoring backup (#133647)
* Validate password before restoring backup

* Raise specific error when password is incorrect
2024-12-20 15:43:46 +01:00
Erik Montnemery a76f82080b Create repair issues when automatic backup fails (#133513)
* Create repair issues when automatic backup fails

* Improve test coverage

* Adjust issues
2024-12-19 10:40:07 +01:00
Erik Montnemery 51d63ba508 Store automatic backup flag in backup metadata (#133500) 2024-12-18 18:30:46 +01:00
Erik Montnemery 5516f3609d Rename strategy backup to automatic backup (#133489)
* Rename strategy backup to automatic backup

* Update homeassistant/components/backup/config.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-12-18 17:35:11 +01:00