The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π«π·France andypost
The
use_more_text
should belabel
but sometimes it saved asfalse
because it should be translatableThank to @chx https://drupal.slack.com/archives/C1BMUQ9U6/p1683905207064219
sync/views.view.apps.yml: use_more_text: 'See all >' sync/views.view.content_recent.yml: use_more_text: More sync/views.view.release_notes.yml: use_more_text: 'View All' sync/views.view.smartsheet_in_the_news.yml: use_more_text: false sync/views.view.smartsheet_in_the_news.yml: use_more_text: 'View All βΊ' sync/views.view.smartsheet_in_the_news.yml: use_more_text: false sync/views.view.smartsheet_in_the_news.yml: use_more_text: 'Visit the newsroom βΊ' sync/views.view.smartsheet_in_the_news.yml: use_more_text: false sync/views.view.smartsheet_in_the_news.yml: use_more_text: 'View All βΊ' sync/views.view.taxonomy_term_content_hub_categories.yml: use_more_text: 'View All βΊ' sync/views.view.taxonomy_term_content_hub_categories.yml: use_more_text: false sync/views.view.taxonomy_term_content_hub_categories.yml: use_more_text: 'View All βΊ' sync/views.view.tmgmt_job_overview.yml: use_more_text: false sync/views.view.tmgmt_job_overview.yml: use_more_text: 'See all jobs Β»' sync/views.view.tmgmt_job_overview.yml: use_more_text: false sync/views.view.tmgmt_job_overview.yml: use_more_text: 'See all jobs Β»' sync/views.view.user_admin_people.yml: use_more_text: more
- π«π·France andypost
Filed child issue π Convert config schema to label for views use_more_text Closed: works as designed
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I think that based on what I did at π Expose validation constraint violations in Config Inspector UI and drush command Fixed , I should be able to simplify things here π€
- Assigned to wim leers
- π§πͺBelgium borisson_ Mechelen, π§πͺ
@Wim Leers, can we mark this test as incomplete, so that we can allow this to run on d.o infrastructure and have output from it, without it having to sit in the queue?
https://docs.phpunit.de/en/10.2/writing-tests-for-phpunit.html#incomplet...
- Status changed to Needs review
over 1 year ago 10:16am 25 July 2023 - last update
over 1 year ago Custom Commands Failed - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Since #12, a handful of crucial issues have landed:
type: machine_name
: π Add config validation for the allowed characters of machine names Fixedtype: _core_config_info
: π Add validation constraints to _core_config_info Fixedtype: langcode
: β¨ Add a `langcode` data type to config schema Fixed
The last 2 both in the past 2 weeks!
These have made the following fully validatable:
type: config_object
comment.settings
media_library.settings
menu_ui.settings
node.settings
system.feature_flags
Rerolled for all that, and compared to ~6 months ago in #3:
π Some real progress! π€©
#23: agreed, and looking into that π
- last update
over 1 year ago 29,869 pass, 2 fail - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Self-review after ~6 months of absence and progress in Drupal core:
+++ b/core/config/schema/core.data_types.schema.yml @@ -22,30 +22,45 @@ ignore: boolean: label: 'Boolean' class: '\Drupal\Core\TypedData\Plugin\DataType\BooleanData' + constraints: + PrimitiveType: [] ... integer: label: 'Integer' class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData' + constraints: + PrimitiveType: [ ]
This was done because:
Fortunately,
\Drupal\Core\TypedData\TypedDataManager::getDefaultConstraints()
handles that for us. IMHO that should be moved into the config schema for explicitness, but that's subjective. π€β #6.1
β¦ but as we're trying to get this to a committable state, reverting it.
- last update
over 1 year ago 29,880 pass, 1 fail - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
In addition to #25, I still stand by the rationale in #6.2 to do
mapping: label: Mapping class: '\Drupal\Core\Config\Schema\Mapping' definition_class: '\Drupal\Core\TypedData\MapDataDefinition' + constraints: + # By default, only allow the explicitly listed mapping keys. + ValidKeys: '<infer>'
β¦ but this is doing far more than just "create test". So let's remove that from the scope here and make this about only a test. Created π `type: mapping` should use `ValidKeys: ` constraint by default Fixed for that.
The last submitted patch, 25: 3324984-25.patch, failed testing. View results β
The last submitted patch, 26: 3324984-26.patch, failed testing. View results β
- last update
over 1 year ago 29,883 pass - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Applying the trick that @borisson_ proposed. That indeed should make tests pass!
If committed, this would:
- allow us to prevent further regressions: all new config schema types (and new config entity types) will cause this test to fail if they don't have validation constraints
- track progress of how many config schema types (and config entity types) are fully validatable: any time an additional one becomes validatable, this test will fail and would require an addition to
\Drupal\KernelTests\Core\Config\ConfigSchemaValidatabilityTest::FINISHED_CONFIG_SCHEMA_SUBTREES
To get the detailed output (as shown in e.g. #3), you'd have to run it locally and uncomment the two lines that contain this:
$this->markTestIncomplete('Remove this when https://www.drupal.org/project/drupal/issues/2164373 is complete.');
- Status changed to Needs work
over 1 year ago 12:36pm 25 July 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
was added in #5 and is obsolete thanks to β¨ Add a `langcode` data type to config schema Fixed .
Marking for:
- extracting one more piece from this issue into another
- making sure the logic is as simple as possible β my work on Config Inspector ~2 months ago suggests this can be simplified
- π§πͺBelgium borisson_ Mechelen, π§πͺ
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + /** + * {@inheritdoc} + * + * Ironically, strict config schema checking must be disabled for this test to + * run at all, because Drupal core does not have config schema for everything!
Mixing inheritdoc and documentation is not allowed, so we need to copy over the rest of the documentation from the base implementation
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + protected function getRawConfigSchemaDefinition(string $base_plugin_id): array {
this needs docs
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + // @todo support non-tail dynamic types.
We need to file a followup or fix this in this issue as well.
I'd prefer a followup because this is already very helpful as is.
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + $this->assertCount(594, $incomplete, 'A new config schema type was added without validation constraints.');
This can also be false when a complete schema is fixed; not sure if we need to change the message here.
I don't think we should, so can be ignored.
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + * (This is considered a single node in the tree.)
brackets are not needed here I think.
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + protected function isBaseType(string $type): bool {
Needs docs
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + protected static function getSubtree(array $definition): array {
needs docs
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + protected function getArrayElementProperties(array $definition): array {
needs docs
-
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaValidatabilityTest.php @@ -0,0 +1,668 @@ + protected function computeSubtreeValidatability(array $subtree, string $parent_property_path) : ConfigSchemaValidatability {
needs docs
-
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
#31: thanks, indeed all those things I still need to address π #30.2 should actually address the majority of those π
Meanwhile, π `type: mapping` should use `ValidKeys: ` constraint by default Fixed landed, and led to another big boost! Or β¦ it should have, but the numbers remain identical π€ That must be a bug. I do remember working on π Expose validation constraint violations in Config Inspector UI and drush command Fixed and starting from the code I wrote here, but realizing I could massively simplify it and make it more accurate. I'm hopeful that doing #30.2 will also fix that. π€
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- last update
about 1 year ago 30,058 pass - Status changed to Postponed
about 1 year ago 4:57pm 5 October 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This is an unsustainable core patch until such a time that it lands in core. It'll eventually be useful to do something like this β¦ but only when we actually reach 100%, to avoid regressing.
To be clear, we did make a ton of progress in the past few months:
$ git pull Already up to date. $ vendor/bin/drush config:inspect | grep 100 comment.settings Correct 100% β β menu_ui.settings Correct 100% β β node.settings Correct 100% β β shortcut.set.default Correct 100% β β system.feature_flags Correct 100% β β system.maintenance Correct 100% β β system.menu.account Correct 100% β β system.menu.admin Correct 100% β β system.menu.footer Correct 100% β β system.menu.main Correct 100% β β system.menu.tools Correct 100% β β user.mail Correct 100% β β $ vendor/bin/drush config:inspect | grep 100 | wc -l 12
Twelve fully validatable simple config objects right now!
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
FYI: Over at π Automated report on core config validatability Needs review , I'm working to generate a nice automated report, which eventually should also include charts π€
The very first run is happening right now: https://git.drupalcode.org/project/config_inspector/-/jobs/147889 π€©
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
On Dec 30, π Automated report on core config validatability Needs review landed. It now generates an up-to-date visualization of core config validatability daily.
It is currently underestimating because π Configuration schema & required values: add test coverage for `nullable: true` validation support Fixed did not update the ones listed/surfaced by #35. Fixing that in π Follow-up for #3364109: opt in already validatgable simple config to FullyValidatable Active .
- Issue was unassigned.
- Status changed to Fixed
8 months ago 8:58am 14 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Thanks to β¨ Add a "Validatable config" tests job to GitLab CI to help core evolve towards 100% validatability Fixed having landed, we don't need this anymore! π
Automatically closed - issue fixed for 2 weeks with no activity.