Review main Merged

78447[BUGFIX] DatabaseUpdatedPrerequisite returns correct ensure-state

Alexander Opitz CR +2 V +2 Easy +9 −5 updated 06/14/23, 12:23

Commit message

The `ensure` method must return true,
if all operations were successful.

This is the case if all database
operations succeeded without returning
an error message.

The error messages are now checked
correctly and the corresponding state
is returned.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Thomas Hohn +1
    • Markus Klein +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Markus Klein +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2533

Show 68 earlier messages
  1. Alexander Opitz uploaded patch set 1 04/04/23, 13:14

  2. Oliver Klee updated the commit message in patch set 2 04/04/23, 13:32

  3. core-ci voted on patch set 1 V +1 04/04/23, 13:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40089

  4. core-ci voted on patch set 2 V +1 04/04/23, 13:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40091

  5. Oliver Klee commented on patch set 2 04/04/23, 14:00

    DatabaseUpdatedPrerequisite.php:58

    Instead of having this type annotation, I propose to provider `$this->databaseUpgradeWizardsService->addMissingTablesAndFields()` with an `@return string[]` type annotation (and to re-generate the PHPStan baseline using `./Build/Scripts/runTests.sh -s phpstanGenerateBaseline`).
  6. Alexander Opitz uploaded patch set 3 V +1 04/05/23, 12:20

  7. Alexander Opitz updated the commit message in patch set 4 04/05/23, 12:21

  8. Alexander Opitz commented on patch set 4 04/05/23, 12:22

    DatabaseUpdatedPrerequisite.php:58 Reply

    Done
  1. core-ci voted on patch set 3 V -1 04/05/23, 13:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40184

  2. core-ci voted on patch set 4 V -1 04/05/23, 13:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40185

  3. Oliver Klee commented on patch set 4 04/05/23, 15:47

    Maybe we can extract the cleanup into a pre-patch (so both changes are more focused). Should I take care of the pre-patch?
  4. Oliver Klee commented on patch set 4 CR -1 04/05/23, 21:35

  5. Oliver Klee commented on patch set 4 CR 0 04/07/23, 12:01

    The pre-patch now has been merged, and this change should be rebased.
  6. Oliver Klee uploaded patch set 5 V -1 04/07/23, 12:43

  7. core-ci voted on patch set 5 V +1 04/07/23, 12:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40335

  8. Stefan Bürk commented on patch set 5 CR -1 04/08/23, 13:39

    DatabaseUpdatedPrerequisite.php:53

    Would say, use a variable before the if for it. That way, we can avoid the recount in 54 (side change)

    DatabaseUpdatedPrerequisite.php:61

    we can add a break here, as we only need "one" non empty error to set the ensured to false. no need to check for further errors. (early break).
  9. Oliver Klee commented on patch set 5 04/08/23, 17:02

    DatabaseUpdatedPrerequisite.php:49

    I'd like to propose a rename: `$result` -> `$errorMessages`

    DatabaseUpdatedPrerequisite.php:53 Reply

    Or even better, we do an early return: ```php // If there is nothing to add, there cannot be any errors from the adds. if ($adds === []) { return; } ```

    DatabaseUpdatedPrerequisite.php:61 Reply

    Or even shorter: We `implode` all error messages, and if the result is not an empty string, we have at least one error.
  10. Alexander Opitz commented on patch set 5 04/11/23, 07:12

    DatabaseUpdatedPrerequisite.php:61 Reply

    If, say 10, Statements fail, this complete error messages would be combined to one string ... messing around with memory. Something I don't like. :-/
  11. Thomas Hohn uploaded patch set 6 CR -1 V +1 04/28/23, 12:31

  12. core-ci voted on patch set 6 V +1 04/28/23, 12:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41295

  13. Oliver Klee commented on patch set 6 04/28/23, 13:10

    DatabaseUpdatedPrerequisite.php:49 Reply

    Done

    DatabaseUpdatedPrerequisite.php:53 Reply

    Done
  14. Thomas Hohn commented on patch set 6 04/29/23, 05:25

    DatabaseUpdatedPrerequisite.php:61 Reply

    Done
  15. Stefan Bürk updated the commit message in patch set 7 V +1 04/30/23, 08:33

  16. Oliver Klee voted on patch set 7 CR +1 04/30/23, 13:41

  17. Thomas Hohn rebased onto patch set 8 CR +1 05/02/23, 11:38

  18. core-ci voted on patch set 8 V +1 05/02/23, 11:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41346

  19. Benni Mack updated the commit message in patch set 9 V +1 05/03/23, 09:50

  20. Markus Klein uploaded patch set 10 06/13/23, 07:26

  21. Thomas Hohn voted on patch set 10 CR +1 06/13/23, 07:31

  22. Markus Klein voted on patch set 10 V +1 CR +1 06/13/23, 07:33

  23. core-ci voted on patch set 10 V +1 06/13/23, 07:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42431

  24. Stefan Bürk voted on patch set 10 V +2 CR +2 06/14/23, 12:23

  25. Stefan Bürk merged patch set 11 06/14/23, 12:23