Add default value for config source on input defaults for recipes

Created on 23 July 2025, 16 days ago

Problem/Motivation

There are currently 3 sources for default values when it comes to input collection for recipes: value, config, and env. My original idea on how their usage could be improved to make recipes more generically applicable was a chain of fallbacks like this:

input:
  name:
    default:
      - source: env
        env: NAME
      - source: config
        config: ['some.settings', 'name']
      - source: value
        value: My name is something

This could be used in automatic scripts where env variables would be available, but it could also be used interactively, and to re-apply a recipe, without having to maintain a recipe in different flavours for those different use cases. It would use the first source that provides a value in the order env/config/value.

But in a Slack thread I learned that this is too complex but that a fallback value for at least the config source would make sense, e.g. like this:

input_name:
  default:
    source: config
    config: ['foo.settings', 'baz']
    value: bar

So, if a config object foo.settings doesn't exist (yet), instead of failing in InputConfigurator.php line 191, it could fall back to the given value.

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

recipe system

Created by

πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024