Repository navigation
#444 を実装する(スプリント m10b) - #448
Merged
Merged
Conversation
控えの項目の 3 つの経路のうち、aws_profiles の分岐と控えの無い分岐を _aws_plan_for_selection・_aws_plan_for_unregistered へ抜き出し、入れ子の report の関数をモジュールの関数へ出した。振る舞いは変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_target_group と TUI の group_attrs に重なっていた storage_group の検査と 誤りの文の組み立てを 1 つの関数にした。TUI の前段(validate_account_group)は account_rule で選ぶ。先に CLI と TUI の誤りの文を丸ごと固定するテストを足した。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_mask_secret_environment は形を求めて対応表の関数を呼び、返った値を置くだけにした。 形ごとの式と警告の文は変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
project_name・scale・dev_service_name・compose_file を凍結した dataclass に まとめ、_run_post_start の引数を 4 個にした。個々の処理への引数と順は変えない。 確定仕様の関数の形も合わせた。 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>
見出し・変数・件数の行を _print_env_section で出し、共通とプロジェクトの 節の選び方を別の関数へ抜き出した。先に節の出力を丸ごと固定するテストを足した。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R12) test_compose_vscode.py と test_compose_group.py に重なっていた write_compose・ load_scaled・mount_source を conftest.py へ移し、両方から取り込む。期待値は変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ログインを _login、KV の書き込みを _write_secret へ振り分け、書き込みの前の 拒否と CAS の更新を更に抜き出した。応答と順は変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
takemi-ohama
marked this pull request as ready for review
October 8, 2026 08:30
This was referenced Oct 8, 2026
Merged
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.
#444 のリファクタリング 13 件(R1〜R13)をスプリント m10b のブランチへ集めます。長い関数から段を抜き出し、引数をまとめ、形ごとの処理を対応表へ分けました。あわせてテストの補助を 1 か所に寄せています。
利用者向けの変化
移行の手順
変更の要点
_aws_sync_planは_SyncContextを受け取って振り分けるだけにしました(R1)。_ENV_MASKERSへ分けました(R3・R4)。_ComposeDeploymentにまとめました(R5)。docs/specifications/post-start.mdもこれに合わせて直しました。--groupの名前の検証をcheck_group_optionにまとめました(R2)。env keygenから次の 3 つを抜き出しました(R7)。tui/actions_env_keys.pyもこれに合わせています。env listの節の出し方を 1 つの関数にまとめました(R8・R9)。tests/volume/conftest.pyの 1 か所にまとめました(R11・R12)。do_POSTを経路ごとの関数に分けました(R13)。tests/cli/tui/test_actions_env_keys.py・tests/commands/test_env_sync_group.py・tests/commands/test_env_user_axis.pyにテストを足しました。テスト
モード: standard / 通した工程: 実装 → 完了判定 → Pull Request
🤖 Generated with Claude Code
測定(変更の前後)
コマンド:
uvx ruff check --select C901 --config 'lint.mccabe.max-complexity=0' <ファイル>(C901)・uvx complexipy <ファイル> --output-format json(認知的複雑度)・astの lineno/end_lineno と引数の数(self を除く)。スクリプトは measure.pylib/devbase/commands/env.py#_aws_sync_planlib/devbase/commands/env.py#_aws_plan_for_selectionlib/devbase/commands/env.py#_aws_plan_for_unregisteredlib/devbase/commands/env.py#_report_unknown_profileslib/devbase/commands/env.py#_report_profile_conflictslib/devbase/commands/env.py#check_group_optionlib/devbase/commands/env.py#_target_grouplib/devbase/tui/actions_env_keys.py#group_attrslib/devbase/volume/compose.py#_mask_secret_environmentlib/devbase/volume/compose.py#_mask_env_nonelib/devbase/volume/compose.py#_mask_env_dictlib/devbase/volume/compose.py#_mask_env_listlib/devbase/volume/compose.py#_mask_env_otherlib/devbase/commands/container.py#_run_post_startlib/devbase/commands/env.py#_collect_from_env_ymllib/devbase/commands/env.py#_generated_secretlib/devbase/commands/env.py#_prompt_env_varlib/devbase/commands/env.py#cmd_env_keygenlib/devbase/commands/env.py#_show_existing_keylib/devbase/commands/env.py#_refuse_unreadable_keylib/devbase/commands/env.py#_confirm_key_regenerationlib/devbase/commands/env.py#cmd_env_listlib/devbase/commands/env.py#_print_env_sectionlib/devbase/commands/env.py#_list_global_sectionslib/devbase/commands/env.py#_list_project_sectionslib/devbase/snapshot/manager.py#SnapshotManager.restorelib/devbase/snapshot/manager.py#SnapshotManager._restore_sourcelib/devbase/snapshot/manager.py#SnapshotManager._apply_incrementalstests/volume/conftest.py#write_composetests/volume/conftest.py#load_scaledtests/volume/conftest.py#mount_sourcetests/conftest.py#_Handler.do_POSTtests/conftest.py#_Handler._logintests/conftest.py#_Handler._write_secrettests/conftest.py#_Handler._refuse_writetests/conftest.py#_Handler._apply_cas対象の 6 ファイル(と tests/volume の 2 つのテスト)の既存の関数で、C901・認知的複雑度が上がったものは 0 件。
R11・R12: tests/volume/test_compose_vscode.py・test_compose_group.py に _write_compose・_load_scaled・_mount_source の定義は無い(grep で 0 件)。
R8・R9 の
cmd_env_listの引数 7 個は CLI の引数をそのまま受ける形で、表の兆候(duplication・long_method)には含まれない。現状固定のテストを先に足した経路(設計の決定 11): CLI の
--group global・--group 1234の誤りの文、TUI で1234・projectsを入れたときの誤りの行、env listの節の出力(変数の無い節と--keys-onlyを含む)。変更の前のコードで通ることを確かめた。固有の語の検査は手元では語の一覧が無く飛ばされた(検査していない)。CI の Proper term check の結果で確かめる。