mirror of
https://github.com/rommapp/romm.git
synced 2026-10-12 02:21:58 +00:00
* fix(config): migrate retired filesystem folder keys instead of exiting
5.2 wrote filesystem.roms_folder and filesystem.firmware_folder into
config.yml on every settings save, so instances that never chose a layout
crash-looped on 5.3.1. Appliance installs (TrueNAS, Unraid, CasaOS) have
no way to edit the file.
Translate the keys at load time into the filesystem.structure templates
that reproduce the layout 5.2 resolved them to, using the same disk check
5.2 used to choose between `<folder>/{platform}` and `{platform}/<folder>`.
A declared structure template still wins. The migrated config is written
back when config.yml is writable; otherwise it applies in memory and logs
the replacement once.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* fix(config): refuse folder names a template can't express before migrating
Addresses Greptile review on #5211: a retired folder name containing braces
produced an invalid template after config.yml had already been rewritten.
The migrated templates are now parsed first and startup exits with the
reason, leaving the file untouched. Also trims a test docstring.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* fix(config): code-review fixes for the retired folder key migration
Keep an undetectable layout in memory, accept a '.' folder, honour a
differently cased declared key, stop retrying a failed write, and share
the layout detection with check_library_layout.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* refactor(config): simplify pass over the retired folder key migration
Build the templates in one pass with a parser per key, reuse get_nested
and the library fixture, skip the layout string on the in-memory path,
and memoize a detected layout across get_config() calls.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* test(config): review-polish, drop a docstring that restates the test name
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* fix(config): migrate retired folder keys at startup and write config.yml atomically
Loading the config only translates the retired keys in memory now;
startup writes the migration once, before any worker runs, so processes
no longer race to rewrite config.yml.
config.yml is written to a sibling temp file and renamed over the
original, keeping a symlink and the file mode. When the rename fails
(a config.yml bind-mounted on its own), the in-place write puts the
previous content back if it fails, so a full disk no longer empties it.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* refactor(config): drop the atomic config write and flatten the folder key migration
The temp-file rename, symlink/mode handling and in-place restore are a
separate concern from migrating the retired keys, so config.yml goes back
to the plain write. The translation validates its two templates directly
instead of through a table of parsers.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>