Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add if-not-set modifier #80

Open
peterjaap opened this issue Dec 13, 2024 · 3 comments
Open

Add if-not-set modifier #80

peterjaap opened this issue Dec 13, 2024 · 3 comments

Comments

@peterjaap
Copy link
Contributor

We want to start using this extension to push configuration to production by running bin/magento config:data:import config/store production in our pipeline.

We want to do this to add initial configuration for 3rd party extensions, much like the <default> tag in config.xml files.

However, we only want to do this when no initial value has been set, so basically we want to set a constraint, or an "if" modifier.

I was thinking about something like this;

path/to/config:
    if-not-set: true
    default:
        0: 1

Or

path/to/config:
    if: not-set
    default:
        0: 1

In the second case, the 'not-set' might in the future also be changed to something to introduce constraint based on either values already imported.

@dermatz
Copy link

dermatz commented Dec 18, 2024

Hey @peterjaap,

I've tried to implement this in my branch.
Maybe it's what you need? Can you test it?

#81

@therouv
Copy link
Contributor

therouv commented Dec 20, 2024

@peterjaap Great suggestion! Personally, I prefer the second approach, if: not-set, as it offers more flexibility and allows for adding additional constraints in the future.

@dermatz Thanks for your efforts! I'll provide some feedback in the PR.

@peterjaap
Copy link
Contributor Author

@dermatz pretty cool, looks good to me! But as per @therouv, maybe we should only support if: not-set to avoid confusion :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants