Skip to content

fix: CI 復旧 (actions/cache@v4) と 4.3 でのテスト失敗・Bootstrap 5 クラス名の修正 - #201

Open
ttokoro20240902 wants to merge 3 commits into
4.2from
fix/4.2-ci-and-bootstrap5-margin
Open

fix: CI 復旧 (actions/cache@v4) と 4.3 でのテスト失敗・Bootstrap 5 クラス名の修正#201
ttokoro20240902 wants to merge 3 commits into
4.2from
fix/4.2-ci-and-bootstrap5-margin

Conversation

@ttokoro20240902

Copy link
Copy Markdown

概要

default ブランチ (4.2) の CI が壊れていたため、CI の復旧EC-CUBE 4.3 との組み合わせで失敗していたテストの追随Bootstrap 5 のクラス名修正を行います。

Bootstrap のクラス名修正は #197 のレビューで nanasess から指摘された既存不具合(4.4 対応ブランチ側は #197 に同梱済み)を default ブランチにも反映するものです。

(当初 #200 として出しましたが、CI が全ジョブ落ちる状態だったため作業ファイルの混入もあわせて整理し、出し直しました)

コミット

1. fix(ci): 廃止された actions/cache@v1::set-output を更新

GitHub 側で actions/cache v1 が廃止され、ワークフローが自動的に失敗するようになっていました。そのため本ブランチの CI は全ジョブ failure で、内容の検証ができない状態でした。

##[error]This request has been automatically failed because it uses a
deprecated version of `actions/cache: v1`.
  • actions/cache@v1@v4
  • ::set-output$GITHUB_OUTPUT(同じく非推奨)

actions/checkout@v2 などの他の古い action は本 PR では触っていません。

2. fix(test): decimal カラムの比較を assertEquals にする

上記を直すと CI が動き出し、EC-CUBE 4.3 との組み合わせで 6 テストが失敗していることが分かりました(4.2 との組み合わせは pass)。decimal カラムを Doctrine が文字列で返すようになったため、verify()assertSame)の厳密比較が通らないものです。

CouponServiceTest::testRecalcOrderDiscountRate
  Failed asserting that '623.00' is identical to 623.
CouponControllerTest::testShoppingCoupon
  Failed asserting that '-100.00' is identical to -100.0.

金額の等価性を検証したいだけなので数値等価(assertEquals)に変更しました。#197 でも 4.4 向けに同じ方針で対応しています。

ファイル 箇所
Tests/Service/CouponServiceTest.php 2 箇所(testRecalcOrderDiscountRate / testRecalcOrderWithTaxRateIsEmpty
Tests/Web/CouponControllerTest.php 4 箇所(testShoppingCoupon / testShoppingCouponDiscountTypePrice / testShoppingCouponDiscountTypeRate / testCompleteWithNonmember

3. fix: Bootstrap 5 に存在しない mr-2 / mr-3me-2 / me-3 に修正

Bootstrap 5.3 では右マージンのユーティリティが me-* にリネームされているため、mr-*何のスタイルも当たっていません(ボタン/アイコンの余白が詰まって表示されます)。

ファイル 変更
Resource/template/admin/regist.twig 411 / 473 mr-3me-3
Resource/template/admin/regist.twig 450 mr-2me-2
Resource/template/admin/regist_product_list_prototype.twig 17 mr-3me-3
Resource/template/admin/regist_category_list_prototype.twig 16 mr-3me-3

根拠:

  • admin の html/template/admin/assets/css/bootstrap.css.mr-2 のルールは 存在しません.me-2 は存在します)
  • 同じ regist.twig の 391 行だけが me-2 になっており不統一でした
  • 他の Bootstrap 4 残骸(ml-* / pr-* / float-left / badge-* / sr-only など)は grep で 0 件のため対象外です

テスト

CI(EC-CUBE 4.2 / 4.3 × PHP 7.4〜8.3 × MySQL 5.7 / MySQL 8 / PostgreSQL の全 18 ジョブ)で確認します。コミット 1 の適用前は全ジョブが起動すらしない状態でした。

🤖 Generated with Claude Code

ttokoro20240902 and others added 3 commits August 3, 2026 14:52
GitHub 側で actions/cache v1 が廃止され、ワークフローが自動的に失敗する
ようになったため、本ブランチの CI が全ジョブ failure になっていた。

  ##[error]This request has been automatically failed because it uses a
  deprecated version of `actions/cache: v1`.

- actions/cache@v1 → @v4
- ::set-output → $GITHUB_OUTPUT(同じく非推奨のため合わせて更新)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
EC-CUBE 4.3 との組み合わせで 6 テストが失敗していた。decimal カラムは
Doctrine が文字列で返すため、verify() (assertSame) では型が一致しない。

  CouponServiceTest::testRecalcOrderDiscountRate
    Failed asserting that '623.00' is identical to 623.
  CouponControllerTest::testShoppingCoupon
    Failed asserting that '-100.00' is identical to -100.0.

金額の等価性を検証したいだけなので、数値等価 (assertEquals) に変更する。
4.4 対応ブランチ (#197) でも同じ方針で対応している。

- Tests/Service/CouponServiceTest.php (2 箇所)
- Tests/Web/CouponControllerTest.php (4 箇所)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
管理画面のクーポン登録画面で、Bootstrap 4 の右マージンユーティリティ
(mr-*) が残っており、スタイルが当たっていなかった。Bootstrap 5 では
me-* にリネームされている。

- Resource/template/admin/regist.twig (411 / 450 / 473 行)
- Resource/template/admin/regist_product_list_prototype.twig
- Resource/template/admin/regist_category_list_prototype.twig

admin の bootstrap.css に .mr-2 のルールは存在せず (.me-2 は存在する) 、
同じ regist.twig の 391 行だけが me-2 で不統一だった。

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

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ttokoro20240902, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4267a587-02cb-455e-ba16-722049a5709d

📥 Commits

Reviewing files that changed from the base of the PR and between 112ab3e and debb4b2.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • Resource/template/admin/regist.twig
  • Resource/template/admin/regist_category_list_prototype.twig
  • Resource/template/admin/regist_product_list_prototype.twig
  • Tests/Service/CouponServiceTest.php
  • Tests/Web/CouponControllerTest.php

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.

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