feat(build): build/rebuild/up の再ビルド仕様を統一 (i07)#74
Merged
Conversation
キャッシュの扱いを3モードに整理:
- devbase build : キャッシュビルド (常に実行)
- devbase build --no-cache: 無条件で base/project とも no-cache
- devbase build --expires=n: n日未満は再ビルドせず、n日以上のみ no-cache
(親イメージ FROM devbase-* は作成日で独立判定)
devbase rebuild を build --expires=7 のシノニムに、devbase up の自動準備を
その rebuild 相当に集約。共通リゾルバ _build_with_expires に一本化した。
- container.py: _build_with_expires / _build_resolved / _resolve_dev_service を
追加。cmd_rebuild は素の compose build --no-cache をやめ期限判定へ。cmd_build に
--no-cache / --expires を追加。_ensure_images (up) を共通リゾルバへ委譲。
- cli.py: build parser に --no-cache / --expires[=DAYS] を追加。
- bin/devbase: build --expires は作成日判定のため Python(project build)へ委譲。
- docs/CHANGELOG/issues/i07.md: 3モード仕様を反映。
- tests: _build_with_expires/_build_resolved のテスト追加、--base-cache 幻引数の
否定アサーションを削除。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
takemi-ohama
commented
Jun 24, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 1 | codex | COMMENT
修正提案はインラインコメントに記載しました。
takemi-ohama
commented
Jun 24, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 1 | gemini | APPROVE
アーキテクチャの再設計(Pythonへの集約と3モード整理)が綺麗に行われており、テストも網羅的です。機能面は問題ありませんが、CLI の help テキストの追従漏れや引数バリデーションなど、主にユーザビリティ・堅牢性の観点でいくつか提案をインラインに残しました。
…排他化 ほか (PR#74) - rebuild の add_parser help を実態 (build --expires=7 相当) に合わせて更新 (cli.py) - --no-cache / --expires を add_mutually_exclusive_group で CLI レベル排他化し、 併用時は usage error で落とす (silent no-cache を防止) (cli.py) - 単体ビルド (image 指定) 時に --expires 併用を warn ログで通知 (container.py) - Dockerfile FROM 抽出正規表現を小文字 from / --platform フラグ許容に堅牢化 (container.py) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
cross-review 最終スイープ (Step 7.5) 完了最終 APPROVE ラウンドで残っていた open review thread 5 件をすべて対応・Resolve しました。未解決スレッドは 0 件 です。 対応内訳 (commit d941d90)
サマリ
|
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.
概要
devbase build/devbase rebuild/devbase upの再ビルド機構が混乱していたため、キャッシュの扱いを 3 モードに整理し、rebuild/upをbuild --expiresに集約して仕様を統一しました(issues/i07.md)。関連 Issue
変更点
FROM devbase-*)devbase builddevbase build --no-cachedevbase build --expires=ndevbase rebuild=devbase build --expires=7のシノニム化。従来の素のdocker compose build --no-cacheをやめ、devbase-base の 2 段ビルド + 期限判定(期限内はスキップ)に変更。devbase upの自動準備をrebuild相当に集約。共通リゾルバ_build_with_expiresに一本化(「7 日未満は再ビルドしない」既存挙動は維持)。devbase buildに--no-cache/--expires[=DAYS]を追加。--expiresは作成日判定が必要なため Python(project build)経路へ委譲。container.py:_build_with_expires/_build_resolved/_resolve_dev_serviceを追加、cmd_rebuild/cmd_build/_ensure_imagesを更新。cli.py: build parser に--no-cache/--expiresを追加。bin/devbase: top-levelbuild --expiresのルーティング追加。_build_with_expires/_build_resolvedのテスト追加、--base-cache幻引数の否定アサーションを削除。動作確認
uv run python -m pytest tests/全 827 件パスbash -n bin/devbase(構文チェック)OK--no-cache/--expires[=DAYS]を正しく解釈することを確認devbase up/devbase rebuild/devbase build --expiresの手動確認補足
devbase upはbuild:定義サービスでイメージが期限内(既定 7 日未満)なら再ビルドせず既存イメージで起動し、期限切れのみ再ビルドします(rebuild=build --expires=7と同一挙動)。