Skip to content

docs(skills): Skill の欠落を補完(実害の出た落とし穴・アセットビルド規約の新設・検証手順) - #7008

Open
ttokoro20240902 wants to merge 9 commits into
4.4from
docs/skill-known-pitfalls-followup
Open

docs(skills): Skill の欠落を補完(実害の出た落とし穴・アセットビルド規約の新設・検証手順)#7008
ttokoro20240902 wants to merge 9 commits into
4.4from
docs/skill-known-pitfalls-followup

Conversation

@ttokoro20240902

@ttokoro20240902 ttokoro20240902 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Skill の棚卸しで見つかった欠落をまとめて埋めます。前提だった #7007(Skill 名の eccube- 接頭辞化)は 2026-07-30 に 4.4 へマージ済みで、本 PR は独立してレビューできます。

当初 #7009 として分けていた「アセットビルド規約の新設」「検証手順の補完」も、controller / entity / migration / service の 4 ファイルが本 PR と重なるため 1 PR に統合しました(#7009 は close)。

① 実害が出たのに Skill に載っていなかった落とし穴(5 件)

レビューや調査で実際に誤判断を招いた事実です。追記はすべて #7007 で定めた一般化テスト(固有のメソッド名・列名を消しても項目が成立するか)と 120 字の上限を当てています。

Skill 追記 誤判断の実例
eccube-security access_controlsecurity.yaml に存在せず、EccubeExtension::configureFramework()prependExtensionConfig() で動的に注入している。生成される 6 規則を表で明示 security.yaml だけを見て ^/mypage/ の認可が読めず、getUser() を null 可能と扱って「500 になる」と誤指摘した
eccube-controller 配列が来る可能性のある値を getString() でスカラー強制はできない(InputBag が非スカラーで例外を投げる) getString でスカラー強制すればよい」というレビュー提案が実際には機能しない
eccube-service / eccube-purchase-flow TransactionListener が 1 リクエスト=1 トランザクションで包み、コミットは kernel.terminateflush() は SQL 発行のみ 並行性・在庫ロックの議論で「flush 済み=確定」と読み替えてしまう
eccube-entity @deprecated なゲッタが CSV 出力項目(dtb_csv)のアクセサとして現役のことがある 非推奨 API の整理で、CSV 出力を支えているゲッタを未使用と判断しかけた
eccube-migration カラム追加へ ALTER を付けた前例(Version20260316234241)が実在するため「マイグレーション欠落 / 不要」を断定しない 「カラム追加なのにマイグレーションが無い=重大」と過剰指摘した

eccube-purchase-flow(12 項)と eccube-security(10 項)は「よくある間違い」が #7007 の上限に達しているため、追記ではなく本文側(基本ルール / アクセス制御モデル節)に書いています。

