Commit Graph

205 Commits

Author SHA1 Message Date
Mike Conley
e240968ed7 Bug 1888447 - Implement recover for the PreferencesBackupResource. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D208162
2024-04-24 18:02:49 +00:00
Mike Conley
ddd2dee114 Bug 1890574 - Add a simple utility to initiate backup recovery in the debug tool. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D208157
2024-04-24 18:02:49 +00:00
Mike Conley
5387ad0f82 Bug 1891596 - Add initial recoverFromBackup method to BackupService. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207929
2024-04-24 18:02:48 +00:00
Mike Conley
213b3dbbef Bug 1888436 - Add recover and postRecovery methods to BackupResource. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207928
2024-04-23 02:54:49 +00:00
Mike Conley
782c9958bd Bug 1886614 - Write a marionette test for the BackupService.createBackup method. r=backup-reviewers,kpatenio
This test can be run via:

./mach marionette-test browser/components/backup/test/marionette/test_backup.py

This also makes it so that BackupResource.copySqliteDatabases does not throw if
one of the passed in database files doesn't exist - it'll just ignore it and
move on. This required me to update some tests in order to create some fake
SQLite databases to ensure that the fake Sqlite connection was made and the
backup stub was called for the SQLite databases being copied.

Finally, this also fixes something I noticed - some of our BackupResource's
weren't returning null or objects as their ManifestEntry. This fixes that
and adds tests to cover that case.

Differential Revision: https://phabricator.services.mozilla.com/D207811
2024-04-23 02:54:49 +00:00
Fred Chasen
14509a1366 Bug 1892007 - Add optional priority number to BackupResource. r=backup-reviewers,mconley
- Adds a static `priority` getter in BackupResource base class, which defaults to 0.
- Determine the order resources will be backed up sorted on that priority in `createBackup`, defaulting to unordered.
- Sets `PlacesBackupResource` position 1 so it will run first.

Differential Revision: https://phabricator.services.mozilla.com/D207934
2024-04-22 23:15:07 +00:00
kpatenio
e032a08a0f Bug 1886613 - Rename staging folder once backup is done. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D207821
2024-04-22 16:40:23 +00:00
kpatenio
0d88c5f2a8 Bug 1892138 - reduce failures for test_SessionStoreBackupResource. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D207888
2024-04-18 18:16:41 +00:00
Mike Conley
df2ca1d62c Bug 1891141 - Create preferences for the pages per step and step delay used by BackupResources. r=backup-reviewers,fchasen
Differential Revision: https://phabricator.services.mozilla.com/D207568
2024-04-17 20:50:48 +00:00
kpatenio
a6f22c8b9f Bug 1885941 - implement backup method for cookies, form history and sessions BackupResources. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D207495
2024-04-17 20:43:38 +00:00
Mike Conley
d0181dedba Bug 1887752 - Write a backup-manifest.json inside of the staging folder when creating a backup. r=backup-reviewers,fchasen
Differential Revision: https://phabricator.services.mozilla.com/D207312
2024-04-17 18:48:04 +00:00
Natalia Csoregi
f623c63813 Backed out changeset 1d9301697aa0 (bug 1887752) for causing failures on browser_all_files_referenced.js CLOSED TREE 2024-04-17 20:29:32 +03:00
Mike Conley
561bda7b79 Bug 1887752 - Write a backup-manifest.json inside of the staging folder when creating a backup. r=backup-reviewers,fchasen
Differential Revision: https://phabricator.services.mozilla.com/D207312
2024-04-17 15:17:40 +00:00
Fred Chasen
607439a7a7 Bug 1885614 - Implement backup method for AddonsBackupResource. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D207491
2024-04-16 19:27:25 +00:00
Mike Conley
7962b5b730 Bug 1890585 - Have MiscDataBackupResource backup the ActivityStreamStorage snippets table. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207460
2024-04-16 19:18:33 +00:00
Mike Conley
b70a8c48c2 Bug 1891124 - Allow the backup debug tool to show a notification showing how long creation time took. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207316
2024-04-15 20:39:05 +00:00
kpatenio
45734a7202 Bug 1885929 - Implement backup method for CredentialsAndSecurityBackupResource. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D207286
2024-04-15 20:18:40 +00:00
Mike Conley
79d94225c6 Bug 1890591 - Add some utilities to BackupResource for copying files and Sqlite databases. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207155
2024-04-15 14:47:20 +00:00
kpatenio
18eff163a1 Bug 1885609 - implement backup method for PlacesBackupResource. r=backup-reviewers,places-reviewers,mak,mconley
Implements `PlacesBackupResource.backup` to store a copy of `places.sqlite` and `favicons.sqlite` in the staging folder.

