84609[TASK] Migrate CommandUtility from exec() to Symfony Process
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Simon Schaufelberger +1
-
Verified V +2 Done
- Benni Mack +2
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 4
Review log 3045
Show 1220 earlier messages
-
Mathias Bolt Lesniak uploaded patch set 1 06/11/24, 11:00
-
core-ci voted on patch set 1 V -1 06/11/24, 11:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59164
-
Mathias Bolt Lesniak uploaded patch set 2
V -106/11/24, 11:40 -
core-ci voted on patch set 2 V -1 06/11/24, 11:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59172
-
Andreas Kienast commented on patch set 2 06/11/24, 11:51
You have to require symfony/process for the main composer.json as well. However, this creates a mix of Symfony 7.0 and 7.1 right now, let's clean this up at first. -
Andreas Kienast commented on patch set 2 06/11/24, 11:53
-
Rozbeh Chiryai Sharahi uploaded patch set 3
V -106/11/24, 12:14 -
core-ci voted on patch set 3 V -1 06/11/24, 12:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59180
-
Rozbeh Chiryai Sharahi uploaded patch set 4
V -106/11/24, 12:25 -
core-ci voted on patch set 4 V +1 06/11/24, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59184
-
Rozbeh Chiryai Sharahi uploaded patch set 5
V +106/11/24, 12:33 -
core-ci voted on patch set 5 V +1 06/11/24, 12:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59185
-
Rozbeh Chiryai Sharahi uploaded patch set 6
V +106/11/24, 12:40 -
core-ci voted on patch set 6 V +1 06/11/24, 12:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59186
-
Andreas Kienast uploaded patch set 7
V +106/11/24, 13:24 -
Andreas Kienast uploaded patch set 8 06/11/24, 13:25
-
core-ci voted on patch set 7 V -1 06/11/24, 13:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59193
-
core-ci voted on patch set 8 V +1 06/11/24, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59194
-
Georg Ringer voted on patch set 8 CR +1 V +1 06/11/24, 19:55
-
Simon Schaufelberger uploaded patch set 9
CR +1V +106/17/24, 19:59
-
Simon Schaufelberger voted on patch set 9 CR +1 V +1 06/17/24, 20:00
-
core-ci voted on patch set 9 V +1 06/17/24, 20:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59751
-
Mathias Bolt Lesniak uploaded patch set 10
CR +1V +106/24/24, 08:55 -
core-ci voted on patch set 10 V -1 06/24/24, 08:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60162
-
Andreas Kienast uploaded patch set 11
V -106/24/24, 09:08 -
core-ci voted on patch set 11 V +1 06/24/24, 09:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60164
-
Benni Mack commented on patch set 11 06/25/24, 06:06
CommandUtility.php:100this seemed so easy :) But now, this method returns "false", on typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php line 321 because "git rev-parse --short HEAD" returns return code 128 (thus, this method returns false). We might just keep the bw/compat and then add a todo to introduce a new wrapper method or the like to call it "CommandUtility::process" which is much more strict with the return type? -
Benni Mack voted on patch set 11 CR -1 06/25/24, 06:32
-
Mathias Bolt Lesniak commented on patch set 11 06/25/24, 07:40
CommandUtility.php:100ReplyLooks like we're missing some test case coverage here. ;-) I'll have a look at possible implementations that better reproduce the expected output. I'm thinking that the ultimate goal would be to replace every method in CommandUtility with direct Process implementations, so CommandUtility::process would be the backwards compatible version that later becomes deprecated. This because I'm interested in ways to avoid the "exec() doesn't exist" errors for new installations on limited hosts. Thoughts? -
Benni Mack commented on patch set 11 06/25/24, 11:13
CommandUtility.php:100Replytbh, returning "false" does not seem to be used in conjunction with the return code: https://www.php.net/manual/en/function.exec.php (see PHP 8.0 change) and https://github.com/php/php-src/blob/master/ext/standard/exec.c#L199C2-L199C14 I'd skip this here -
Mathias Bolt Lesniak uploaded patch set 12
CR -1V +107/06/24, 08:38 -
core-ci voted on patch set 12 V +1 07/06/24, 08:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61087
-
Mathias Bolt Lesniak uploaded patch set 13
V +107/06/24, 12:43 -
core-ci voted on patch set 13 V +1 07/06/24, 12:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61097
-
Mathias Bolt Lesniak commented on patch set 13 07/06/24, 14:01
CommandUtility.php:100Reply@benni@typo3.org After reading the exec() command's C code and the code of contributing functions, it looks like the command returns false on failure. Where C functions normally return -1. This looks like the same behavior as the RuntimeException of Symfony Process. Thus, I have implemented a catch for Process's RuntimeExceptions as the reason for returning false. I think this makes sense. What do you think. -
Benni Mack commented on patch set 13 07/12/24, 05:58
CommandUtility.php:100ReplyI think that's really good! -
Mathias Bolt Lesniak uploaded patch set 14
V +107/12/24, 06:26 -
Mathias Bolt Lesniak commented on patch set 14 07/12/24, 06:28
CommandUtility.php:100ReplyGreat! I pushed a new patchset to fix the merge conflict. -
core-ci voted on patch set 14 V +1 07/12/24, 06:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61450
-
Benni Mack commented on patch set 14 CR +1 V +1 07/12/24, 11:39
works for me now. thank you! -
Simon Schaufelberger uploaded patch set 15
CR +1V +107/12/24, 11:49 -
Simon Schaufelberger commented on patch set 15 CR +1 V +1 07/12/24, 11:50
Reply
Resolved merge conflict. Please revote. -
core-ci voted on patch set 15 V +1 07/12/24, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61481
-
Benni Mack voted on patch set 15 CR +2 V +2 07/12/24, 12:35
-
Benni Mack merged patch set 16 07/12/24, 12:35