Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8とMySQLでプラグインアップデートコマンドを実行すると no active transaction になるのを修正 #5443

Merged
merged 8 commits into from
Jul 22, 2022

Conversation

kurozumi
Copy link
Contributor

概要(Overview・Refs Issue)

PHP8とMySQLでプラグインアップデートコマンドを実行すると no active transaction になるのを修正しました。

方針(Policy)

実装に関する補足(Appendix)

テスト(Test)

プラグインテストのワークフローにPHP8.0と8.1を追加しました。

相談(Discussion)

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更はありません
  • フックポイントの呼び出しタイミングの変更はありません
  • フックポイントのパラメータの削除・データ型の変更はありません
  • twigファイルに渡しているパラメータの削除・データ型の変更はありません
  • Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
  • 入出力ファイル(CSVなど)のフォーマット変更はありません

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか
    • 権限を超えた操作が可能にならないか
    • 不要なファイルアップロードがないか
    • 外部へ公開されるファイルや機能の追加ではないか
    • テンプレートでのエスケープ漏れがないか

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2022

Codecov Report

Merging #5443 (11db57d) into 4.2 (0b3fde8) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##                4.2    #5443      +/-   ##
============================================
- Coverage     77.49%   77.48%   -0.01%     
- Complexity     6234     6250      +16     
============================================
  Files           466      468       +2     
  Lines         20962    21007      +45     
============================================
+ Hits          16244    16277      +33     
- Misses         4718     4730      +12     
Flag Coverage Δ
E2E 49.49% <0.00%> (+<0.01%) ⬆️
Unit 76.99% <0.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
src/Eccube/Service/PluginService.php 55.58% <0.00%> (-0.43%) ⬇️
...be/Service/PurchaseFlow/Processor/TaxProcessor.php 75.43% <0.00%> (-3.51%) ⬇️
src/Eccube/Service/CsvImportService.php 71.96% <0.00%> (-1.96%) ⬇️
.../Eccube/Stream/Filter/SjisToUtf8EncodingFilter.php 80.64% <0.00%> (ø)
src/Eccube/Stream/Filter/ConvertLineFeedFilter.php 100.00% <0.00%> (ø)
...e/Controller/Admin/Product/CsvImportController.php 64.66% <0.00%> (+0.04%) ⬆️
.../Eccube/Doctrine/Common/CsvDataFixtures/Loader.php 80.00% <0.00%> (+5.00%) ⬆️
...e/Controller/Admin/AbstractCsvImportController.php 92.30% <0.00%> (+7.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b3fde8...11db57d. Read the comment docs.

@chihiro-adachi
Copy link
Contributor

@kurozumi
mysqlでテストが落ちているようなのでご確認いただけますか?
おそらくDATABASE_CHARSETを指定してあげればいけるかと。

@chihiro-adachi chihiro-adachi added this to the 4.2.0 milestone Jul 19, 2022
@chihiro-adachi
Copy link
Contributor

@kurozumi
手元の環境で試してみてみたところ、TransactionListener::onKernelTerminateでも同じエラーが発生してました。

TransactionListenerではisTransactionActiveでトランザクション中の判定をしてますが、これがうまくできないようで、PluginServiceの実装にあわせるとテストも通るようです。

chihiro-adachi@efa0558

@kurozumi
Copy link
Contributor Author

@chihiro-adachi
Copy link
Contributor

@kurozumi

修正箇所はPluginServiceのpostInstallの実装に合わせました。
はい、そちらはその修正で問題ありません。

TransactionListener::onKernelTerminateでも同じエラーが発生しており、テストが落ちているので、TransactionListenerも合わせて修正いただければと。

以下の箇所です。
https://github.com/EC-CUBE/ec-cube/blob/4.2/src/Eccube/EventListener/TransactionListener.php#L126

@chihiro-adachi
Copy link
Contributor

@kurozumi
ご対応ありがとうございました。
確認後マージさせていただきます。

@chihiro-adachi chihiro-adachi merged commit 92aa48c into EC-CUBE:4.2 Jul 22, 2022
@kurozumi kurozumi deleted the fix-no-active-transaction branch July 22, 2022 09:17
@carkn carkn added the bugbounty2022:pr:entry バグバウンティ2022 バグ登録 PR登録 label Aug 2, 2022
@chihiro-adachi chihiro-adachi added the bugbounty2022:pr:recognition バグバウンティ2022 バグ登録 PR取込 label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:High bugbounty2022:pr:entry バグバウンティ2022 バグ登録 PR登録 bugbounty2022:pr:recognition バグバウンティ2022 バグ登録 PR取込 Status: ready-for-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants