88082[BUGFIX] Prevent duplicate user group creation
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Stefan Bürk +1
- Christian Kuhn +1
-
Verified V +2 Done
- Garvin Hicking +2
- Stefan Bürk +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 5
- typo3/sysext/install/Classes/Command/SetupDefaultBackendUserGroupsCommand.php4+12 −1
- typo3/sysext/install/Classes/Service/SetupService.php4+47 −25
- typo3/sysext/install/Tests/Functional/Service/Fixtures/CreateUserGroupsCommand.csvnew+4 −0
- typo3/sysext/install/Tests/Functional/Service/Fixtures/ForcedCreateUserGroupsCommand.csvnew+6 −0
- typo3/sysext/install/Tests/Functional/Service/SetupServiceTest.php7new+73 −0
Review log 2634
Show 79 earlier messages
-
Lina Wolf uploaded patch set 1 02/07/25, 14:33
-
core-ci voted on patch set 1 V -1 02/07/25, 14:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73737
-
Lina Wolf uploaded patch set 2
V -102/07/25, 14:49 -
core-ci voted on patch set 2 V +1 02/07/25, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73742
-
Andreas Wolf voted on patch set 2 CR +1 V +1 02/07/25, 20:52
-
Oliver Wand voted on patch set 2 CR +1 02/08/25, 09:27
-
Lina Wolf marked it work in progress 02/08/25, 10:08
-
Lina Wolf commented on patch set 2 02/08/25, 10:08
This change is ready for review.I talked to Stefan Bürk and will add a test before proceeding -
Lina Wolf marked it work in progress 02/08/25, 10:08
-
Lina Wolf uploaded patch set 3
CR +1V +102/08/25, 12:09 -
Lina Wolf commented on patch set 3 02/08/25, 12:10
This change is ready for review.Added a test, please resume review -
core-ci voted on patch set 3 V +1 02/08/25, 12:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73801
-
Garvin Hicking commented on patch set 3 V +1 02/08/25, 20:49
(Verified to work, only quick-read the code, waiting for Stefan to give feedback on tests. I think this one is worth having, duplicate user groups should not be the default) -
Stefan Bürk voted on patch set 3 CR -1 02/08/25, 21:38
-
Stefan Bürk commented on patch set 3 02/26/25, 09:27
I'm fine with the change in general, also with adding an additional flag as bugfix on backport. TBH not sure if that would require a go from Benni, but I guess not as this should be safe to be done. Looking on the implementation details, I have some remarks. See other comments.SetupDefaultBackendUserGroupsCommand.php:63Can we rephrase that to emphasize that this forces to create NEW record(s) with the same name ?SetupDefaultBackendUserGroupsCommand.php:116```suggestion if ($messages !== [) { ```SetupService.php:362```suggestion private function countBackendGroupsByTitle(ConnectionPool $connectionPool, string $title): int ```SetupService.php:365```suggestion return (int)$queryBuilder->count('*') ``` Helps with phpstan when rising levels at some point. Humans know that this may always return an integer, but static code analyzers would assume int|false which is not compatible in the long run. I'd prefere the explicit int cast here.SetupServiceTest.php:32```php protected bool $initializeDatabase = true; ``` This is superflous as it is the default.SetupServiceTest.php:42```suggestion $subject = $this->get(SetupService::class); ``` What is the reason to mock all these stuff within a functional test ? I rather tend to use the real services here. Same for the other testcase methods.SetupServiceTest.php:44Instead of a "count" I'd suggest to use the `assertCSVDataSet()` along with a csv fixture file to not only test the pure count but real table contents with fields and uids. Same for other testcase method, special the last one with "pre existing" records before and after the setupservice execution. Using the csv assertion would also allow that the settings contained in the csv are added - eventually. Not sure if we should do that here. -
Lina Wolf uploaded patch set 4
CR -1V +102/26/25, 09:54 -
Lina Wolf commented on patch set 4 02/26/25, 09:54
SetupDefaultBackendUserGroupsCommand.php:63ReplyDoneSetupDefaultBackendUserGroupsCommand.php:116ReplyDoneSetupService.php:362ReplyDoneSetupServiceTest.php:32ReplyDone -
Lina Wolf marked it work in progress 02/26/25, 09:54
-
Lina Wolf commented on patch set 4 02/26/25, 09:58
This change is ready for review.SetupService.php:365Reply`fetchOne()` actually returns mixed and casting mixed to int does not work below a certain level of phpstan. But I think casting to (int) does no harm here, so I applied it.SetupServiceTest.php:44ReplyIn my feeling this would be a little out of context within this PR as I would be testing functionallity that was not added by this PR. -
core-ci voted on patch set 4 V +1 02/26/25, 10:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74739
-
Lina Wolf marked it work in progress 02/27/25, 13:49
-
Lina Wolf uploaded patch set 5
V +102/27/25, 14:15 -
Lina Wolf uploaded patch set 6 02/27/25, 14:17
-
core-ci voted on patch set 5 V -1 02/27/25, 14:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74837
-
core-ci voted on patch set 6 V -1 02/27/25, 14:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74838
-
Stefan Bürk uploaded patch set 7
V -102/28/25, 10:37 -
core-ci voted on patch set 7 V +1 02/28/25, 10:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74888
-
Stefan Bürk uploaded patch set 8
V +102/28/25, 10:56 -
core-ci voted on patch set 8 V +1 02/28/25, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74890
-
Stefan Bürk commented on patch set 8 CR +1 V +1 02/28/25, 11:11
This change is ready for review.SetupServiceTest.php:42ReplyDoneSetupServiceTest.php:44ReplyThis was slightly a both-side missunderstating and has been solved with a slack huddle with Lina. I wanted to use `assertCSVDataSet()` directly here as check on more specified records instead of simple counts. My addition for the specific content was only ment as a general "we may want to extend the tests on a already existing feature based on db level" and did not expressed correctly that this is something for an eventually followup. `Not sure if we should do that here.` Did not emphasized that enough. @112@linawolf.de reworked the code based on my comment, thanks for taking care. Resolving this comment now. -
Garvin Hicking voted on patch set 8 CR +1 V +1 02/28/25, 11:38
-
Christian Kuhn voted on patch set 8 CR +1 V +1 03/02/25, 01:29
-
Garvin Hicking voted on patch set 8 CR +2 V +2 03/02/25, 07:38
-
Garvin Hicking merged patch set 9 03/02/25, 09:14