Skip to content

fix(storage): keep legacy auto allocation when multi routing is retained - #27

Merged
opendev9 merged 1 commit into
devfrom
fix/storage-legacy-switch-20261020
Oct 20, 2026
Merged

opendev9 merged 1 commit into
devfrom
fix/storage-legacy-switch-20261020

Conversation

@opendev9

Copy link
Copy Markdown

Problem

After #25 removed the legacy Compose overlay values, an existing deployment whose .env did not explicitly set CF_ENABLE_S3_STORAGE=true keeps its persisted multi routing (so old libraries stay readable), but bootstrap regenerates [cloudfile] s3_storage_enabled = false. cf_pin_default_local_storage is gated by that switch, so new libraries silently land in the default seafile-data instead of their own auto-local directory. This violates "legacy deployments keep their behavior".

Change

  • library_storage.retained_legacy_switch(): true when the persisted config still has enable_storage_classes = true and s3_storage_enabled = true.
  • bootstrap.write_cloudfile_seafile_conf(): when legacy backend sections are retained and that switch was on, keep s3_storage_enabled = true. Explicit CF_LIBRARY_STORAGE=auto and new installs are unaffected.
  • Test regressions from fix(build): unify full dev builds and immutable receipts #26 on dev:
    • tests/test_v2_native_config.py and tests/test_v2_web_paths.py still pointed at build/v2, which fix(build): unify full dev builds and immutable receipts #26 archived; they move to docs/history/storage-build-20261020/tests/ with their paths updated (19 tests, OK).
    • test_application_assembly.test_changed_native_pin_refuses_reuse_without_creating_output set seafile-server ref to 'a'*40, which equals the new source-lock.json fixture value, so nothing changed and the refusal never fired. It now uses 'c'*40.

Validation

cd tests && python3 -m unittest discover -s . -p 'test_*.py'
Ran 144 tests — only error: test_automatic_local_storage (local host lacks pytest)
pytest test_automatic_local_storage.py   # in a venv with pytest: 19 passed
python3 -m unittest test_library_storage_config   # 17 OK, incl. 2 new legacy-switch tests

Before this PR, dev had 1 failure plus the 2 archived-test import errors (and the same pytest import error).

No deployment or image build.

🤖 Generated with Claude Code

Legacy deployments that relied on the removed Compose overlay retain their
persisted multi storage sections, but CF_ENABLE_S3_STORAGE now defaults to
false and regenerated [cloudfile] s3_storage_enabled=false. The C allocator
then stopped pinning new libraries to auto-local directories. Keep the
persisted switch whenever the retained storage classes remain enabled.

Also repair two test regressions from the build-chain change: archive the
V2 launcher tests with the launcher they exercise, and make the native-pin
assembly test use a ref that differs from the new source-lock fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@opendev9
opendev9 merged commit ffd5f71 into dev Oct 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant