Config Ignore + Config Split not working (for me)

Created on 1 March 2024, 4 months ago
Updated 16 April 2024, 2 months ago

I want to verify I'm using Config Ignore + Config Split as expected. Config Ignore seems to be entirely ignoring my config split. I feel like I'm not doing best practice and something is breaking as a result.

Firstly:
I have Config Split 3.2
I have Config Ignore 2.0.0

I have a config directory with this structure:
/config/default
/config/local
/config/development
/config/production

My system is set to use /config/local.

My config_ignore.settings.yml files are in each of the split config directories.

My config_split.config_split.local.yml files are in /config/default.

If I'm not doing any config ignore, config split works exactly as expected.

If the files are listed in config ignore, but the ignored files are in /config/default, config ignore works as expected.

But if I combine the two, it just doesn't work for me. Changes to a split /config/local/ yml file, where the config is listed in the config_ignore file get imported when they shouldn't be.

I've tried researching this and found a lot of "We've fixed this problem in Config Split 3.x"... but that's the version I'm using...

Let me try a concrete example:

1) Verifying No Config Split or Config Ignore

If I create /config/default/core.foo.yml, with the contents:
foo: 1
and run drush cim, it imports.

If I make no changes, it doesn't import.

If I edit the file and change the foo parameter to "foo: 2", it updates (as expected). Normal Config is working. Good.

2. Verifying config ignore works as expected

Leaving everything as case 1 above, in my /config/local/config_ignore.settings.yml, under "ignored_config_entities:" I add "- core.foo", drush cim correctly ignores changes to /config/default/core.foo.yml. Config Ignore is working (with a split config_ignore.settings.yml file). Good.

3. Verifying Config Split works as expected

First I remove the - core.foo from /config/local/config_ignore.settings.yml to return to Case 1 above.

Now I move the config file from /config/default/core.foo.yml to /config/local/core.foo,yml, and modify /config/default/config_split.config_split.local.yml to add - core.foo to "complete_list". drush cim works as expected. Updating the file and drush cim updates config. Not updating the yml file doesn't update. Config split is working as expected. Good.

4. The part where everything goes wrong

Now I go into my /config/local/config_ignore.settings.yml and add "- core.foo" to my "ignored_config_entities"...

If I modify the /config/local/core.foo.yml file and run drush cim I expect it not to import - it's on the config ignore list... But it does. The config ignore is ignored. That's not how that should work.

Now I can *delete* the file in /config/local/core.foo.yml, and it does ignore the file that isn't there... But that's not really an ignore.

I've tried playing around with intermediate and advanced settings, but don't see any difference.

I suspect I'm missing something trivial. Any suggestions on what that might be?

Are there any resources for how to set up a split ignored config I could review?

πŸ’¬ Support request
Status

Closed: works as designed

Version

3.2

Component

User interface

Created by

πŸ‡¨πŸ‡¦Canada TrevorBradley

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

Comments & Activities

  • Issue created by @TrevorBradley
  • πŸ‡¨πŸ‡¦Canada TrevorBradley

    Config Ignore's config is ultra simple. I'm wondering if it's something in the preamble of config split

    langcode: en
    status: false
    dependencies: {  }
    id: local
    label: Local
    description: ''
    weight: 2
    stackable: false
    no_patching: false
    storage: folder
    folder: ../config/local
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    This seems to be the same issue as πŸ› Splits: Ensure config_ignore works for everyone - set default to functional value Needs review

    And how do you expect this to work when you export the config?

  • πŸ‡¨πŸ‡¦Canada TrevorBradley

    And how do you expect this to work when you export the config?

    Presumably with the new config_ignore, with a simple config split it should not export or overwrite anything.

    Thanks for the other issue link. I'll check this out Monday and see if it's a duplicate.

  • Status changed to Postponed: needs info 4 months ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Hi, could you test your expectations with the split configured to use the collection storage?

    If you make the config import subscriber more heavy as suggested in πŸ› Splits: Ensure config_ignore works for everyone - set default to functional value Needs review but also for export and configure the split to use the collection storage then (and use the same config ignore settings on all collection, in particular the ones of splits) then config ignore should "ignore" also the change in your split.

    Thanks for your feedback.

  • πŸ‡¨πŸ‡¦Canada TrevorBradley

    @bircher - Acknowledge receipt of message.

    This is in my queue - which unfortunately has blown up. I'll see if I can research this next week.

  • πŸ‡¨πŸ‡¦Canada TrevorBradley

    Sorry for taking so long to get back to this.

    I've recreated my scenario 4 before and verified it's still failing to behave as expected.

    I upgraded to config_ignore 8.x-3.x dev (hash 96094ab987) which includes the recent fix to πŸ› Splits: Ensure config_ignore works for everyone - set default to functional value Needs review and it does work! (but only after a cache clear). If a setting is both in config_split and config_ignore it will not import in the split specific directory.

    Now, drush cex still exports and overwrites the split+ignored value when it shouldn't, but if I recall that's a different, known issue.

    Verified that composer require drupal/config_ignore:3.x-dev#96094ab987 solves this issue. I'll watch for that config_ignore next release.

    Let me close this.

  • Status changed to Closed: works as designed 2 months ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Thanks for looking into this and closing the issue.

    Yes for the export it will only work with splits that use the collection storage. Otherwise config ignore has no way of knowing where the config went.

Production build 0.69.0 2024