Review main Merged

86797[TASK] Add new list_type deprecation match to extension scanner

Torben Hansen CR +2 V +2 Easy +12 −0 updated 11/07/24, 12:48

Commit message

With #105076, the plugin content element and plugin sub types
have been deprecated. The extension scanner currently only
matches the deprecation, when it detects the usage of
`ExtensionUtility::PLUGIN_TYPE_PLUGIN` as fifth argument
for `ExtensionUtility::configurePlugin()`. Many public
extensions however omit the fifth argument, resulting
in the deprecation not being shown in extension scanner
and extension developers not being aware of the required
code changes.

This change adds a new entry to the
`MethodArgumentRequiredStaticMatcher.php` configuration, so
the extension scanner will show a match for the deprecation,
if `ExtensionUtility::configurePlugin()` is called without
a fifth argument.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1113

  1. Torben Hansen uploaded patch set 1 10/26/24, 04:47

  2. core-ci voted on patch set 1 V +1 10/26/24, 04:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68656

  3. Garvin Hicking voted on patch set 1 CR +1 V +1 10/26/24, 08:38

  4. Christian Kuhn commented on patch set 1 CR -1 10/26/24, 11:45

    MethodArgumentRequiredStaticMatcher.php:20

    the method has 3 mandatory arguments.
  5. Christian Kuhn commented on patch set 1 10/26/24, 11:56

    MethodArgumentRequiredStaticMatcher.php:20 Reply

    ah. you're right, this is the correct definition: with dropping list_type, all 5 arguments are required. i'm however unsure how this evolves in the future: the 5th arguments will allow only one value after deprecation removals which pretty much obsoletes it. we probably still don't want to drop it, since this would add new b/w compat issues ... in the end, we may want to get of the method altogether and maybe introduce a new one, maybe? it's kinda ugly that extbase has this stuff anyways ... so for now ... hmm? do the patch, but add a comment that dropping 5th argument shouldn't be done before v15, maybe?
  6. Garvin Hicking commented on patch set 1 10/26/24, 12:56

    MethodArgumentRequiredStaticMatcher.php:20 Reply

    Remarks from our chat about this: Torben has a plan to generally rework the plugin registration API in v14, like you also want to. So we were thinking to cut corners and not take the deprecation too complex and work with this approach for now. By requiring the 5th argument in v13, it will make this process easier. And for the time being we might even utilize the 5th argument somehow, so requiring it for now will make it easier to perform scanning in the next deprecation. It would get improved with matching in https://forge.typo3.org/issues/105091 as a follow-up. Let's schedule a small talk next week to sort this out proper.
  7. Garvin Hicking commented on patch set 1 10/26/24, 13:07

    MethodArgumentRequiredStaticMatcher.php:20 Reply

    Also note: We mainly want to increase scanner matching here and make it complain about possible issues, and not raising the REAL mandatory arguments intentionally (to prevent BC).
  8. Oli Bartsch uploaded patch set 2 CR +1 V +1 11/07/24, 08:22

  9. Oli Bartsch voted on patch set 2 CR +1 V +1 11/07/24, 08:22

  10. core-ci voted on patch set 2 V +1 11/07/24, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69171

  11. Simon Schaufelberger voted on patch set 2 CR +1 V +1 11/07/24, 10:04

  12. Garvin Hicking voted on patch set 2 CR +2 V +2 11/07/24, 12:36

  13. Garvin Hicking merged patch set 3 11/07/24, 12:48