Ignore config keys that don't exist in DB

Created on 21 February 2020, over 4 years ago
Updated 4 January 2024, 6 months ago

Problem / Motivation

There is a sequence of thought that resulted in this ticket:

I've noticed that the Acquia Connector module sets a config value on the index at options.overridden_by_acquia_search. See https://git.drupalcode.org/project/acquia_connector/blob/287c8745350393a....

Acquia Connector has since changed to use State API, but it prompted the question: why doesn't this throw a schema violation since "overridden_by_acquia_search" isn't a valid option if you observe the config schema: https://git.drupalcode.org/project/search_api/blob/8.x-1.x/config/schema...

The Index config entity doesn't do any validation in the setOption method, but I assumed the config schema would still be run to validate at some point? See https://git.drupalcode.org/project/search_api/blob/8.x-1.x/src/Entity/In....

And, the reason this is important for Config Ignore is that I noticed that when running "drush config-status" I would see the state was overridden even though I had this line in my config ignore:

search_api.index.acquia_search_index:options.overridden_by_acquia_search

All that to say, is config ignore unable to detect the null case? i.e. the case where the config key at "search_api.index.acquia_search_index:options.overridden_by_acquia_search" is NOT in the datbase, but is in the exported config.

Proposed Resolution

First, create a failing test like so:

Given a config key NOT in the database, but is in the code (e.g. search_api.index.acquia_search_index:options.overridden_by_acquia_search)
When you ignore the config key
Then config import (or config status) does not result in a change to the config key

And, as I'm writing this I'm wondering if the issue is in config status and not config import. I'll try to update this later to confirm.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States josephdpurcell@gmail.com

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

Comments & Activities

Not all content is available!

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

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

    This issue is being closed because Config Ignore 2.x is deprecated.

    The new 3,x version has been re-written from the ground up and works in a totally different way, yet it provides the same backwards compatible functionality. All the 2.x tests pass in 3.x and the 3.x codebase is easier to maintain.
    Users of 2.x are strongly encouraged to upgrade to 3.x, as there is a very simple update path.

    So likely this issue is no longer relevant. If you think that this issue still applies please open it again and target the new branch. All issues on the 2.x branch were closed in bulk.

Production build 0.69.0 2024