Views' config schema should not consider fallback plugin IDs as valid

Created on 14 September 2023, almost 2 years ago

Problem/Motivation

This was discovered while working on πŸ“Œ Adopt PluginExists validator in relevant places RTBC .

It turns out that there are a good number of views in core (mostly test views, but some are part of modules' shipped config) that reference invalid handler plugin IDs. Apparently these are converted to supported plugin IDs at runtime (or install time? I'm not really sure), but that still means the config we're shipping is invalid.

At the moment, the only reason tests don't fail is because we are allowing Views config schema to accept invalid plugin IDs, and considering the fallback plugin IDs as valid, just so we don't have to fix all those views in πŸ“Œ Adopt PluginExists validator in relevant places RTBC . That work should be done in a separate scope (this issue).

Steps to reproduce

If you remove the allowFallback: true lines from Views' config schema, you'll start to get test failures due to various views using invalid handler plugin IDs.

Proposed resolution

Remove all of the allowFallback: true lines and fix the views which cause trouble.

Remaining tasks

Do that, and commit it.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • Status changed to Postponed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • Status changed to Active over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Blocker is in.

  • Merge request !6526Let slip the dogs of war! β†’ (Open) created by phenaproxima
  • Pipeline finished with Failed
    over 1 year ago
    Total: 522s
    #91294
  • Pipeline finished with Failed
    over 1 year ago
    Total: 560s
    #91378
  • Pipeline finished with Failed
    over 1 year ago
    Total: 462s
    #91389
  • Pipeline finished with Failed
    over 1 year ago
    Total: 663s
    #91401
  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Okay, I got the ball rolling here by fixing (I think) nearly all of the kernel tests. Functional tests are probably still going to fail. But I think what I have already got is a good start for someone else to pick up.

  • Pipeline finished with Failed
    over 1 year ago
    Total: 482s
    #91429
  • Pipeline finished with Failed
    over 1 year ago
    Total: 583s
    #91655
  • First commit to issue fork.
  • Pipeline finished with Failed
    3 months ago
    Total: 872s
    #471954
  • Pipeline finished with Running
    3 months ago
    #472262
  • Pipeline finished with Failed
    3 months ago
    Total: 167s
    #472275
  • Pipeline finished with Failed
    3 months ago
    Total: 616s
    #472276
  • Pipeline finished with Canceled
    3 months ago
    Total: 95s
    #472301
  • Pipeline finished with Failed
    3 months ago
    Total: 570s
    #472302
  • Pipeline finished with Canceled
    3 months ago
    Total: 84s
    #472313
  • Pipeline finished with Canceled
    3 months ago
    #472314
  • Pipeline finished with Canceled
    3 months ago
    Total: 184s
    #472315
  • Pipeline finished with Success
    3 months ago
    #472317
  • πŸ‡³πŸ‡±Netherlands bbrala Netherlands

    All green.

    1. Skip validation on an intentional broken view.
    2. Fix multiple views where plugins were not existing.
    3. Adjust one test which seemed reasonable to have that as output. Think that is no BC

    Think this is good to go.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Searched for allowFallback: true in views and all 6 instances appear to be addressed.

    Assuming if any views were missed they would of got picked up, so assuming this is good to go

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Skimmed through this and there are no questions unanswered. Rather straightforward actually.

  • Status changed to RTBC 11 days ago
  • πŸ‡ΊπŸ‡ΈUnited States xjm

    Saving reviewer credit.

  • πŸ‡ΊπŸ‡ΈUnited States xjm

    Cry havoc, and... grep!

    [ayrton:drupal | Sun 12:29:25] $ ca https://git.drupalcode.org/project/drupal/-/merge_requests/6526.diff
    # ...much composer and yarn...
    [ayrton:drupal | Sun 12:31:09] $ grep -r "allowFallback: true" * | grep "yml" | grep -v "vendor" | grep -v "node_modules"
    core/config/schema/core.data_types.schema.yml:          allowFallback: true
    core/modules/block/config/schema/block.schema.yml:          allowFallback: true
    

    Those are both not-Views-data schemata, so I think the scope is complete.

  • πŸ‡ΊπŸ‡ΈUnited States xjm

    Regarding @smustgrave's remarks:

    Assuming if any views were missed they would of got picked up, so assuming this is good to go

    Given #12, the only possibility is now that there are invalid views that also have no test coverage whatsoever. I'll have a think for a few minutes as to whether there is an easy way to look for that. It's worth considering since we would be replacing a soft data integrity problem with a hard data integrity problem when we make this change in Views.

    Also, this change is disruptive. While we're fixing all the core views, contrib and custom ones might be relying on this fallback too. So this needs at least a CR and maybe a release note. And... maybe even more. I bet loads of broken views are kicking around in sites and repos. I think, in fact, than an upgrade path of some flavor may be needed, or some deprecation-y thing.

    What exactly happens if you have an invalid view and the schema support for the fallback is removed? The before versus after.

    At the outside, we might want to split this MR into one that has the changes to all the views but that doesn't change the core schema, and put the schema change in a separate issue with an upgrade path and BC and whatnot.

    Tagging for RM review since this is potentially disruptive fun time and we'll want to review the specific mitigations before it goes in.

    Thanks everyone!

  • πŸ‡ΊπŸ‡ΈUnited States xjm

    BTW, I haven't specifically asked in the RM channel about this issue yet, because it would be helpful to have other contributors' knowledge and ideas documented on issue first about:

    Also, this change is disruptive. While we're fixing all the core views, contrib and custom ones might be relying on this fallback too. So this needs at least a CR and maybe a release note. And... maybe even more. I bet loads of broken views are kicking around in sites and repos. I think, in fact, than an upgrade path of some flavor may be needed, or some deprecation-y thing.

    What exactly happens if you have an invalid view and the schema support for the fallback is removed? The before versus after.

    At the outside, we might want to split this MR into one that has the changes to all the views but that doesn't change the core schema, and put the schema changes in a separate issue with an upgrade path and BC and whatnot.

    Thanks!

Production build 0.71.5 2024