If users don't want history remembered or use permanent private browsing mode, we will backup bookmarks instead to a file called `bookmarks.json`. Automatic backup is not yet implemented, so to test changes locally, go to `chrome://browser/content/backup/debug.html` to view where we store the staging folder and to manually run the backup methods for all available backup resources.

Backup files for `PlacesBackupResource` should be under the `places` subfolder in the staging folder.

Differential Revision: https://phabricator.services.mozilla.com/D206532
2024-04-10 21:21:17 +00:00
Mike Conley
19ee6676d2 Bug 1885944 - Implement backup method for MiscDataBackupResource. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207057
2024-04-10 13:36:58 +00:00
Mike Conley
346cdfd25a Bug 1890644 - Make it clear that backup method on a BackupResource can return null. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D207071
2024-04-09 20:02:34 +00:00
Mike Conley
95d89beff6 Bug 1890294 - Add a requiresEncryption static getter on BackupResource for subclasses to override. r=backup-reviewers,places-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D206910
2024-04-09 15:15:34 +00:00
Mark Banner
6699dcb7f8 Bug 1799465 - Enable require-jsdoc rules by default, disabling on code where there are existing failures. r=frontend-codestyle-reviewers,migration-reviewers,backup-reviewers,mossop,mconley
Differential Revision: https://phabricator.services.mozilla.com/D206878
2024-04-08 13:34:13 +00:00
Mike Conley
112115ea38 Bug 1885939 - Implement backup method for PreferencesBackupResource. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D205929
2024-04-05 14:05:42 +00:00
kpatenio
467043a452 Bug 1889747 - signedInUser.json file size measurement should be done in CredentialsAndSecurityBackupResource.sys.mjs. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D206704
2024-04-04 23:04:19 +00:00
Fred Chasen
3a31055347 Bug 1883655 - Add disk size measurements for all addons and extensions data. data-review=jhirsch r=backup-reviewers,mconley,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204675
2024-04-04 21:43:41 +00:00
Cristian Tuns
30299ac418 Backed out changeset 21aa60d7cd79 (bug 1883655) for causing xpcshell failures in test_measurements.js CLOSED TREE 2024-04-04 14:54:49 -04:00
Fred Chasen
5ab32eace0 Bug 1883655 - Add disk size measurements for all addons and extensions data. data-review=jhirsch r=backup-reviewers,mconley,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204675
2024-04-04 16:17:44 +00:00
Mike Conley
77557b95f5 Bug 1888491 - Build a simple debug interface for BackupService. r=backup-reviewers,kpatenio
Currently this only gets packaged for Nightly builds. You can access the page
by visiting chrome://browser/content/backup/debug.html.

This also fixes an issue where we weren't clearing the staging folder
recursively if it pre-existed.

Differential Revision: https://phabricator.services.mozilla.com/D206067
2024-04-03 13:37:35 +00:00
Iulian Moraru
680fed88a5 Backed out changeset adba8777ed32 (bug 1883655) for causing xpcshell failures on test_measurements.js. 2024-04-03 06:15:55 +03:00
Fred Chasen
ca41eee79c Bug 1883655 - Add disk size measurements for all addons and extensions data. data-review=jhirsch r=backup-reviewers,mconley,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204675
2024-04-02 21:43:14 +00:00
Natalia Csoregi
88bf261a94 Backed out changeset f90991ecf54d (bug 1888491) for causing NightlyAsRelease instr bustage. CLOSED TREE 2024-04-03 00:30:21 +03:00
Mike Conley
8d9d78b160 Bug 1888491 - Build a simple debug interface for BackupService. r=backup-reviewers,kpatenio
Currently this only gets packaged for Nightly builds. You can access the page
by visiting chrome://browser/content/backup/debug.html.

This also fixes an issue where we weren't clearing the staging folder
recursively if it pre-existed.

Differential Revision: https://phabricator.services.mozilla.com/D206067
2024-04-02 18:50:54 +00:00
kpatenio
6cb1c13ab3 Bug 1887746 - Add disk size measurements for all sqlite files in storage/permanent/chrome. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D205776
2024-04-02 16:49:13 +00:00
Mike Conley
f73e83475a Bug 1885372 - Create a basic createBackup method on BackupService. r=backup-reviewers,fchasen
Differential Revision: https://phabricator.services.mozilla.com/D205626
2024-03-27 13:36:05 +00:00
Fred Chasen
3f0ce216dc Bug 1883740 - Add disk size measurements for cookies, form history and sessions. data-review=jhirsch r=backup-reviewers,mconley
- Adds `CookiesBackupResource`, `FormHistoryBackupResource` and `SessionsStoreBackupResource` classes with measurement methods for those resources.
- Exports `BYTES_IN_KB` and new `bytesToFuzzyKilobytes` methods from `BackupResource`
- Fix filename for `BackupResource` tests.

