Review main Merged

84891[BUGFIX] Include keys in YamlFileLoader placeholder processing

David Mellen CR +2 V +2 Normal +99 −0 updated 06/30/24, 11:55

Commit message

This commit allows to use environment variables in YAML keys as well.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 3043

Show 1118 earlier messages
  1. David Mellen uploaded patch set 1 06/25/24, 06:13

  2. core-ci voted on patch set 1 V +1 06/25/24, 06:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60261

  3. Benni Mack updated the commit message in patch set 2 V +1 06/25/24, 06:32

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

  5. Oli Bartsch commented on patch set 2 06/25/24, 08:41

    Could we get some test for this?
  6. Mathias Brodala commented on patch set 2 06/25/24, 08:47

    YamlFileLoader.php:193

    This could lead to overwriting unrelated keys. Was this intentional? E.g: foo: foo value %env(BAR)%: bar value Given B=foo, you'd end up with: foo: bar value Also we should probably also check via $this->containsPlaceholder($k) first.
  7. Oli Bartsch uploaded patch set 3 V +1 06/25/24, 08:47

  8. Oli Bartsch commented on patch set 3 06/25/24, 08:48

    Reply

    Done
  9. core-ci voted on patch set 3 V +1 06/25/24, 08:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60277

  10. Oli Bartsch uploaded patch set 4 V +1 06/25/24, 08:56

  11. Oli Bartsch commented on patch set 4 06/25/24, 08:57

    YamlFileLoader.php:193 Reply

    Not sure whether this is intended. I however added this case to the new test. Let's see what was intended by the author.
  12. core-ci voted on patch set 4 V -1 06/25/24, 09:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60278

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

  14. David Mellen uploaded patch set 5 V +1 06/25/24, 12:06

  15. Mathias Brodala commented on patch set 5 CR -1 06/25/24, 12:09

    YamlFileLoader.php:196

    This have more details and mention both the unresolved as well as the resolved key. Otherwise debugging is next to impossible.
  16. core-ci voted on patch set 5 V +1 06/25/24, 12:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60290

  17. David Mellen uploaded patch set 6 CR -1 V +1 06/25/24, 12:20

  18. core-ci voted on patch set 6 V +1 06/25/24, 12:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60291

  1. David Mellen commented on patch set 6 06/26/24, 09:27

    YamlFileLoader.php:193 Reply

    Not intentional, fixed.

    YamlFileLoader.php:196 Reply

    Done
  2. Mathias Brodala commented on patch set 6 CR -1 06/26/24, 09:42

    YamlFileLoader.php:192

    The unsetting should be done right before setting the new key. This ensures that code catching the exception still has access to the unprocessed value.

    YamlFileLoader.php:201

    This can be merged into one line, no need to overwrite $k anymore.
  3. David Mellen commented on patch set 6 06/26/24, 10:13

    YamlFileLoader.php:201 Reply

    $k has to be overwritten to process the value placeholders or am I wrong?
  4. Mathias Brodala commented on patch set 6 06/26/24, 10:19

    YamlFileLoader.php:201 Reply

    Indeed, the loop continues afterwards, missed that. Then this is correct.
  5. David Mellen uploaded patch set 7 CR -1 V +1 06/26/24, 10:42

  6. Mathias Brodala commented on patch set 7 CR +1 06/26/24, 10:42

    YamlFileLoader.php:192 Reply

    Done
  7. David Mellen commented on patch set 7 06/26/24, 10:43

    YamlFileLoader.php:192 Reply

    Done
  8. core-ci voted on patch set 7 V -1 06/26/24, 10:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60371

  9. David Mellen rebased onto patch set 8 CR +1 V -1 06/28/24, 09:23

  10. core-ci voted on patch set 7 V -1 06/28/24, 09:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60371

  11. core-ci voted on patch set 8 V +1 06/28/24, 09:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60542

  12. Oli Bartsch voted on patch set 8 CR +1 V +1 06/28/24, 09:39

  13. Georg Ringer voted on patch set 8 CR +1 V +1 06/28/24, 20:03

  14. Stefan Bürk voted on patch set 8 CR -1 06/29/24, 13:32

  15. Stefan Bürk commented on patch set 8 06/29/24, 14:57

    YamlFileLoader.php:194

    I'd say that this message should be splitted into dedicated message to make clear what happend, as this is now thrown for two different cases: a) placeholder resolved to a value already existing as key b) placeholder not resolved staying the same key, detected as existing. Usually, unresolvable placeholder are silently not further handled. So we need to decide to either silently swallow unresolable placeholders OR throw a dedicated exception message (and code) for that case to have here a distinction between these two cases.
  16. Stefan Bürk uploaded patch set 9 CR +1 V +1 06/29/24, 14:58

  17. Stefan Bürk commented on patch set 9 06/29/24, 14:59

    YamlFileLoader.php:194 Reply

    Pushed the varant with a dedicated message along with further tests for these scenarios.
  18. core-ci voted on patch set 9 V -1 06/29/24, 15:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60632

  19. Stefan Bürk uploaded patch set 10 V -1 06/29/24, 21:02

  20. core-ci voted on patch set 10 V -1 06/29/24, 21:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60646

  21. core-ci voted on patch set 10 V +1 06/29/24, 21:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60646

  22. Stefan Bürk voted on patch set 10 CR +1 V +1 06/29/24, 22:08

  23. Oli Bartsch voted on patch set 10 CR +1 V +1 06/30/24, 07:49

  24. Stefan Bürk voted on patch set 10 CR +2 V +2 06/30/24, 11:39

  25. Stefan Bürk merged patch set 11 06/30/24, 11:55