Our config schema's are seriously broken sadly enough :(.
We have no schema for processors for example.
Because of that values are getting saved incorrectly in the yml file and a lot of core features rely on a correct schema.

CommentFileSizeAuthor
#13 interdiff.txt975 bytesamateescu
#13 2235381-13.patch10.26 KBamateescu
#12 2235381.patch10.29 KBamateescu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Title: Schema for preprocessors is missing » Fix config schema

Changing the title to reflect the larger scope. Missing are, as far as I can see:

  • The normal settings (present in the proper module already – though with other settings, back then)
  • Index options: "fields", "additional fields", "processors"
  • Also, I think we'll need definitions for the configurations for each of our datasource, tracker and processor implementations, right? That's what the search_api.datasource.plugin.[%parent.datasourcePluginId] magic does, unless I'm mistaken.

Also, though that's maybe a different issue, the properties are rather inconsistent. machine_name vs. serverMachineName, for example, and datasourcePluginId is just a bit verbose. Same for the option names: cron_limit vs. additional fields.

drunken monkey’s picture

Issue tags: +sprint
amateescu’s picture

About "machine_name vs. serverMachineName", core tries to follow the snake case pattern for this (but doesn't always succeed :P), we should try to match that as well.

And "additional fields" is definitely wrong, it should have an underscore there.

I'm wondering if this issue should wait for any other architectural changes, like #2230931: Supporting multiple item types per index. By the way, are there any other big ones besides that?

drunken monkey’s picture

#2241429: Support translations might also be a larger change, but should ideally only affect the content entity datasource.

Other than that, #2044421: [meta] Upgrade to Drupal 8 lists all the current goals for the module. I don't think there are any larger architectural changes there, but until RC status, anything could still come up.

In any case, I think we can just do this at any point at which we want to, and just (try to) remember afterwards to also update the config schema when making any related changes.

amateescu’s picture

Status: Active » Postponed

Committed a small patch for search_api.settings.yml: http://drupalcode.org/sandbox/daeron/2091893.git/commitdiff/60dbcd2

I think the rest should be postponed on #2230931: Supporting multiple item types per index so we don't cause unnecessary conflicts.

drunken monkey’s picture

Agreed. Thanks!

drunken monkey’s picture

Component: Backend » Framework
Status: Postponed » Active

Hm, I think this can be un-postponed now?
Does anyone want to work on this? Or should we still wait, until we are moving back to the original repository?

aspilicious’s picture

Assigned: Unassigned » aspilicious

I took a day idea of the recover from this weekend. I think I can handle this patch today.

drunken monkey’s picture

Thanks a lot!

Sorry, I was busy with other work before so couldn't respond in IRC:

and last but not least, views groups the ID listing and the config under one single key
in search_api ypu have 2 arrays now
one with only the ID's and one with the config
I think (if possible) we should merge it into datasourcePlugins

It was like that before, and I would like it much better, too, but someone said for the config schema having it in two separate properties makes more sense. If this is not the case, all the better!
In general, do what you must to make this work, the current storage schema isn't set in stone. I'd also be far from against overriding toArray() – at least we could then finally declare $original as a property and get rid of a few code style warnings. ;)

  • Commit 862fcfd on 2257113-Index-Processors-Fields by ekes:
    Issue #2235381 Save and check processor enabled fields with indexes.
    
drunken monkey’s picture

From short dicussion with Nick: search_api.processor.plugin.node_status seems to lack a mapping for its settings.

amateescu’s picture

Assigned: aspilicious » amateescu
Status: Active » Needs review
FileSize
10.29 KB

This patch should fix all the issues that I see with the current schemas. Note that the "datasources + datasources_configs" problem is not finished yet but pending on the resolution of #2291073: Config schema doesn't support referencing plugin derivatives in core.

amateescu’s picture

FileSize
10.26 KB
975 bytes

Fixed a wrong indentation, noticed by @aspilicious in IRC.

aspilicious’s picture

Good to go! But we need an issue to track an issue about empty configuration.
==> search_api.tracker.schema.yml

No idea how to handle this, maybe removing is ok? Maybe we should open a core issue?

amateescu’s picture

Status: Needs review » Fixed
Issue tags: -sprint

I'm pretty sure removing the schema for plugins that don't have any configuration is perfectly ok.

Status: Fixed » Closed (fixed)

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