Ignore configuration storage collections

Created on 16 May 2018, about 6 years ago
Updated 27 January 2024, 5 months ago

Feature Request

Ignore specific storage collections.

Use Case

Platform: Acquia Cloud Site Factory

We have to clone our english site ~35 times, one site per country. Each country site may have an arbitrary set of languages turned on. We need to be able to ignore what languages are turned on, because the languages running per-site are unknown.

Current State

After turning on Spanish, and running an export, the storage collection language.es gets created and outputs a bunch of files to [config-dir]/default/language/es.

It also creates the files language.entity.es.yml and language.negotiation.yml but these files are easily ignored. However, I CANNOT get language/es to be ignored.

Desired State

I have a field that lets me exclude storage collections, similar to the ignore settings field where you can list what config objects you want ignored.

In the "Collections Ignore" field, I would be able to list language.*. After doing so, when I export, nothing gets exported to [config-dir]/default/language. When importing, existing collection config in language.* would be ignored and not deleted/updated/created.

✨ Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States lpeabody

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡·πŸ‡ΈSerbia g_miric

    LGTM!

  • πŸ‡ΊπŸ‡ΈUnited States j.cowher

    Thanks for this patch! I also needed to figure out how to ignore translated configuration and #78 worked great. We are using 3.0-beta2.

  • πŸ‡©πŸ‡ͺGermany hchonov πŸ‡ͺπŸ‡ΊπŸ‡©πŸ‡ͺπŸ‡§πŸ‡¬

    Re-roll since another hook_update_N() got in already. I also adjusted the patch to respect previously configured settings instead of reseting them since now the update will get executed one more time for sites that had the previous patch.

  • πŸ‡­πŸ‡ΊHungary nagy.balint

    Thank you for the patch!
    It works for us so far.

  • πŸ‡ΊπŸ‡ΈUnited States nsciacca Connecticut

    The patch in #91 no longer applies to 3.x-dev and it's not an easy re-roll... the split of modes with Basic, Intermediate, and Advanced complicates this.

  • Status changed to Needs work 8 months ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Yes the patch here needs to be re-worked. And I would argue the approach needs to be re-thought.

    But if you look at the code in 3.x-rc1 you will see that it was refactored with this issue in mind.

    To achieve the same purpose (ignoring config in certain collections), I think it would be easier to integrate them with the other patterns.

    You know that now you can ignore patterns with their config name and optionally separated with a : also ignore just parts of it. If you leave the partial part out then it is essentially everything, or *.

    I think we could do the same for collections. I don't know what the best separator would be. Let's assume for this argument that we settled on | as the separator, then imagine:
    lang.de|config_name:some.part and if you omit the language part it is implied just * and if you want your config to be ignore just in the default collection you would write |config_name

    So you could also ignore lang.*|* and ~lang.en|* which would mean ignore all languages except for English. This would just make it more difficult to then also ignore something but not everything in the english translations. But to be honest.. I think that is an edge case that we could be ok with. I don't think we need ~~ to exclude excludes... But we could in a different issue.

  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    Made a quick patch for the RC version (without tests for now).

  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Hi
    Yes the patch from #95 is precisely what I had in mind.

    Tests should be pretty straightforward to write, one can just add more test cases to where all the other things are. They already have languages set up for this exact reason.

  • πŸ‡΅πŸ‡ΉPortugal joao.ramos

    #95 Worked for me for 3.1 release.
    Upgrading from 2.4 and after settings update it was pretty straightforward,

    Thanks a lot!

  • πŸ‡ΊπŸ‡ΈUnited States j.cowher

    Also confirming that #95 worked for me for 3.1 release.

    As a note for others - you'll need to update your config_ignore.settings after applying the patch from #95.

    Examples

    • * (will ignore everything)
    • ~webform.webform.contact (will force import for this configuration, even if ignored by a wildcard)
    • user.mail:register_no_approval_required.body (will ignore the body of the no approval required email setting, but will not ignore other user.mail configuration.)
    • language.*|* (will ignore all language collections)
    • language.fr|* (will ignore all fr language collection)
    • language.fr|field.field.* (will ignore all fr field translations)
    • ~language.fr|field.field.media.file.field_media_file (will force import for certain field translation)
  • Status changed to RTBC 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States j.cowher

    Changing the status of this issue to "Reviewed & tested by the community" per the Issue Status Field β†’ documentation.

  • Status changed to Needs work 8 months ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Before this can be committed someone needs to add a couple of test cases here:

    https://git.drupalcode.org/project/config_ignore/-/blob/8.x-3.x/tests/sr...

    It can be a simple configuration with a couple of the language examples.

  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    Added tests to the patch

  • Merge request !19[#2973431] Allowed to ignore collections β†’ (Closed) created by HitchShock
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    Hide all outdated patches and made a PR

  • Status changed to RTBC 7 months ago
  • πŸ‡¬πŸ‡§United Kingdom c_archer Cumbria

    The latest patch worked for me.

  • πŸ‡·πŸ‡ΈSerbia g_miric

    The latest patch worked for me too!

  • πŸ‡§πŸ‡ͺBelgium ScriptCircle

    this works for me

  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    @gmustapha not sure why you readded patch #79, but this is a patch for 2.x but we need a patch for 3.x already.
    If you need a patch for the old version you can just use the older patch (#79).

  • Status changed to Needs work 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States joelstein

    I have a use case that the patches in #95 and #101 don't resolve.

    For example, I'd like to ignore the site name in language collections.

    I expected something like this to work:

    - language.*|system.site:name (doesn't work)

    FYI:

    - language.*|system.site (works, but it ignores too much)
    - language.*|system.site.* (doesn't work, though the help text added in #95 suggests it should)

    • bircher β†’ committed 24e2898e on 8.x-3.x
      Issue #2973431 by HitchShock, bircher: Ignore configuration storage...
  • Status changed to Fixed 5 months ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Thank you everyone for contributing to this long standing issue!
    I was never really happy with how it worked in 2.x, but I am very happy to see that the architecture of 3.x makes this much simpler and yet much more flexible to configure.

    I added and changed some stuff based on the great work from patch in #101 and I added a test for #108 which passes so, if that doesn't work then we need to find a better test and fix it as a bug in the next release.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024