Skip to content

chore(dev): developer ergonomic tools + shared composer cache volume#426

Merged
hideyukiMORI merged 2 commits into
mainfrom
chore/426-developer-ergonomics
May 22, 2026
Merged

chore(dev): developer ergonomic tools + shared composer cache volume#426
hideyukiMORI merged 2 commits into
mainfrom
chore/426-developer-ergonomics

Conversation

@hideyukiMORI
Copy link
Copy Markdown
Owner

セッション運用で boilerplate に消えていた時間を畳む小道具一式。任意採用、既存 workflow 互換、reversible

Composer scripts

  • `composer ci` = `test` + `test:http` + `analyze` + `format:check` の sequence
    • 既存 `composer check` が format:check を漏らしていたので、CI が走らせる厳密同等の boundary を local で確認するための alias
    • 本セッションで "format:check 漏れ → CI で fail → 再 push" を踏んだのが動機
  • `composer test:http / test` の `-- --filter` passthrough を doc 化 (既に動作)

Helper scripts (tools/)

  • `wait-healthy.sh [port] [timeout]` — `/health` 200 待ちの `until` loop boilerplate を 1 行に
  • `trial-status.sh FT-N` — Issue + PR を 1 view で
  • `error-code-add.php` — `config/error_codes.php` + `docs/development/error-codes.md` を atomic 更新 (FT10 F-5: error code catalog (php) と markdown 表の drift を test で検出する #352 drift gate 同時 pass、手動 2 ファイル更新を排除)
  • `tools/README.md` 新規 — 全 tool + composer script の 1 page リファレンス

Shared composer cache (前提 C 採用)

  • `compose.yaml` app service に external named volume `nene_composer_cache` を `/root/.composer/cache` に mount
  • `nene-ft-new.sh` が clone bootstrap 時に volume を lazy 作成 (`docker volume create` 不要)
  • vendor/ は per-project 維持、cache 対象は downloaded .zip のみ
  • 効果: 初回後の fresh `composer install` が ~30-45s → ~5s

A / B 判断 (maintainer 指示で現状維持)

  • A: CI paths-filter で docs PR の runtime-smoke skip → 現状維持
  • B: `schema:diff:dev` での DSN auto-fill → 現状維持 (ADR-0009 operator-explicit 原則)

Test plan

  • `composer ci` 全 step green (142/142 + 24/24 + Phan exit 0 + format 0 fix)
  • `composer test:http -- --filter HttpBearerAuthTest` で 5 cases に絞れる
  • `tools/wait-healthy.sh 8080 30` → OK (1s)
  • `tools/trial-status.sh FT17` → 4 issue + 4 pr 表示
  • `tools/error-code-add.php FAKE-CODE-TEST …` で両 file 更新 + drift gate pass を確認 → revert 済
  • `docker volume create nene_composer_cache` 経由で composer cache が container 内 `/root/.composer/cache` に shared mount

hideyukiMORI and others added 2 commits May 23, 2026 02:53
セッション運用で boilerplate に消えていた時間を畳む小道具一式。任意採用
(既存 workflow 互換)、reversible。

### Composer scripts

- **composer ci** = test + test:http + analyze + format:check の sequence
  - 既存 composer check が format:check を漏らしていたので、CI が走らせる
    厳密同等の boundary を local で確認するための alias
  - 本セッションで "format:check 漏れ → CI で fail → 再 push" を 1 回踏んだ
    のが動機
- composer test:http / test の filter passthrough を doc 化
  - 既に composer 2 が "-- --filter Foo" を forward していたので新 surface
    不要、tools/README.md に明文化のみ

### Helper scripts (tools/)

- wait-healthy.sh [port] [timeout] — /health 200 待ち boilerplate を 1 行に
  (本セッション中に 20 回以上書いた until-loop を畳む)
- trial-status.sh FT-N — Issue + PR を 1 view で (gh issue + gh pr の
  別々呼び出しを 1 つに)
- error-code-add.php — config/error_codes.php と
  docs/development/error-codes.md を atomic に更新 (#352 drift gate を
  pass する形で)、手動 2 ファイル更新の dance を排除
- tools/README.md 新規 — 全 tool + composer script の 1 page リファレンス
  + 追加方針

### Shared composer cache (C 採用)

- compose.yaml の app service に external named volume
  nene_composer_cache を /root/.composer/cache に mount
- nene-ft-new.sh が clone bootstrap 時に volume を lazy 作成
- 各 clone の vendor/ は per-project 維持 (composer.lock 差異対応)、
  キャッシュ対象は downloaded .zip のみ
- 効果: 初回後の fresh composer install が ~30-45s → ~5s に短縮

### Verification

- composer ci 全 step green (test 142/142 + test:http 24/24 +
  analyze + format:check)
- composer test:http -- --filter HttpBearerAuthTest で 5 cases のみ走る
- tools/wait-healthy.sh 8080 30 → OK (1s)
- tools/trial-status.sh FT17 → 4 issue + 4 pr 表示
- tools/error-code-add.php FAKE-CODE-TEST "..." 418 "..." → 両 file 更新
  + composer test (drift gate) pass、その後 git checkout で revert 検証
- docker volume create nene_composer_cache → compose up app → composer
  cache が /root/.composer/cache に shared mount される確認

### A / B (現状維持)

- A (CI paths-filter): docs-only PR で runtime-smoke skip しない方針
- B (schema:diff dev DSN auto-fill): ADR-0009 operator-explicit 維持

Closes #426. (issue がまだ無いのでこの PR で兼ねる)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…se up

#426 で導入した external named volume `nene_composer_cache` は
fresh CI runner には存在しないため `compose up` が `external volume not
found` で fail する。runtime-smoke job の compose 起動前に
`docker volume create nene_composer_cache` を idempotent に追加。

Local 開発者は tools/nene-ft-new.sh が同 lazy-create を行う。
@hideyukiMORI hideyukiMORI merged commit 5261847 into main May 22, 2026
2 checks passed
@hideyukiMORI hideyukiMORI deleted the chore/426-developer-ergonomics branch May 22, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant