mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
Support 0.8.5 filesystem upgrades
This commit is contained in:
parent
dd8953d3ca
commit
2c451ed3e4
@ -1057,6 +1057,7 @@ class Snapshot(ModelWithDeleteAfter, ModelWithOutputDir, ModelWithConfig, ModelW
|
||||
_FS_VERSION_MIGRATION_PATHS: ClassVar[dict[str, str]] = {
|
||||
"0.7.0": "0.9.0",
|
||||
"0.8.0": "0.9.0",
|
||||
"0.8.5": "0.9.0",
|
||||
"0.9.0": "0.9.4",
|
||||
"0.9.1": "0.9.4",
|
||||
"0.9.2": "0.9.4",
|
||||
@ -1116,6 +1117,7 @@ class Snapshot(ModelWithDeleteAfter, ModelWithOutputDir, ModelWithConfig, ModelW
|
||||
migrations = {
|
||||
("0.7.0", "0.9.0"): self._fs_migrate_from_0_7_0_to_0_9_0,
|
||||
("0.8.0", "0.9.0"): self._fs_migrate_from_0_8_0_to_0_9_0,
|
||||
("0.8.5", "0.9.0"): self._fs_migrate_from_0_8_0_to_0_9_0,
|
||||
("0.9.0", "0.9.4"): self._fs_migrate_from_0_9_0_to_0_9_4,
|
||||
("0.9.1", "0.9.4"): self._fs_migrate_from_0_9_0_to_0_9_4,
|
||||
("0.9.2", "0.9.4"): self._fs_migrate_from_0_9_0_to_0_9_4,
|
||||
|
||||
@ -136,9 +136,9 @@ def test_update_migrates_every_declared_filesystem_version(tmp_path, initialized
|
||||
"""Every declared hop must complete through the public maintenance command."""
|
||||
env = cli_env(disable_extractors=True)
|
||||
url = f"https://example.com/fs-{source_version}"
|
||||
legacy_layout = source_version in ("0.7.0", "0.8.0")
|
||||
legacy_layout = source_version.startswith(("0.7.", "0.8."))
|
||||
if legacy_layout:
|
||||
timestamp = f"170000000{list(Snapshot._FS_VERSION_MIGRATION_PATHS).index(source_version)}"
|
||||
timestamp = "1700000000"
|
||||
source_dir = tmp_path / "archive" / timestamp
|
||||
source_dir.mkdir(parents=True, exist_ok=True)
|
||||
(source_dir / "index.json").write_text(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user