Review main Merged

89738[BUGFIX] Store and process site settings.yaml as a map

Benjamin Franzke CR +2 V +2 Hard +626 −211 updated 07/14/25, 10:00

Commit message

Site settings are defined as a map of keys, with a defined
type and default.

The values are currently stored as a tree representation in
`settings.yaml` (where tree nodes are generated from dot
separators in setting keys).

This tree representation is easier to write, but has the
drawback that arbitrary keys like `foo.bar` and `foo.bar.baz`
exclude each other, as the subkey `baz` would be represented
as a value of `foo.bar` in tree representation.

Note that TypoScript constants can express subkey constants since
TypoScript can store a value and childnodes for every node, which
means that existing extensions – that migrate to site sets – require
this mixture of setting identifiers to be supported in order to
avoid breaking existing settings.

The storage format of settings.yaml is now changed to use
a map (like settings.definitions.yaml already do) to store
setting values, in order to overcome the mentioned limitation.
It is still supported to *read* from a tree, but the settings editor
will convert the tree to a map when persisting values.

Existing anonymous setting (pre v13 style, e.g. settings without a
matching settings.definitions.yaml definition) will be preserved as
a tree, since it is not known which tree node is key or a value.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • Benjamin Kott +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 1

Files 21

Show 1 more file

Review log 2941

