Repository navigation
#490 を実装する(スプリント m8e) - #493
Merged
Merged
Conversation
#463 で VS Code Server のボリュームが共通の 1 本になり、project_name は どこからも読まれていなかった。呼び出し元とテストの引数の受け渡しの期待を 合わせて直す。ボリュームの名前・作る順・作る数は変わらない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devbase_prune_vscode_server_bin にあった 3 つの選別規則(古い版の削除・ 入れ子の本体の削除・展開の途中のディレクトリの削除)を、それぞれの関数へ 分ける。devbase_prune_vscode_server_bin の名前・引数・出力・消す対象は 変わらない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
スプリント m8e の作業として、#490 の 2 つのリファクタリングをまとめました。
ensure_volumesとVolumeManagerから使われていない引数project_nameを外しました。また、containers/base/entrypoint.shの VS Code Server の片付けを、選別規則ごとの関数に分けました。利用者向けの変化
移行の手順
変更の要点
lib/devbase/volume/manager.pyensure_volumesとVolumeManagerから、使われていないproject_nameを外しました。lib/devbase/commands/container.pyも合わせて直しました。containers/base/entrypoint.shtests/commands/test_container_scale_order.pytests/volume/test_manager_ensure_volumes.pytests/volume/test_manager_vscode.pyテスト
設計と違う点
何を変えたか
lib/devbase/volume/manager.pyのVolumeManager.__init__とモジュールの関数ensure_volumesから、使われないproject_nameの引数とself.project_nameを外した。呼び出し元のlib/devbase/commands/container.py(_run_deploy_pipeline・_run_scale_pipelineの 2 か所)も合わせて直した。get_volume_for_indexなどほかの「互換のために残す」引数には触れていないcontainers/base/entrypoint.shのdevbase_prune_vscode_server_binを、選別規則ごとの 3 つの関数に分けたdevbase_prune_vscode_server_old_versions: 残す数を超えた古い版を消し、残した版の名前を新しい順に標準出力へ出すdevbase_prune_vscode_server_nested: 残した版(標準入力から読む)の直下の入れ子の本体を消すdevbase_prune_vscode_server_partial: 60 分より古い展開の途中のディレクトリを消すdevbase_prune_vscode_server_binの名前・引数・出力(WARNING は標準エラー)・消す対象と順序(規則 1 → 2 → 3)は変わらない。古い版の削除が終わってから入れ子の片付けに入る順序も保つため、残した版の名前は一度変数へ受けてから渡している(パイプにしていない)ボリュームの名前・作る順・作る数は変わらない。利用者に見える振る舞いは変わらないため
CHANGELOG.mdは書いていない。直したテストと理由
引数の受け渡しの期待だけを直した。ボリュームの名前の期待は変えていない。
tests/commands/test_container_scale_order.pyのtest_scale_passes_explicit_project_nameproject_nameがensure_volumesに渡る」の期待を、「ensure_volumesには scale だけが渡る((2,))」に変えた。_build_scaled_override・_push_bao_tokenに渡る期待は元のままensure_volumesがproject_nameを受け取らなくなったためscale_harnessのensure_volumesの差し替えlambda scale, project:をlambda scale:にtests/volume/test_manager_vscode.pyensure_volumes(..., project_name=...)からproject_nameを外した。最初のテストの名前と docstring から「プロジェクト」を外した(test_shared_volume_is_created_once_for_any_group_and_scale)tests/volume/test_manager_ensure_volumes.pyVolumeManager("proj-a")をVolumeManager()に、ensure_volumes(1, project_name="proj-a", group="team-b")をensure_volumes(1, group="team-b")にtests/containers/test_entrypoint_vscode_server.pyには手を入れずに通した(18 件)。手で確かめたこと
env -u DEVBASE_ROOT uv run --locked pytest tests/ -q: 4402 passed, 32 skippedruff check --select=E9,F63,F7,F82 lib: 通ったdevbase-base:latestの shellcheck でcontainers/base/entrypoint.sh: 指摘なしpython3 .github/scripts/proper_term_check.py: 「語の一覧が無いため飛ばした」と出た。検査したとは数えていない残した事項
devbase upも打っていない。建て直したイメージでの確かめ(実のイメージ+使い捨てボリュームのdocker runで片付けが同じ対象を消すこと)はリリース後テストで行うdocs/specifications/vscode-server-volume.mdのテストの表(ensure_volumesを「違うプロジェクト名・違うグループ・scale 2 で呼んでも」の行)は、この変更でプロジェクト名を変えて呼べなくなったため、文言が今の実装と少しずれる。触る範囲の外のため直していないモード: standard / 通した工程: 実装 → 完了判定 → Pull Request
🤖 Generated with Claude Code