refactor(workflows): extract shared Magento setup steps into a composite action
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
調査の方向性
Start with the reusable workflows integration.yaml and e2e.yaml (the latter from #313) and the run: steps that interpolate ${{ inputs.* }} directly into shell. The new composite action would be setup-magento-test-env/action.yml, and e2e-README.md needs its test_command default corrected. Done means both workflows call the shared action, injected expressions go through env:, the MySQL 5.7 .deb downloads are checksum-verified, and the artifact path derives from inputs.magento_directory. Because this is multi-part and depends on #313, confirm scope with a maintainer before starting.
索引モデルが issue の本文から書いたものです。
説明
Summary
The reusable workflows integration.yaml and the proposed e2e.yaml (#313) share ~90% of their step logic (services, PHP/Composer setup, Magento project creation, fixups, MySQL 5.7 downgrade, etc.). This duplication makes bugs harder to fix and increases maintenance burden as more workflow types are added.
We should extract the shared setup into a composite action (e.g. setup-magento-test-env) and have both workflows call it, fixing several long-standing issues along the way.
Issues to address during extraction
- Shell injection in
run:steps. Multiple steps interpolate${{ }}expressions directly into shell commands (e.g.composer create-project --repository-url="${{ inputs.magento_repository }}",echo ${{ steps.supported-version.outputs.matrix }}). These should useenv:blocks and reference shell variables instead, per GitHub's security hardening guide. - Unsigned MySQL 5.7 binary download. The MySQL 5.7 client downgrade step downloads
.debpackages viawget --quietwith no SHA256 checksum verification. Should pin expected hashes. - Internal actions pinned to
@main.mage-os/github-actions/get-magento-version@mainshould be pinned to a release tag or SHA.
Possible bugs
- Hardcoded artifact upload path. Both workflows use
path: /home/runner/work/infrastructure/magento2/dev/tests/…which is specific to a single repo and will be wrong for any external consumer. Should be derived frominputs.magento_directory. $GITHUB_WORKSPACEas input default. Workflow input defaults are literal strings, not shell-expanded.$GITHUB_WORKSPACEworks inrun:steps but would break if used in non-shell contexts (e.g.if:expressions or actionwith:blocks).- Missing
db-namesed replacement in e2e.yaml. The MySQL service createsmagento_e2e_testsbut the sed block doesn't update the database name ininstall-config-mysql.php.dist.
Documentation
- README examples reference
actions/checkout@v2— should be@v4. e2e-README.mddocumentstest_commanddefault as"../../../vendor/bin/phpunit"but the workflow defaults to"".
Proposed approach
-
Create a new composite action (e.g.
setup-magento-test-env/action.yml) that handles:- PHP + Composer setup
- Composer cache
- Magento project creation
- Version-specific fixups (Monolog, Dotmailer, Composer plugins, prestissimo)
- Package require + install
- Config sed replacements (parameterized for integration vs e2e paths)
- MySQL 5.7 client downgrade (with checksum)
-
Refactor
integration.yamlande2e.yamlto call the composite action, adding only their test-type-specific steps (phpunit vs Playwright, working directories, etc.). -
Fix all security and bug issues listed above in the shared action.
This also aligns with the direction discussed in #140 (reducing public workflow surface area).
Related
- #313 (E2E workflow PR)
- #140 (RFC: Removal of publicly-facing workflows)
- 主要言語
- TypeScript
- スター
- 12
- フォーク
- 15
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mage-os/github-actions のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
mage-os/github-actions#341 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
mage-os/github-actions#340 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
mage-os/github-actions#364 ·
-
難易度 3/5 半日 初心者へのやさしさ 65/100
mage-os/github-actions#363 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
mage-os/github-actions#359 · コメント 3 件 ·
mage-os/github-actions の issue をすべて見る
似ている issue
-
api bug priority:low ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wondermoney/wondermoney#862 ·
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
rootsiemen/seo-agent-tools#70 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
alvinunreal/oh-my-opencode-slim#1971 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
elecnix/bellwether#467 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信