Show 1216 earlier messages
  1. Benjamin Franzke uploaded patch set 1 06/17/25, 07:27

  2. core-ci voted on patch set 1 V +1 06/17/25, 07:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80413

  3. Benjamin Franzke uploaded patch set 2 V +1 06/17/25, 09:40

  4. core-ci voted on patch set 2 V +1 06/17/25, 09:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80416

  5. Garvin Hicking updated the commit message in patch set 3 V +1 06/17/25, 21:39

  6. Garvin Hicking commented on patch set 3 06/17/25, 21:44

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:71

    ```suggestion Existing anonymous settings (pre v13 style, e.g. settings without a ```

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:73

    ```suggestion a tree, since it is not known which tree node is key or a value. ```
  7. core-ci voted on patch set 3 V +1 06/17/25, 21:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80439

  8. Garvin Hicking commented on patch set 3 06/17/25, 22:06

    SettingsProvider.php:49

    Should we use named arguments here, this is a DTO with PCPP? (also line below)

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:69

    Should we acknowledge that this comes at a "cost" of having duplication/redundancy in large setting files? (ie something like: settings.styles.content.color1 settings.styles.content.color2 settings.styles.sheets.color1 ... and that it might still be "acceptable" to keep this in non-GUI managed environments in tree-format? Or is the tree format subject to a soonish deprecation in your view?
  9. Benjamin Franzke uploaded patch set 4 V +1 06/18/25, 06:51

  10. Benjamin Franzke commented on patch set 4 06/18/25, 06:51

    SettingsProvider.php:49 Reply

    ack, fine by me. Done

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:69 Reply

    I tried to acknowledge that with the first sentence "This tree representation is easier to write". I was about to deprecate the tree-based view, but I then wanted to keep it for the 99% cases where it does not harm.. Let's put it that way: No decision has been taken yet ;) But it's actually the superior format, which I'd still recommend to use (threfore I wrote "advised"), to avoid any conflicts, once a setting is added. For example, given the following settings defined as a tree: ``` settings.styles.content.color1 settings.styles.content.color2 ``` One can never add `styles.content` as a setting key, since based on the tree representation this setting would get `{color1: …, color2: …}` assigned, which was not the intention. So, I'd like to grasp some feedback once we have the map. Maybe it's not that bad. The good part is: Copy&Paste from documentation is super easy, no need to pick the right indent level, as in form framework yaml configurations… ;) So maybe people will like it – I hope so.

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:71 Reply

    Done

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:73 Reply

    Done
  11. core-ci voted on patch set 4 V +1 06/18/25, 06:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80455

  12. Garvin Hicking commented on patch set 4 06/18/25, 11:59

    I've tried this with a settings.yaml file that held this: ``` myExtension: myKey: myEntry: 2750 plugin: bootstrap_package: settings: scss: min-contrast-ratio: 4.6 ``` with the patch applied, editing and saving this yields a file: ``` myExtension: myKey: myEntry: 2750 plugin.bootstrap_package.settings.scss.min-contrast-ratio: 4.6 ``` The "myExtension:..." settings are something that probably got removed from a dummy settings.definitions.yaml file of mine. It's ok that this is not touched IMO - even though it is now a mixture of both forms? However, the settings overview now show this mixed display: https://www.dropbox.com/scl/fi/m8fefcbcj5vvqoygf7z2u/Screenshot-2025-06-18-at-13.55.24.png?rlkey=9o8vxqdcz2caj1b41mvahejow&dl=0 ``` Custom Settings (3) plugin.bootstrap_package.settings.scss.min-contrast-ratio: 4.6 plugin\.bootstrap_package\.settings\.scss\.min-contrast-ratio: 4.6 myExtension.myKey.myEntry: 2750 ``` so both a way with escaped and non-escaped dots is shown...?

    Important-106894-SiteSettingsyamlIsNowStoredAsAMap.rst:69 Reply

    Thanks for explaining this in depth. I also see much benefit with a redundant style here. But reading the Changelog wasn't so clear to me whether the "old style" is about to be axed and if I'm forced to rewrite everything, or if I'm not facing the 1% I could just keep it as-is. I see that the intention is to nudge people into the direction, so I think we can keep the text as it is, since it supports this nudging.
  13. Garvin Hicking commented on patch set 4 06/18/25, 11:59

    Reply

    (unresolving)
  14. Benjamin Franzke commented on patch set 4 CR -1 06/18/25, 12:23

    Reply

    mixture of undefined settings is expected, as written in RST: > Existing anonymous settings … will be preserved as a tree but the escaped variant of the defined setting in the settings overview is not ok. I also saw this during development but thought I fixed it – seems I broke it again. Will check, thanks!
  15. Garvin Hicking rebased onto patch set 5 CR -1 V +1 06/18/25, 12:45

  16. Garvin Hicking commented on patch set 5 06/18/25, 12:48

    Reply

    (Sorry, I mistakenly created a GIT relation chain while working on another patch - I hope it only rebased this one. Mea culpa)
  1. core-ci voted on patch set 5 V +1 06/18/25, 12:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80465

  2. Benjamin Franzke uploaded patch set 6 V +1 06/20/25, 08:13

  3. Benjamin Franzke commented on patch set 6 06/20/25, 08:13

    Reply

    Fixed, thx!
  4. core-ci voted on patch set 6 V +1 06/20/25, 08:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80520

  5. Benjamin Franzke uploaded patch set 7 V +1 06/20/25, 08:23

  6. core-ci voted on patch set 7 V +1 06/20/25, 08:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80524

  7. Benjamin Franzke uploaded patch set 8 V +1 06/20/25, 13:01

  8. core-ci voted on patch set 8 V +1 06/20/25, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80530

  9. Benjamin Franzke uploaded patch set 9 V +1 07/02/25, 12:53

  10. core-ci voted on patch set 9 V +1 07/02/25, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81243

  11. Benjamin Franzke uploaded patch set 10 V +1 07/03/25, 12:38

  12. core-ci voted on patch set 10 V +1 07/03/25, 12:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81280

  13. Benjamin Kott voted on patch set 10 CR +1 V +1 07/03/25, 12:59

  14. Garvin Hicking commented on patch set 11 CR +1 V +1 07/03/25, 19:49

    Published edit on patch set 10.
  15. Garvin Hicking commented on patch set 11 CR +1 V +1 07/03/25, 19:51

    Some cool goodies in this one with composition over inheritance and polishing, thanks for taking care of this.
  16. core-ci voted on patch set 11 V +1 07/03/25, 19:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81290

  17. Simon Schaufelberger commented on patch set 11 07/03/25, 22:36

    SettingsFactory.php:83

    final classes can't be extended, therefor this method can be private
  18. Benjamin Franzke uploaded patch set 12 CR +1 V +1 07/04/25, 04:24

  19. Benjamin Franzke commented on patch set 12 07/04/25, 04:24

    SettingsFactory.php:83 Reply

    I honestly don't care, but hey, done…
  20. core-ci voted on patch set 12 V +1 07/04/25, 04:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81300

  21. Garvin Hicking voted on patch set 12 CR +1 V +1 07/04/25, 05:43

  22. Benjamin Kott voted on patch set 12 CR +1 V +1 07/04/25, 06:20

  23. Benjamin Franzke voted on patch set 12 CR +2 V +2 07/04/25, 06:35

  24. Benjamin Franzke merged patch set 13 07/04/25, 06:58

  25. Lina Wolf commented on patch set 13 07/14/25, 10:00

    Should we also change the site package generator on get.typo3.org? https://github.com/TYPO3/get.typo3.org/pull/496