fix: setup-claude.shを/usr/local/binに配置してfeatures適用後も保持 - #182
Conversation
## 問題 - /tmp/setup-claude.shがDevContainerのfeatures適用時にクリアされる - docker-in-docker, git, python等のfeaturesを追加すると/tmpが初期化される ## 根本原因 - DevContainerがfeaturesを適用する際、新しいレイヤーを作成 - このプロセスで/tmpディレクトリの内容が失われる ## 解決策 - setup-claude.shを/usr/local/binに配置(永続的なディレクトリ) - 実行権限を付与 - postCreateCommandで/usr/local/bin/setup-claude.shを呼び出す ## 変更内容 - Dockerfile: /tmp/setup-claude.sh → /usr/local/bin/setup-claude.sh - devcontainer.json: postCreateCommandのパスを更新 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe setup-claude.sh script is relocated from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
プルリクエスト レビューこのPRを確認しました。 ✅ 良い点1. 根本原因の正確な理解と適切な解決策
2. 適切な権限設定COPY --chown=root:root script/setup-claude.sh /usr/local/bin/setup-claude.sh
RUN chmod +x /usr/local/bin/setup-claude.sh
3. 詳細なPR説明
🔍 改善提案1. セキュリティ考慮事項 (MEDIUM)問題点: COPY --chown=root:root script/setup-claude.sh /usr/local/bin/setup-claude.sh
RUN chmod +x /usr/local/bin/setup-claude.sh推奨: スクリプトの実行権限を最小化 COPY --chown=root:root --chmod=755 script/setup-claude.sh /usr/local/bin/setup-claude.sh理由:
2. スクリプトの堅牢性向上 (LOW)現状: if ! command -v claude &> /dev/null; then
log_warn "Claude CLI が見つかりません。プラグインのインストールはスキップされます。"
exit 0
fi推奨: より詳細なエラーハンドリング if ! command -v claude &> /dev/null; then
log_warn "Claude CLI が見つかりません。プラグインのインストールはスキップされます。"
log_info "PATH: $PATH"
exit 0
fi理由: デバッグ時にPATH情報があると問題の特定が容易 3. CI/CD 検証 (HIGH)test plan チェックリスト未完了:
推奨アクション:
4. テストカバレッジ (MEDIUM)現状: DevContainer関連の自動テストが見当たらない 推奨: # .github/workflows/devcontainer-test.yml (新規作成を検討)
name: DevContainer Validation
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build DevContainer
run: docker build -f .devcontainer/Dockerfile .
- name: Verify setup-claude.sh location
run: docker run --rm $(docker build -q -f .devcontainer/Dockerfile .) ls -la /usr/local/bin/setup-claude.sh理由: インフラ変更の回帰テストを自動化し、CLAUDE.mdの70%カバレッジ要件に近づける 📋 コードスタイルConventional Commits準拠 ✅
🔒 セキュリティチェック良好な点 ✅
懸念点なし🎯 パフォーマンス影響評価
📊 総合評価
✨ 推奨アクションマージ前に実施すべき項目
将来的な改善項目(別PR推奨)
🚀 結論承認推奨: このPRは技術的に健全で、明確な問題を適切に解決しています。 上記の軽微な改善提案を適用すれば、さらに堅牢になりますが、現状でもマージ可能な品質です。CI/CD成功確認後のマージを推奨します。 レビュアー: Claude Sonnet 4.5 |
|
🎉 This PR is included in version 1.8.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
問題
DevContainerで
/tmp/setup-claude.shが存在しないため、プラグインがインストールされない問題がありました。根本原因
v1.8.1イメージには
/tmp/setup-claude.shが含まれている(確認済み)しかし、
devcontainer.jsonで以下のfeaturesを指定:docker-in-dockergitop(1Password)github-clipythonDevContainerがfeaturesを適用する際、新しいレイヤーを作成し、
/tmpディレクトリがクリアされる解決策
/tmpではなく永続的なディレクトリ/usr/local/binにスクリプトを配置します。変更内容
1. Dockerfile
変更前:
COPY --chown=vscode:vscode script/setup-claude.sh /tmp/setup-claude.sh変更後:
2. devcontainer.json
変更前:
変更後:
期待される動作
/usr/local/bin/setup-claude.shがfeatures適用後も保持される/pluginコマンドで9個のプラグインが表示されるTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.