Review main Merged

76462[FEATURE] Allow glob patterns in yaml imports

Susi Moog CR +2 V +2 Normal +107 −3 updated 11/09/22, 12:49

Commit message

To simplify imports in configuration and allow
for compacter files, glob() patterns can now
be used for importing files in the core
YamlFileLoader.

Example:

imports:
  - { resource: "./**/*.yaml", glob: true }
  - { resource: "EXT:core/Tests/**/Configuration/**/SiteConfigs/*.yaml", glob: true }

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 1926

Show 1 earlier messages
  1. Susi Moog uploaded patch set 1 11/07/22, 22:32

  1. core-ci voted on patch set 1 V -1 11/08/22, 00:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33233

  2. Susi Moog uploaded patch set 2 11/08/22, 10:03

  3. core-ci voted on patch set 2 V -1 11/08/22, 10:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33285

  4. Susi Moog uploaded patch set 3 11/08/22, 13:51

  5. Susi Moog uploaded patch set 4 11/08/22, 13:54

  6. Christian Kuhn commented on patch set 4 11/08/22, 13:57

    This change is ready for review.

    YamlFileLoaderTest.php:172

    please turn into functional test.
  7. Christian Kuhn commented on patch set 4 11/08/22, 13:59

    not fully sure here: This adds "yet another" way of path traversal - we have similar things in TS @import and probably at various other places. Maybe we'd want to streamline similar places?
  8. Christian Kuhn commented on patch set 4 CR -1 11/08/22, 14:00

    -1 due to the mocking unit test which should be a functional test.
  9. core-ci voted on patch set 3 V -1 11/08/22, 14:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33316

  10. core-ci voted on patch set 4 V +1 11/08/22, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33317

  11. Susi Moog commented on patch set 4 11/08/22, 14:18

    Reply

    hm, don't really know how TS imports are similar here - do you intend to build a global loader component with multi format support? (similar to the various ways of Symfony config loading we could implement something like that with interfaces and multi-loader-chains, that would be a bit much for this feature I guess).

    Reply

    Was a unit test to be in line with the other tests for this class using the same methodology (mocking file access) - I can look into doing a pre-patch rewriting the whole test class to functionals.
  12. Susi Moog commented on patch set 4 CR -1 11/08/22, 18:21

  13. Susi Moog uploaded patch set 5 11/09/22, 08:14

  14. core-ci voted on patch set 5 V +1 11/09/22, 08:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33374

  15. Susi Moog commented on patch set 5 11/09/22, 08:26

    YamlFileLoaderTest.php:172 Reply

    Done
  16. Benni Mack commented on patch set 5 11/09/22, 08:56

    Feature-93112-AllowGlobPatternsInYamlImports.rst:16

    "compacter" is wrong, it's "more compact"
  17. Susi Moog commented on patch set 6 11/09/22, 08:58

    Published edit on patch set 5.
  18. Susi Moog commented on patch set 6 11/09/22, 08:58

    Feature-93112-AllowGlobPatternsInYamlImports.rst:16 Reply

    Done
  19. core-ci voted on patch set 6 V +1 11/09/22, 09:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33381

  20. Christian Kuhn commented on patch set 6 11/09/22, 09:27

    Reply

    well, we have multiple path traversal places in the core and they. having one more means yet another syntax to learn.

    Reply

    ah. that's much better. thank you!

    YamlFileLoaderTest.php:216

    path traversal is always an issue when doing such things. should we make sure '.' and '..' are disallowed, so something like 'foo/../../../../etc/passwd' is denied by having some test?
  21. Susi Moog uploaded patch set 7 11/09/22, 10:43

  22. core-ci voted on patch set 7 V +1 11/09/22, 10:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33392

  23. Christian Kuhn commented on patch set 7 V +1 CR +1 11/09/22, 10:51

    YamlFileLoaderTest.php:216 Reply

    Done
  24. Benni Mack voted on patch set 7 V +2 CR +2 11/09/22, 12:49

  25. Benni Mack merged patch set 8 11/09/22, 12:49