Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .codex/devcontainer-recommendations.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ pnpmを使用する場合、以下の2つの設定方法があります:
```

**利点**:

- pnpmバージョン管理が明確
- node Featureとの依存関係を分離
- 最新のpnpm機能を即座に利用可能
Expand Down Expand Up @@ -321,6 +322,36 @@ pnpmを使用する場合、以下の2つの設定方法があります:
- 利用率: 75% (6/8)
- 必須ケース: Supabase使用プロジェクト全般

### Deno Runtime(Edge Functions開発)

```json
{
"ghcr.io/devcontainers-community/features/deno:1": {}
}
```

**バージョン**: 1 (最新のメジャーバージョン)

**利点**:

- **TypeScriptファーストサポート**: 設定不要でTypeScriptを直接実行可能
- **Supabase Edge Functions対応**: Supabase Edge Functionsの開発環境として必須
- **組み込みツールチェーン**: `deno fmt`(フォーマッター)、`deno lint`(リンター)、`deno test`(テストランナー)が標準搭載
- **セキュアデフォルト**: 権限システムによりファイルシステムやネットワークアクセスを明示的に許可
- **モダンエコシステム**: JSR (JavaScript Registry) との統合

**必須ケース**:

- Supabase Edge Functionsの開発
- DenoベースのWebアプリケーション
- TypeScript/JavaScriptのモダンランタイム環境が必要な場合

**参考リンク**:

- [Deno DevContainer Feature](https://github.com/devcontainers-community/features/tree/main/src/deno)
- [Deno公式ドキュメント](https://deno.com/)
- [Supabase Edge Functions](https://supabase.com/docs/guides/functions)

### E2Eテスト環境

```json
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"helm": "none",
"minikube": "none"
},
"ghcr.io/dhoeric/features/act:1": {}
"ghcr.io/dhoeric/features/act:1": {},
"ghcr.io/devcontainers-community/features/deno:1": {}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
},
"remoteEnv": {
"HOMEBREW_NO_AUTO_UPDATE": "1",
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/container-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ jobs:
security-events: write

steps:
- name: Free disk space before scan
run: |
echo "=== Disk space before cleanup ==="
df -h

docker system prune -af --volumes
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/share/boost || true

echo "=== Disk space after cleanup ==="
df -h
Comment on lines +32 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Consolidate duplicated disk cleanup logic.

The disk cleanup step is duplicated identically in both jobs. This violates DRY principles and creates a maintenance burden—any future adjustments to the cleanup logic must be applied in two places, increasing the risk of inconsistency.

Consider extracting this into a composite action or creating a reusable workflow step that both jobs can reference.

Example: Composite action approach

Create .github/actions/free-disk-space/action.yml:

name: 'Free Disk Space'
description: 'Clean up disk space on GitHub Actions runners'
runs:
  using: 'composite'
  steps:
    - name: Free disk space
      shell: bash
      run: |
        echo "=== Disk space before cleanup ==="
        df -h

        docker system prune -af --volumes
        sudo rm -rf /usr/local/lib/android || true
        sudo rm -rf /usr/share/dotnet || true
        sudo rm -rf /opt/ghc || true
        sudo rm -rf /usr/local/share/boost || true

        echo "=== Disk space after cleanup ==="
        df -h

Then replace both cleanup steps with:

- name: Free disk space
  uses: ./.github/actions/free-disk-space

That said, the cleanup approach itself is sound and appropriately addresses the CI disk capacity failures mentioned in the PR.

Also applies to: 103-115

🤖 Prompt for AI Agents
.github/workflows/container-security.yml lines 32-44 (also applies to lines
103-115): the disk cleanup step is duplicated across jobs; extract the cleanup
into a reusable composite action (e.g.,
.github/actions/free-disk-space/action.yml) that runs the same bash commands,
then replace both inline steps in the workflow with a single uses:
./.github/actions/free-disk-space reference so future changes are made in one
place.


- name: Checkout repository
uses: actions/checkout@v4

Expand Down Expand Up @@ -86,6 +100,20 @@ jobs:
packages: read

steps:
- name: Free disk space before SBOM generation
run: |
echo "=== Disk space before cleanup ==="
df -h

docker system prune -af --volumes
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/share/boost || true

echo "=== Disk space after cleanup ==="
df -h

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
Loading