[PP-1] core.extension should be validatable

Created on 20 March 2024, about 1 year ago

Problem/Motivation

Over at ๐Ÿ› Install profile is disabled for lots of different reasons and core doesn't allow for that Fixed , the schema for core.extension:profile is being refined.

Once that lands, we'll be able to make it validatable too, and make the entire config object validatable!

Conversation that triggered this issue to be created:

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Postponed

Version

11.0 ๐Ÿ”ฅ

Component
Baseย  โ†’

Last updated about 2 hours ago

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

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

Merge Requests

Comments & Activities

  • Issue created by @wim leers
  • Merge request !7107Outline what needs to happen here. โ†’ (Closed) created by wim leers
  • Issue was unassigned.
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Draft MR created.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Pipeline finished with Failed
    about 1 year ago
    Total: 177s
    #124087
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Closed ๐Ÿ“Œ Improve core.extension:profile validation Postponed as a duplicate. Crediting @alexpott.

  • Status changed to Active about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Pipeline finished with Failed
    about 1 year ago
    Total: 165s
    #125256
  • Pipeline finished with Failed
    about 1 year ago
    Total: 487s
    #125262
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Pipeline finished with Failed
    about 1 year ago
    Total: 184s
    #125286
  • Status changed to Needs work about 1 year ago
  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev

    kunal.sachdev โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    11 months ago
    Total: 179s
    #184758
  • Pipeline finished with Failed
    11 months ago
    Total: 266s
    #184796
  • Pipeline finished with Failed
    11 months ago
    Total: 263s
    #191502
  • Pipeline finished with Failed
    11 months ago
    Total: 574s
    #191509
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev

    Most tests are failing because in TestBase setup() we do

    $this->container->get('theme_installer')->install(['stark']);
    

    and in ThemeInstaller we have

    $extension_config
            ->set("theme.$key", 0)
            ->save(TRUE);
    

    which also tries to validate the config and it breaks for ExtensionExistsContraint with error message 'Theme stark is not installed', which is true. I think we could add a check in ThemeInstaller before saving the key in the config, something like this-

    if (!isset($installed_themes[$key])) {
            $extension_config
            ->set("theme.$key", 0)
            ->save(TRUE);
     }
    

    , but I am not really sure about this.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev
    • @phenaproxima thinks that ExtensionExists constraint doesn't make a ton of sense for core.extension see ( 3441503-#18 ๐Ÿ“Œ Add validation constraints to system.theme Needs work ) for more details.
    • Also discussed this with @phenaproxima in slack and concluded that if we want to use ExtensionExists constraint for core.extension then ExtensionExistsConstraintValidator should be completely refactored and use the ModuleExtensionList and ThemeExtensionList, which can report on existing-but-not-yet-installed things.
  • Pipeline finished with Failed
    10 months ago
    Total: 602s
    #202678
  • Pipeline finished with Failed
    10 months ago
    #203544
  • Pipeline finished with Failed
    10 months ago
    Total: 571s
    #203550
  • Pipeline finished with Failed
    10 months ago
    Total: 597s
    #203574
  • Pipeline finished with Failed
    10 months ago
    Total: 476s
    #208437
  • Pipeline finished with Failed
    10 months ago
    Total: 566s
    #210465
  • Pipeline finished with Failed
    10 months ago
    Total: 483s
    #210505
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia yash.rode pune

    yash.rode โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    10 months ago
    Total: 540s
    #221448
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia yash.rode pune

    Tests are passing now

  • Pipeline finished with Success
    9 months ago
    Total: 1171s
    #224663
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium borisson_ Mechelen, ๐Ÿ‡ง๐Ÿ‡ช

    I feel that ExtensionExists should be whether the extension exists and we should have a separate constraints - the other constraint should be called ExtensionInstalled. However this is unfortunate because we already have ExtensionExists and it's current meaning is that it is installed.

    Not sure what to do.

    This is a difficult question. In my opinion ExtensionExists/ExtensionInstalled makes sense, but renaming this and after that reusing the name for the other meaning is difficult. Can we use ExtensionPresent to indicate that should be present on the file system?

  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Believe this needs work for the feedback mentioned in #16? Also is MR 7107 needed anymore?

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    ModuleHandler already uses exists to check for installed. So the naming is kinda consistend.

    If we need to seperate why now;

    ExtentionAvailable, which would be consistent with things like; 'update available' or perhaps 'moduel available to install'. Doesn't feel that weird to me.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium borisson_ Mechelen, ๐Ÿ‡ง๐Ÿ‡ช

    ExtentionAvailable makes a lot of sense to me.

  • Pipeline finished with Canceled
    20 days ago
    Total: 64s
    #465338
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Extracted the validator so naming makes sense. Split tests also and did a rebase so we run the right tests.

  • Pipeline finished with Failed
    20 days ago
    Total: 287s
    #465340
  • Pipeline finished with Failed
    20 days ago
    Total: 222s
    #465347
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Latest MR appears to have pipeline issues. Can 1 MR be closed or hidden also to make it super clear what should be reviewed

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Oops, thanks, juggling a lot of issues, will cycle back.

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Closed MR, and fixed phpstan issue.

  • Pipeline finished with Success
    20 days ago
    Total: 383s
    #465612
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Left 1 question and 1 comment on the MR.

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Did all the promotions, time to go home :)

  • Pipeline finished with Failed
    20 days ago
    Total: 127s
    #465732
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    all failures unrelated.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Using config inspector I see we are at 100% now.

    Believe all feedback has been addressed

  • Pipeline finished with Failed
    20 days ago
    Total: 3205s
    #465739
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    rebased, only to see if the unrelated failures have been fixed.

  • Pipeline finished with Success
    16 days ago
    Total: 885s
    #468590
  • Pipeline finished with Success
    15 days ago
    Total: 672s
    #468955
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    The big issue left is the new constraint - left a big comment on the MR.

  • Pipeline finished with Failed
    15 days ago
    #469181
  • Pipeline finished with Success
    15 days ago
    #469187
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Struggling with the datadefiniotion to test. Giving up for now. :)

  • Pipeline finished with Failed
    14 days ago
    Total: 534s
    #470421
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    That took a while, this typed data is a rollercoaster :x

    Think i have working tests now prooving stuff works. Yay!

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Next up, see if it can be rewritten to use the Composite constraint.

  • Pipeline finished with Success
    14 days ago
    Total: 6126s
    #470488
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Not sure who made ExtensionNameConstraint but that message is useless. "The value is not valid.". That could easily be something more sane :x

  • Pipeline finished with Failed
    14 days ago
    Total: 151s
    #470593
  • Pipeline finished with Failed
    14 days ago
    Total: 420s
    #470594
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Test are running, but im quite confident they will end up green.

    Added __clone to ExecutionContext since that makes it possible to collect messages and then combine them in the original context (see ๐Ÿ“Œ Remove the restriction from RecursiveContextualValidator that prevents using custom groups. Needs review where that is also used for AtLeastOneOf)

  • Pipeline finished with Success
    14 days ago
    Total: 501s
    #470601
  • Pipeline finished with Failed
    13 days ago
    Total: 273s
    #470832
  • Build has PHPCS issue. Also added some comments to the MR.

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Than you so much for the review :)

  • Pipeline finished with Failed
    12 days ago
    Total: 189s
    #471780
  • Pipeline finished with Failed
    12 days ago
    Total: 113s
    #471781
  • Pipeline finished with Canceled
    12 days ago
    Total: 114s
    #471783
  • Pipeline finished with Canceled
    12 days ago
    Total: 92s
    #471784
  • Pipeline finished with Failed
    12 days ago
    Total: 133s
    #471785
  • Pipeline finished with Failed
    12 days ago
    Total: 462s
    #471787
  • Pipeline finished with Failed
    12 days ago
    Total: 338s
    #471796
  • Pipeline finished with Success
    12 days ago
    Total: 843s
    #471800
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    Went through your (thorough) review, this made the a few things way better. I have a response to two of your suggestions which i think might have issues if we do that.

  • Pipeline finished with Failed
    6 days ago
    Total: 191s
    #476489
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands

    I think i adressed the last comment and made it quite a bit simpler code.

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands
  • Pipeline finished with Success
    6 days ago
    Total: 625s
    #476493
  • The Needs Review Queue Bot โ†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    5 days ago
    Total: 687s
    #477142
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands bbrala Netherlands
Production build 0.71.5 2024