Differential Revision: https://phabricator.services.mozilla.com/D205254
2024-03-26 20:15:48 +00:00
kpatenio
d126ea6391 Bug 1883747 - Add disk size measurements for a miscellaneous bag of data stores r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D205503
2024-03-26 16:24:58 +00:00
Cristian Tuns
a15db1a730 Backed out changeset 3cbb780fbe07 (bug 1883740) for causing xpcshell failures in test_measurements.js CLOSED TREE 2024-03-25 18:23:09 -04:00
Fred Chasen
0822671fd6 Bug 1883740 - Add disk size measurements for cookies, form history and sessions. data-review=jhirsch r=backup-reviewers,mconley
- Adds `CookiesBackupResource`, `FormHistoryBackupResource` and `SessionsStoreBackupResource` classes with measurement methods for those resources.
- Exports `BYTES_IN_KB` and new `bytesToFuzzyKilobytes` methods from `BackupResource`
- Fix filename for `BackupResource` tests.

Differential Revision: https://phabricator.services.mozilla.com/D205254
2024-03-25 18:45:52 +00:00
kpatenio
e4aa9d8240 Bug 1883739 - Add disk size measurements for all general user preference and user permission stores. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D205130
2024-03-22 18:58:26 +00:00
Noemi Erli
2a3644d25e Backed out changeset 4816ddcf03ba (bug 1883739) for causing failures in test_measurements.js CLOSED TREE
browser/components/backup/metrics.yaml HG: changed browser/components/backup/moz.build HG: changed browser/components/backup/tests/xpcshell/test_measurements.js HG: changed toolkit/components/telemetry/Scalars.yaml HG: removed
browser/components/backup/resources/PreferencesBackupResource.sys.mjs
2024-03-21 01:16:11 +02:00
kpatenio
4dbd04e263 Bug 1883739 - Add disk size measurements for all general user preference and user permission stores. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D205130
2024-03-20 17:34:29 +00:00
kpatenio
59903fe3dd Bug 1883736 - Add disk size measurements for all logins, keys, certificates and payment methods stores. r=backup-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D204948
2024-03-20 15:53:24 +00:00
Mike Conley
8aa436cda6 Bug 1885992 - Test that BackupService.takeMeasurements calls measure on each BackupResource. r=backup-reviewers,fchasen
This also fixes a small typo that prevented us from properly being able
to override the built-in default BackupResources while testing.

Differential Revision: https://phabricator.services.mozilla.com/D204966
2024-03-19 13:31:25 +00:00
kpatenio
c7a5ebed10 Bug 1883642 - Add disk size measurements for places.sqlite and favicons.sqlite. r=backup-reviewers,places-reviewers,mconley,mak
Differential Revision: https://phabricator.services.mozilla.com/D204528
2024-03-18 18:31:10 +00:00
Mike Conley
d4f9331382 Bug 1885366 - Add BackupResource to the backups source docs. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D204824
2024-03-18 17:54:19 +00:00
Mike Conley
b2dffb640b Bug 1885403 - Add legacy telemetry mirror for browser.backup.prof_d_disk_space Glean probe. r=backup-reviewers,perry.mcmanis,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D204676
2024-03-15 14:11:52 +00:00
Fred Chasen
a0c49755c4 Bug 1884995 - Add BackupResource abstract class. r=mconley,backup-reviewers
Adds a `BackupResource` abstract class to be extended by more specific resource handlers and a `BackupResources` module which resources can be registered with.

The BackupResource base includes helpers to get the size of files and directories.

All registed resources will be provided to the `BackupService` constructor for it instantiate them.

Differential Revision: https://phabricator.services.mozilla.com/D203795
2024-03-13 19:08:05 +00:00
Cristian Tuns
3c0612e620 Backed out changeset c4f4e70ebe00 (bug 1884995) for causing bc failures in browser_all_files_referenced.js CLOSED TREE 2024-03-13 13:42:26 -04:00
Fred Chasen
59e85f6675 Bug 1884995 - Add BackupResource abstract class. r=mconley,backup-reviewers
Adds a `BackupResource` abstract class to be extended by more specific resource handlers and a `BackupResources` module which resources can be registered with.

The BackupResource base includes helpers to get the size of files and directories.

All registed resources will be provided to the `BackupService` constructor for it instantiate them.

Differential Revision: https://phabricator.services.mozilla.com/D203795
2024-03-13 16:02:07 +00:00