② アセットビルド規約が存在しなかった(新規 Skill eccube-asset

scss / style.css / npm run build に言及した Skill がゼロでした。一方で生成物はすべて git 管理下です。

生成物 追跡状況
html/template/*/assets/css/*.css *.min.css *.map 15 ファイル(.css は mode 100755 / .map は 100644)
html/bundle/ 783 ファイル

つまり .scss だけコミットすると実機のスタイルが変わりません。これは実害として発生しています。

さらに CI はこの不一致を検査しません。E2E のワークフロー(e2e-test.yml:122-123)は自分で npm ci && npm run build を実行するため、コミット済み生成物が古くても E2E は緑になります。「E2E が緑だから最新」と読めない点を明記しました。

内容はすべて実装で裏取りしています。

  • パイプライン: npm run build = gulp 既定タスク = series(scss, scss-min, webpack)
  • scss: sass → postcss(postcss-import / autoprefixer / postcss-sort-media-queries(mobile-first))→ 同階層の css/ へ出力
  • webpack: front / admin / install の 3 エントリ → html/bundle/*.bundle.js

postcss-sort-media-queries@media を並べ替え・統合するため、生成物に手書きで @media を足した差分は判別できます。レビューで「フルビルドか手書き追記か」を見分ける基準として記載しました。

③ 検証手順が無かった 7 Skill に「実行・確認方法」を追加

Skill 追加した確認手段
eccube-controller debug:router でルーティング登録を確認
eccube-entity doctrine:schema:update --dump-sqleccube:generate:proxies
eccube-formtype debug:form で構成・拡張の反映を確認
eccube-migration migratemigrate prevmigratedown() の往復と冪等性を確認
eccube-repository DQL/SQL を出して EXISTS の制約漏れ・件数の一致を確認
eccube-service debug:container で登録とデコレーションの解決先を確認
eccube-review-responsibility 差分の確定と、変更ファイルに絞った QA 実行

案内するコマンドは実在をコード側で確認しました(RouterDebugCommand / DebugCommand(debug:form) / ContainerDebugCommand / UpdateSchemaDoctrineCommand / MigrateCommand / GenerateProxyCommand)。推測で書いたコマンドはありません。

eccube-review-responsibility は対象の記載も無かったため追記しました(特定ディレクトリではなく「直前の変更差分」が対象であることを明示)。

自分の見立ての訂正: 棚卸しの初回報告で「対象節があるのは 18 件中 4 件のみ」としていましたが、これは ## 対象 という見出しだけを数えた誤りでした。対象パスはタイトル直後の **対象**: 行として 19 件に記載済みです。見出し形式への統一は内容が変わらないため行っていません。

④ CodeRabbit 指摘の反映(2 件・いずれも妥当)

  • eccube-security — ①で追記した「^/mypage/ 配下は ROLE_USER が前提」が一律の記述になっていましたが、同じ表に列挙した /mypage/login/mypage/withdraw_completeIS_AUTHENTICATED_ANONYMOUSLY で匿名到達できます。AccessMap::getPatterns() は最初に一致した規則で return する(first-match-wins)ことを実装で確認し、匿名ルートでは getUser() が null になり得る旨と、/mypage/change が逆に IS_AUTHENTICATED_FULLY で厳しい点を併記しました。追記自体の事実誤りだったため修正必須の指摘でした。
  • eccube-migration — 冒頭に「要否を断定しない」と書いた一方、「よくある間違い」側は ALTER を一律否定したままで矛盾していました。既定は不要のまま、既存行への既定値投入など理由があれば書いてよいことを反映しました。

検証

  • 引用したパス・クラスが 4.4 に実在すること(EccubeExtension.php / TransactionListener.php / Version20260316234241.php / dtb_csv.csveccube-asset の 17 ファイル)
  • access_control の 6 規則が EccubeExtension::configureFramework() の実装と一致し、security.yaml に記載が無いこと
  • AccessMap::getPatterns() が first-match-wins であること
  • 案内する console コマンド 6 クラスの実在
  • 「よくある間違い」の歯止め遵守(eccube-asset 8 項・最長 99 字。追記 3 項は 103 / 116 / 101 字)
  • 全 20 Skill が推奨構成(対象 / 実行・確認方法)を満たすこと

変更は Markdown のみで、PHP・設定ファイルへの波及はありません。

🤖 Generated with Claude Code

Summary by CodeRabbit

  • ドキュメント
    • EC-CUBEの各開発ガイドに、実装後の確認手順や品質チェック方法を追加しました。
    • トランザクション、認可ルール、送料無料判定、フォーム、リポジトリなどの注意点を明確化しました。
    • E2Eテストやプラグインで問題が発生した際の切り分け手順を追記しました。
    • コントリビューション用スキルを開発規約の一覧に追加しました。

レビューや調査で実際に誤判断を招いた事実が Skill に載っていなかったため追記する。
いずれも AGENTS.md の一般化テスト(固有のメソッド名・列名を消しても成立するか)と
120 字の上限を当てている。

- eccube-security: `access_control` は `security.yaml` に無く `EccubeExtension::configureFramework()`
  が動的に注入している。`security.yaml` だけを見ると `^/mypage/` が `ROLE_USER` 前提であることが
  読めず、`getUser()` を null 可能と誤検出する。生成される 6 規則を表で明示
- eccube-controller: 配列が来る値を `getString()` でスカラー強制はできない(`InputBag` が例外を投げる)
- eccube-service / eccube-purchase-flow: `TransactionListener` が 1 リクエスト=1 トランザクションで
  包み、コミットは `kernel.terminate`。`flush()` は確定ではない
- eccube-entity: `@deprecated` なゲッタが CSV 出力項目のアクセサとして現役のことがあり、削除は仕様変更
- eccube-migration: カラム追加へマイグレーションを付けた前例(`Version20260316234241`)が実在するため、
  レビューで「マイグレーション欠落 / 不要」を断定しない

`eccube-purchase-flow` は「よくある間違い」が既に 12 項で上限超過のため、追記ではなく
基本ルール節に置いた。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70aebbbd-10ee-43eb-b649-78dda2a41b85

📥 Commits

Reviewing files that changed from the base of the PR and between 7806e38 and 37f27fd.

📒 Files selected for processing (11)
  • .claude/skills/eccube-controller/SKILL.md
  • .claude/skills/eccube-e2e/SKILL.md
  • .claude/skills/eccube-entity/SKILL.md
  • .claude/skills/eccube-formtype/SKILL.md
  • .claude/skills/eccube-plugin/SKILL.md
  • .claude/skills/eccube-purchase-flow/SKILL.md
  • .claude/skills/eccube-repository/SKILL.md
  • .claude/skills/eccube-review-responsibility/SKILL.md
  • .claude/skills/eccube-service/SKILL.md
  • .claude/skills/eccube-twig-template/SKILL.md
  • AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • AGENTS.md
  • .claude/skills/eccube-purchase-flow/SKILL.md
  • .claude/skills/eccube-repository/SKILL.md
  • .claude/skills/eccube-formtype/SKILL.md
  • .claude/skills/eccube-review-responsibility/SKILL.md
  • .claude/skills/eccube-controller/SKILL.md

📝 Walkthrough

Walkthrough

EC-CUBEの開発Skill文書を更新しました。入力、認可、永続化、サービス処理、テスト、レビューの注意事項と確認手順を追加しました。AGENTS.mdにはeccube-contributingを登録しました。

Changes

開発規約ドキュメント更新

Layer / File(s) Summary
入力・フォーム・認可の確認ルール
.claude/skills/eccube-controller/SKILL.md, .claude/skills/eccube-formtype/SKILL.md, .claude/skills/eccube-security/SKILL.md, .claude/skills/eccube-twig-template/SKILL.md
リクエスト値の型検査、ルーティング、フォーム拡張、access_controlの適用順、BootstrapとjQueryのイベント連携に関する確認事項を追加しました。
永続化とサービス処理の確認ルール
.claude/skills/eccube-entity/SKILL.md, .claude/skills/eccube-migration/SKILL.md, .claude/skills/eccube-purchase-flow/SKILL.md, .claude/skills/eccube-repository/SKILL.md, .claude/skills/eccube-service/SKILL.md
トランザクション境界、スキーマ、プロキシ、CSVアクセサ、Paginator、サービス登録、品質確認の手順を追加しました。
実行確認とレビュー範囲の明確化
.claude/skills/eccube-e2e/SKILL.md, .claude/skills/eccube-plugin/SKILL.md, .claude/skills/eccube-review-responsibility/SKILL.md, AGENTS.md
E2Eフィクスチャ、プラグイン起動失敗、差分限定レビュー、機械的検査、eccube-contributingの登録方法を追加しました。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: dotani1111, nanasess

Poem

うさぎが規約をひらひら追加
型と認可を月まで確認
flushの境界、しっかり記録
テストの道を草で照らす
差分レビューで耳をぴん
きれいなSkillに、ぴょん!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning Skill ドキュメントの落とし穴と検証手順の追加を示しますが、アセットビルド規約の新設は本変更に含まれません。 アセットビルド規約の新設という記述を削除し、落とし穴・検証手順・Skill 一覧補完を中心にタイトルを修正してください。
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/skill-known-pitfalls-followup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.21%. Comparing base (aafc564) to head (37f27fd).

Additional details and impacted files
@@           Coverage Diff           @@
##              4.4    #7008   +/-   ##
=======================================
  Coverage   77.21%   77.21%           
=======================================
  Files         563      563           
  Lines       28111    28111           
=======================================
+ Hits        21705    21707    +2     
+ Misses       6406     6404    -2     
Flag Coverage Δ
Unit 77.21% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from docs/issue-6978-eccube-skill-prefix to 4.4 July 30, 2026 02:14
ttokoro20240902 and others added 2 commits July 30, 2026 11:24
SCSS / JS バンドルのビルドを扱う Skill が無く、`scss` `style.css` `npm run build` に
言及した規約がどの Skill にも存在しなかった。生成物(`html/template/*/assets/css/`
の `.css` `.min.css` `.map` と `html/bundle/`)はすべて git 管理されているため、
ソースだけコミットすると実機に反映されない。この取りこぼしは実害として発生している。

CI がこの不一致を検査しない点も明記した。E2E のワークフローは自分で `npm run build`
するため、コミット済み生成物が古くても緑になる(「E2E が緑だから最新」と読めない)。

内容はすべて実装で裏取りした:

- パイプライン: gulp 既定タスク = series(scss, scss-min, webpack)
- scss: sass → postcss(postcss-import / autoprefixer /
  postcss-sort-media-queries(mobile-first))→ 同階層 css/ へ出力
- webpack: front / admin / install の 3 エントリ → html/bundle/*.bundle.js
- 生成物のモード(`.css` は 100755 / `.map` は 100644)

`postcss-sort-media-queries` が @media を並べ替え・統合するため、生成物に手書きで
@media を足した差分は判別できる(レビューでフルビルドか手書きかを見分ける基準)。

AGENTS.md の Skill 索引表にも 1 行追加した。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AGENTS.md が推奨する構成のうち「実行・確認方法」が controller / entity / formtype /
migration / repository / service / review-responsibility の 7 件で欠けており、
実装後に何を実行して確かめるかが書かれていなかった。

各層で実際に効くコマンドだけを載せた(存在をコード側で確認済み):

- controller: debug:router でルーティング登録を確認
- entity: doctrine:schema:update --dump-sql と eccube:generate:proxies
- formtype: debug:form で構成・拡張の反映を確認
- migration: migrate → migrate prev → migrate で down() の往復と冪等性を確認
- repository: DQL/SQL を出して EXISTS の制約漏れ・件数の一致を確認
- service: debug:container で登録とデコレーションの解決先を確認
- review-responsibility: 差分の確定と、変更ファイルに絞った QA 実行

review-responsibility には対象の記載も無かったため追記した(特定ディレクトリではなく
「直前の変更差分」が対象であることを明示)。

なお当初「対象節が 18 件中 4 件のみ」と見立てていたが、これは `## 対象` という見出しだけを
数えた誤りだった。対象パスはタイトル直後の `**対象**:` 行として 19 件に記載済みで、
見出し形式への統一は内容が変わらないため行わない。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/eccube-migration/SKILL.md:
- Around line 35-39: Update the “よくある間違い” guidance in SKILL.md to remove the
blanket prohibition on ALTER TABLE migrations for added columns. State that such
migrations are generally unnecessary when schema:update handles the change, but
are acceptable when required to reliably populate defaults for existing rows or
for another explicit reason, and avoid asserting that a migration is always
missing or unnecessary.

In @.claude/skills/eccube-security/SKILL.md:
- Around line 35-36:
SKILL.mdの「/mypage/配下ではgetUser()が非null」とする説明を、IS_AUTHENTICATED_ANONYMOUSLYの例外を含む内容へ修正してください。/mypage/loginと/mypage/withdraw_completeでは匿名アクセスによりgetUser()がnullになり得るため、これらのルートではnull参照を確認し、それ以外のROLE_USER前提ルートと区別して説明してください。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eaaaa532-0573-4969-98ce-59f284bb8c56

📥 Commits

Reviewing files that changed from the base of the PR and between 615437c and a06a18e.

📒 Files selected for processing (6)
  • .claude/skills/eccube-controller/SKILL.md
  • .claude/skills/eccube-entity/SKILL.md
  • .claude/skills/eccube-migration/SKILL.md
  • .claude/skills/eccube-purchase-flow/SKILL.md
  • .claude/skills/eccube-security/SKILL.md
  • .claude/skills/eccube-service/SKILL.md

Comment thread .claude/skills/eccube-migration/SKILL.md
Comment thread .claude/skills/eccube-security/SKILL.md
いずれも妥当な指摘だったため修正した。

- eccube-security: 「`^/mypage/` 配下は `ROLE_USER` が前提」と一律に書いていたが、
  同じ表に列挙した `/mypage/login`・`/mypage/withdraw_complete` は
  `IS_AUTHENTICATED_ANONYMOUSLY` で匿名到達できる。`AccessMap::getPatterns()` は
  最初に一致した規則で return する(first-match-wins)ため、より上に並ぶこの 2 件が
  優先される。匿名ルートでは `getUser()` が null になり得る旨を追記し、
  `/mypage/change` が逆に `IS_AUTHENTICATED_FULLY` で厳しい点も併記した
- eccube-migration: 冒頭に「カラム追加のマイグレーション要否を断定しない」と書いた一方、
  「よくある間違い」側は ALTER を一律否定したままで矛盾していた。既定は不要のまま、
  既存行への既定値投入など理由があれば書いてよいことを反映した

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ttokoro20240902 ttokoro20240902 changed the title docs(skills): 実害の出た落とし穴を各 Skill に反映(認可の在り処・InputBag・トランザクション境界ほか) docs(skills): Skill の欠落を補完(実害の出た落とし穴・アセットビルド規約の新設・検証手順) Jul 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/eccube-asset/SKILL.md:
- Around line 1-3: Update the trigger description in the eccube-asset skill
metadata to distinguish html/template SCSS and JS files from repository-root
build definitions. List webpack.config.js, gulpfile.js, gulp/, and package.json
as root-level targets so edits to package.json also activate the skill, without
implying they are under html/template.
- Around line 53-54: Update the SCSS guidance in the relevant section of
SKILL.md to distinguish files excluded from the build from partials that are
included by the glob but not reflected in the style.scss/app.scss entry outputs.
Replace the assertion that unreachable .scss files are not build targets with
wording that accurately describes their omission from those entry-point outputs.

In @.claude/skills/eccube-repository/SKILL.md:
- Line 84: Update the PHPUnit command example in the repository testing
instructions to use a shell-safe, concrete placeholder such as
TargetRepositoryTest.php instead of angle-bracket syntax. Preserve the existing
tests/Eccube/Tests/Repository path and ensure the command can be executed
directly.
- Line 89: Update the testing guidance in the affected count/population rule so
filter-condition changes are not required to preserve the previous count.
Require tests to validate the expected count or consistency with the defined
population instead, while retaining the surrounding guidance and scope.

In @.claude/skills/eccube-review-responsibility/SKILL.md:
- Around line 80-83: テスト手順のPHPStan確認に、マージ前の全体解析としてvendor/bin/phpstan analyse
srcをlevel 6で実行する手順を追加してください。既存の変更ファイル向けvendor/bin/phpstan
analyse手順は維持し、全体確認も行う運用を明記してください。
- Around line 80-83: Update the PHP-CS-Fixer command in the checklist to use
--dry-run --diff instead of fix mode, so verification does not modify the
working tree while still showing proposed changes.
- Around line 75-78: .claude/skills/eccube-review-responsibility/SKILL.md
の差分確認手順で、ファイル単位の概要を表示する git diff --stat と git diff --cached --stat
に加え、変更内容の実体を表示する git diff と git diff --cached
も記載してください。既存のレビュー範囲を変更箇所に固定する説明は維持してください。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 69340c74-9492-4bb7-a8e5-19d8d198fd96

📥 Commits

Reviewing files that changed from the base of the PR and between a06a18e and 7806e38.

📒 Files selected for processing (10)
  • .claude/skills/eccube-asset/SKILL.md
  • .claude/skills/eccube-controller/SKILL.md
  • .claude/skills/eccube-entity/SKILL.md
  • .claude/skills/eccube-formtype/SKILL.md
  • .claude/skills/eccube-migration/SKILL.md
  • .claude/skills/eccube-repository/SKILL.md
  • .claude/skills/eccube-review-responsibility/SKILL.md
  • .claude/skills/eccube-security/SKILL.md
  • .claude/skills/eccube-service/SKILL.md
  • AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • .claude/skills/eccube-security/SKILL.md
  • .claude/skills/eccube-service/SKILL.md
  • .claude/skills/eccube-entity/SKILL.md
  • .claude/skills/eccube-controller/SKILL.md
  • .claude/skills/eccube-migration/SKILL.md

Comment thread .claude/skills/eccube-asset/SKILL.md Outdated
Comment thread .claude/skills/eccube-asset/SKILL.md Outdated
Comment thread .claude/skills/eccube-repository/SKILL.md Outdated
Comment thread .claude/skills/eccube-repository/SKILL.md Outdated
Comment thread .claude/skills/eccube-review-responsibility/SKILL.md
Comment thread .claude/skills/eccube-review-responsibility/SKILL.md Outdated
@dotani1111

dotani1111 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@ttokoro20240902

先に #7013(esbuild への移行)を取り込む方針にしたいと思います。
理由として、上記PRは gulp + webpack を丸ごと置き換えるためになります。

主に以下のファイルが削除されます。

  • gulpfile.js
  • gulp/config.js
  • gulp/task/scss.js gulp/task/scss-min.js gulp/task/webpack.js
  • webpack.config.js
     → esbuild.config.mjs に集約

このため、eccube-asset を esbuild ベースへの更新が必要になります。
取り込み後に調整をお願いします。

参考: #7013

esbuild 移行 (#7013) で gulpfile.js / webpack.config.js が削除されるため、
eccube-asset は esbuild ベースへの書き直しが必要になる(#7008 のレビュー指摘)。
本 PR に残すと esbuild 無関係な他 9 Skill の知見も一緒に足止めされるので、
eccube-asset だけを切り出して後続 PR に回す。

あわせて 4.4 時点で索引表から漏れていた eccube-contributing の行を追加した
(実ディレクトリ 19 に対し索引 18 だった)。
CodeRabbit 指摘対応。

- 山括弧プレースホルダ(`<対象>` 等)はシェルのリダイレクトとして解釈され、
  そのまま実行すると失敗するため、実在するパス・ルート名・サービス ID に置き換えた。
  指摘は eccube-repository のみだが、同型が controller / formtype /
  review-responsibility / service にもあったので横並びで直した。
- あわせて `bin/phpunit` を `vendor/bin/phpunit` に是正した。
  `bin/` には .htaccess / console / template_jp.php しか無く、実行できないため。
- eccube-repository: 「変更前後で件数が一致するか」を固定する記述を
  「期待件数または想定する母集団との整合性」に変更。絞り込み条件を変えれば
  件数が変わるのは正常で、正しい変更まで不正として固定してしまうため。
- eccube-review-responsibility: `git diff --stat` だけでは変更行が確定できないため
  `git diff` / `git diff --cached` を併記。PHPStan は「実装中は絞る/PR 前に src 全体」
  の 2 段階にした(CI は src 全体を解析するため絞ったままでは見落とす)。
- eccube-e2e: setup-fixtures.php は各ブロックに try-catch を持たない直列スクリプトで、
  途中で Fatal になると以降のフィクスチャが未生成になり無関係なスイートが連鎖的に落ちる。
  global-setup.ts は失敗を catch して警告するだけで実行を止めないため spec 側の不具合に見える。
- eccube-plugin: Kernel::registerBundles() は DB の有効/無効を見ず app/Plugin 直下を
  Finder で列挙し bundles.php を require するため、依存欠落でカーネル起動自体が失敗する。
- eccube-entity: TraitProxyAttributeDriver は未宣言のときだけ Proxy を require_once する。
  まっさらな状態では再現しないので、再現には対象を事前ロードした状態を作る必要がある。
- eccube-service: StockReduceProcessor の悲観ロックのガードに使う
  ProductStock::$product_class_id は #[ORM\Column] を持たない非永続プロパティなので、
  DB から読むと常に null でロックは毎回走る(条件付き=デッドコードではない)。
- eccube-purchase-flow: 送料無料は DeliveryFeeFreePreprocessor がカート合計と比較する
  条件であり、商品単位の性質ではない。
- eccube-controller: 削除時の外部キー違反はコアが catch (\Exception) +
  delete_error_foreign_key で統一している。
- eccube-twig-template: Bootstrap 5.3 と jQuery は併存しており、コアの管理画面
  テンプレート 10 以上が $(...).on('show.bs.modal') で動いている。
CartService だけでは Eccube\Service\CartService と
Eccube\Twig\Extension\CartServiceExtension の 2 件に一致し、
非対話環境では Aborted で終わるため実際に動かない。
@ttokoro20240902

Copy link
Copy Markdown
Contributor Author

@dotani1111 ご指摘ありがとうございます。方針を承知しました。

esbuild への移行が必要なのは eccube-asset のみで、本 PR に含まれる他 9 Skill の知見は esbuild の影響を受けないため、eccube-asset だけを本 PR から分離しました

これで本 PR は #7013 と独立してレビュー・取り込みが可能になります。お手数ですが、先に本 PR をご確認いただけますでしょうか。

あわせて以下も対応しました。

  1. CodeRabbit の指摘(山括弧プレースホルダ)を横並びで修正 — 指摘は eccube-repository のみでしたが、同じ書き方が controller / formtype / review-responsibility / service にもあったため、実在するパス・ルート名・サービス ID に置き換えて 5 ファイルまとめて直しました。debug:container は部分一致だと候補が複数出て対話待ちになるため FQCN 指定にしています。
  2. bin/phpunitvendor/bin/phpunit に是正bin/ には .htaccess / console / template_jp.php しか無く、本 PR で追加した実行例がそのままでは動きませんでした。AGENTS.md「開発コマンド」と eccube-contributing / eccube-phpunit にも同じ記述が残っていますが、そちらは improvement: deprecation ゲート有効化+未使用の非推奨 public API 削除 (#6933) #6937 が是正しているため本 PR では触っていません。
  3. eccube-contributing の索引漏れを補完 — 4.4 時点で実ディレクトリ 19 に対し AGENTS.md の索引表が 18 行で、eccube-contributing が抜けていたため追加しました。
  4. 未反映だった落とし穴を 7 件追記 — いずれも 4.4 の実コードで裏取りしています。
Skill 内容
eccube-e2e setup-fixtures.php が途中で Fatal になると以降のフィクスチャが未生成になり無関係なスイートが連鎖的に落ちる。global-setup.ts は失敗を握り潰して続行するため spec 側の不具合に見える
eccube-plugin Kernel::registerBundles() は DB の有効/無効を見ずに app/Plugin 直下を走査するため、依存欠落でカーネル起動自体が失敗する
eccube-entity trait Proxy 由来の不具合はクラスが宣言済みのときだけ顕在化する(まっさらな状態では再現しない)
eccube-service StockReduceProcessor の悲観ロックのガードに使う ProductStock::$product_class_id は非永続プロパティなので、DB から読むと常に null でロックは毎回走る
eccube-purchase-flow 送料無料はカート合計に対する条件で、商品単位の性質ではない
eccube-controller 削除時の外部キー違反はコアが catch (\Exception)delete_error_foreign_key で統一している
eccube-twig-template Bootstrap 5.3 と jQuery は併存しており、コアの管理画面テンプレート 10 以上が $(...).on('show.bs.modal') で動いている

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.

2 participants