Review main Abandoned

76855[WIP][TASK] Annotate that UIDs cannot be negative

Oliver Klee CR 0 V 0 Normal +47 −37 updated 08/25/24, 10:10

Commit message

Also add a type cast that was missing, and remove redundant
properties from a fixture class.

> ./Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 16

Review log 2431

Show 46 earlier messages
  1. Oliver Klee uploaded patch set 1 11/29/22, 14:22

  2. Oliver Klee commented on patch set 1 CR -1 11/29/22, 14:25

    on it
  3. Oliver Klee uploaded patch set 2 CR -1 11/29/22, 14:26

  4. core-ci voted on patch set 1 V -1 11/29/22, 14:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34362

  5. core-ci voted on patch set 2 V -1 11/29/22, 14:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34363

  6. Nikita Hovratov commented on patch set 2 11/29/22, 14:45

    AbstractDomainObject.php:80

    Please remove the absolute namespace.
  1. Christian Kuhn commented on patch set 2 11/29/22, 15:16

    AbstractRecord.php:80

    actually, they can't be negative? afaiks, negative uid's have been removed long ago in workspace handling.
  2. Oliver Klee commented on patch set 2 11/29/22, 15:21

    AbstractDomainObject.php:80 Reply

    Done
  3. Oliver Klee uploaded patch set 3 V -1 11/29/22, 15:21

  4. Oliver Klee commented on patch set 2 11/29/22, 15:24

    AbstractRecord.php:80 Reply Unresolved

    That's what I thought as well. ;-) However, in https://github.com/TYPO3/typo3/blob/main/typo3/sysext/workspaces/Classes/Domain/Record/StageRecord.php#L209 , the UID is compared with a negative number: `StagesService::STAGE_PUBLISH_EXECUTE_ID` is -20. I have no idea whether that code still makes any sense nowadays. Do you know more about this?
  5. core-ci voted on patch set 3 V -1 11/29/22, 15:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34365

  6. Oliver Klee commented on patch set 3 CR -1 11/29/22, 16:38

    On it for the unit tests failure.
  7. Oliver Klee commented on patch set 3 11/29/22, 16:56

    Reply

    Done
  8. Oliver Klee uploaded patch set 4 CR -1 V -1 11/29/22, 16:56

  9. core-ci voted on patch set 4 V +1 11/29/22, 17:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34366

  10. Simon Schaufelberger commented on patch set 4 11/30/22, 11:01

    TtContent.php:31

    why did you remove this?
  11. Oliver Klee commented on patch set 4 11/30/22, 11:52

    TtContent.php:31 Reply

    It's already in the same property in the parent class, and PHPStan uses that property's annotation. Now that I think of it, I should re-add the annotation, and we should remove the redundant property in a separate change.
  12. Oliver Klee commented on patch set 4 11/30/22, 11:55

    TtContent.php:31 Reply

    Ah, these $uid and $pid are only in the tests. So I can most probably safely remove them with this change.
  13. Oliver Klee commented on patch set 4 11/30/22, 12:09

    TtContent.php:31 Reply

    I can indeed. Done.
  14. Oliver Klee uploaded patch set 5 V +1 11/30/22, 12:09

  15. core-ci voted on patch set 5 V +1 11/30/22, 12:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34416

  16. Oliver Klee commented on patch set 5 CR -1 11/30/22, 14:45

    Going to create a pre-patch first to get rid of the remnants of the negative UIDs.
  17. Oliver Klee marked it work in progress 02/19/23, 21:50

  18. Oliver Klee uploaded patch set 6 CR -1 V +1 03/11/23, 18:01

  19. core-ci voted on patch set 6 V -1 03/11/23, 19:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38805

  20. Oliver Klee uploaded patch set 7 V -1 03/27/23, 11:41

  21. Oliver Klee uploaded patch set 8 11/25/23, 13:41

  22. core-ci voted on patch set 8 V +1 11/25/23, 13:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49924

  23. Christian Kuhn commented on patch set 8 08/06/24, 12:24

    how to continue here? it looks to me as if phpstorm does not understand 'positive-int', so i'm unsure if we should go ahead with this patch at all?!
  24. Oliver Klee commented on patch set 8 08/06/24, 14:37

    Reply Unresolved

    Current PHPStan provides all notations we need for this: - `positive-int` - `non-negative-int` - `int<1, max>` - `int<0, max>` https://phpstan.org/writing-php-code/phpdoc-types#integer-ranges The main blocker are the parts of the core that still rely on negative UIDs, and how to handle those. I have no idea if that is dead code, or if we still need the possibility to have negative UIDs in some cases. Do you know more about this, @lolli@schwarzbu.ch?
  25. Oliver Klee abandoned the change 08/25/24, 10:10