Repository navigation
#458 を実装する(スプリント m8b) - #469
Merged
Merged
Conversation
前の snapshot.snar を引き継がずに full.tar.zst.new・snapshot.snar.new へ控え、 成功したら状態ファイル → 差分(番号の大きい順)→ 印付きの meta.yml → full → 印無しの meta.yml → 状態ファイルの順に入れ替える。印のある世代は restore が消去の 前に止める。テストの docker の差し替えは、書くファイルの名前をコマンドから拾う。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
takemi-ohama
marked this pull request as ready for review
October 12, 2026 14:13
This was referenced Oct 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
snapshot で既にある世代へ
--fullを指定したとき、その世代を full で作り直せるようにしました。作り直しでは、元の世代をいったん仮の名前で控え、新しい世代ができてから入れ替えます。この PR は #458 として、スプリント m8b のブランチへ集めます。利用者向けの変化
--fullを指定すると、その世代を full で作り直す移行の手順
変更の要点
lib/devbase/snapshot/manager.py: 既にある世代へ full を作る場合の処理を足しました。元の世代を仮の名前へ控え、作成後に入れ替えます。docs/specifications/snapshot-series.mdに世代の作り直しを書きました。backup_commandの引数と構成要素にも足しています。docs/specifications/snapshot-exclude.mdも合わせて直しました。docs/user/cli-reference/05-snapshot.mdとdocs/user/snapshot-guide.mdに、既存の世代への--fullの作り直しを書きました。CHANGELOG にも書いています。テスト
tests/snapshot/test_rebuild_generation.pyを足しました。世代の作り直しについて、成功・失敗・印を縛ります。tests/snapshot/test_backup_real_tar.pyでは、実の tar の中身を縛ります。tests/snapshot/fake_tar.pyと既存の snapshot のテストを、変更に合わせて直しました。設計と違う点
meta.yml・snapshot.yml)は変えていないが、既存の 6 つのテスト(test_archive_layout.pyほか)の docker の差し替えを、決め打ちのfull.tar.zst・snapshot.snarではなくコマンドに書かれた名前へ書く共通のtests/snapshot/fake_tar.pyに替えたsnapshot.snar.newができず入れ替えが失敗する。期待の側は 1 文字も変えていない設計の決定と違えたところ
_full_meta(新しい世代と作り直しで同じmeta.ymlの中身を組む)・_has_previous_files(作り直すかの判定。決定 3)・_replace_snap_meta(meta.yml.newへ書いてos.replaceする。設計では_install_rebuilt_fullの中で行うとしていた処理を切り出した)。振る舞いは設計のとおりFULL_ARCHIVE_TMP・SNAR_FILE_TMP・META_FILE_TMP)に、SNAP_META_FILE(meta.yml)とREBUILDING_KEY(rebuilding)を足したfull.tar.zst・snapshot.snar)で置いていた。作り直しは仮の名前へ書くため、コマンドの-oと--listed-incremental=から名前を拾う共通の関数tests/snapshot/fake_tar.pyに揃えたdocs/glossary/glossary.json・docs/glossary.mdは変えていない手で確かめたこと
tests/snapshot/test_backup_real_tar.pyに足した 3 件。受け入れ条件 1・2・7)は macOS の手元では飛ぶため、python:3.12-slimに zstd を入れたコンテナで走らせ、通ることを確かめた。同じテストを変更前のmanager.pyで走らせると 3 件とも落ちることも確かめたenv -u DEVBASE_ROOT uv run --locked pytest tests/ -q: 4251 passed, 27 skippeduvx ruff check --select=E9,F63,F7,F82 lib: 通ったchangelog_check.py)は pull_request のイベントでしか走らないため、手元では走らせていない残した事項
devbase-snapshotのコンテナで、作業用の名前の世代へ--fullを 2 回打って作業用のボリュームへ復元する確認は、リリース後テストで行う(要求の検証手段)CHANGELOG.mdで条件と取り直しを案内した。承認ゲートで利用者が決めるモード: standard / 通した工程: 実装 → 完了判定 → Pull Request
🤖 Generated with Claude Code