- Issue created by @wim leers
- Issue was unassigned.
- Status changed to Needs review
11 months ago 1:18pm 20 February 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
To my own surprise, this pretty much worked on the first try π€―
(Then again, I did already make a superset of all this work in
config_inspector
in π Automated report on core config validatability Needs review , and that was much harder. So all the necessary pieces already existed.)Impact
This would make the impact of π Allow vocabularies to be validated via the API, not just during form submissions RTBC , π Add validation constraints to announcements_feed.settings RTBC and β¨ New config schema data type: bytes Needs review (the three currently RTBC "config schema + validation" issues, one targeting all config entities of a certain type, one targeting a simple config object, one targeting a single config schema type) much easier to understand.
Reviews/likely concerns
I think there are a few obvious things to disagree with here:
- π€ Is it okay for this job to install
drush/drush
? I could work around this, although there's no trivial way to install modules from the command line then. - π€ Is it okay for this job to install
drupal/config_inspector
? I could move thedrush config:inspect --statistics
logic into Drupal core, but that seems far worse, because it increases the maintenance burden of Drupal core?
But β¦ the complexity here is entirely isolated to this single new core CI job. At any point in time can we easily remove this job. In fact, once the linked meta/plan issues are complete, I'd vote to remove this CI job. It's only a tool to help core's velocity and improve both contributor and committer DX.
- π€ Is it okay for this job to install
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This would also help make the Recipes initiative more likely to succeed, because more validatable config leads to more reliable recipes, which should lead to a stronger Recipes ecosystem.
- Status changed to Needs work
11 months ago 2:15pm 20 February 2024 - πͺπΈSpain fjgarlin
I added some feedback to the MR. All minor, some of them are questions.
- Status changed to Needs review
11 months ago 2:49pm 20 February 2024 - πͺπΈSpain fjgarlin
It looks good from my end. I like that it is self-contained, as you intended from the beginning.
I'd mark it as RTBC but I think issues like bringing "drush" need to be reviewed by a core maintainer to see the feasibility of this (temporary) job, so I'll leave it as Needs Review.Great work!
- π¬π§United Kingdom longwave UK
The one issue I see is that when we switch to
main
or open a new branch for core development, what happens whencomposer require drush/drush drupal/config_inspector
starts failing because there is no compatible package yet? Given this runs on any change to a .module file then this is likely to make MRs on a new branch fail even if they are nothing to do with config schema.But, perhaps we just deal with that when it happens by altering the job?
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
The one issue I see is that when we switch to
main
or open a new branch for core development, what happens whencomposer require drush/drush drupal/config_inspector
starts failing because there is no compatible package yet?config_inspector
is already declaring11.x
compatibility and is explicitly testing daily withOPT_IN_TEST_NEXT_MAJOR
.- Drush is a different matter indeed.
But, perhaps we just deal with that when it happens by altering the job?
+1 to this.
How about this for a pragmatic balance:
composer require β¦
today exits with code1
upon failure β we can append|| exit 99
- β¦ then we could use
allow_failure:exit_codes
(docs) to specifically allow failure only for99
, but not for anything else
Tada, graceful degradation! π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
@longwave Implemented what I proposed in #9 (but more explicitly/clearly) to address your concerns in #8: https://git.drupalcode.org/project/drupal/-/merge_requests/6700/diffs?co...
So now it should not even be necessary anymore to "just deal with it whenever that [Drush not compatible with next major Drupal version] happens".
- Status changed to Needs work
11 months ago 11:12pm 28 February 2024 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.
- Status changed to Needs review
11 months ago 10:43am 29 February 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Merged in upstream, addressed feedback from @longwave & @alexpott.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Issue summary updated to reflect the crucial changes made to the original CI job to make it:
- more resilient (@longwave review)
- more complete (@alexpott review)
- πΊπΈUnited States smustgrave
Neat!
Am seeing additional modules are being installed
[success] Successfully enabled: action, ban, basic_auth, book, config_translation, content_moderation, content_translation, datetime_range, field_layout, forum, help_topics, inline_form_errors, jsonapi, language, layout_builder, layout_discovery, locale, media, media_library, migrate, migrate_drupal, migrate_drupal_ui, mysql, pgsql, phpass, responsive_image, rest, sdc, serialization, settings_tray, statistics, syslog, telephone, tour, tracker, workflows, workspaces
Seems like a neat feature but would this eventually be a failing check when we reach 100%? Is there a way to have certain things skipped? Example deprecated modules
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Seems like a neat feature but would this eventually be a failing check when we reach 100%?
How's that? We'd have to stay at 100%, then there'd be no failure. Status quo is proven to also not trigger test failures β see point 1 in the proposed resolution for an example.
Is there a way to have certain things skipped? Example deprecated modules
Sure, we can do that. When the need arises. Again: if this ever gets in the way of core development, we can just delete it!
- πΊπΈUnited States smustgrave
In that case +1 but will leave in review for other eyes. Not sure I can mark it
- πΊπΈUnited States smustgrave
Is there any additional testing I can do to mark this RTBC?
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
@smustgrave You can try marking more/fewer things as fully validatable and re-confirm that it all works as expected, like I did for the issue summary π
- Status changed to Needs work
11 months ago 2:02pm 6 March 2024 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.
- Status changed to Needs review
11 months ago 2:38pm 6 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
$ git merge origin/11.x Auto-merging .gitlab-ci.yml Merge made by the 'ort' strategy. <snip>
π
- Status changed to Needs work
11 months ago 3:02pm 6 March 2024 - πΊπΈUnited States smustgrave
In install.core.inc line 964: The submitted value <em class="placeholder">sqlite</em> in the <em class="p laceholder">Database type</em> element is not allowed.
Not seen that one yet
- Status changed to Needs review
11 months ago 4:14pm 6 March 2024 - Assigned to wim leers
- Status changed to Needs work
11 months ago 4:17pm 6 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Ah, this is in the new CI job! Then obviously it is possible π Though I have no idea what could've caused thatβ¦ will investigate.
- Issue was unassigned.
- Status changed to Postponed
11 months ago 3:29pm 7 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Looks like this is no longer working because of a core regression: π Regression: Error installing standard profile with sqlite Active .
- Status changed to Needs review
11 months ago 3:52pm 7 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Okay, switching from
drush site-install
tocore/scripts/drupal install
unblocked this. π (I'd removedrush
altogether, but there's no way to install modules usingcore/scripts/drupal
today, that's being proposed in #3089277: Provide core CLI commands for the most common features of drush β .)That means this is unblocked! π₯³
- πΊπΈUnited States smustgrave
Don't mind marking if you want to remove that one change in core/config/schema/core.data_types.schema.yml
And question but do you want to lock down the version of config_inspector it pulls or fine with grabbing the latest?
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Don't mind marking if you want to remove that one change in core/config/schema/core.data_types.schema.yml
Done.
And question but do you want to lock down the version of config_inspector it pulls or fine with grabbing the latest?
Grabbing latest is best. Let
composer
figure out the appropriate version for whichever core version. Because then we won't have to update the.gitlab-ci.yml
to update to a newer version. - Status changed to RTBC
11 months ago 5:39pm 7 March 2024 - Status changed to Needs work
11 months ago 12:28pm 8 March 2024 - π¬π§United Kingdom longwave UK
I thought that we would need a similar check as per the cspell job where we take one SHA over another in some cases. But as that seems to work here maybe we can simplify that job as well? A task for another issue anyway.
I was also concerned about these steps:
git checkout $CI_MERGE_REQUEST_DIFF_BASE_SHA composer require drush/drush drupal/config_inspector || exit 100 ... git checkout $CI_COMMIT_SHA
The
composer require
modifies the following files:M composer.json M composer.lock M composer/Metapackage/CoreRecommended/composer.json M composer/Metapackage/PinnedDevDependencies/composer.json M core/lib/Drupal/Component/Diff/composer.json
If any of these are different between the branches, the second git checkout may fail due to conflicts, as proven in this job: https://git.drupalcode.org/project/drupal/-/jobs/1023410
As we don't need Composer after installing Drush and Config Inspector maybe it is safe to
git reset --hard
before the secondgit checkout
? Technically composer.json will be out of sync but it doesn't matter for the remainder of the job. - Status changed to RTBC
11 months ago 1:18pm 8 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I was also concerned about these steps:
β¦
As we don't need Composer after installing Drush and Config Inspector maybe it is safe to usegit checkout -f
here?Good suggestion! π Implemented: https://git.drupalcode.org/project/drupal/-/merge_requests/6700/diffs?co... β passed β
Also updated your fork to verify it actually solves that edge case: https://git.drupalcode.org/project/drupal/-/merge_requests/6974/diffs?co... β passed β
- π¬π§United Kingdom longwave UK
Alright, let's give this a shot. Backported to 10.3.x to keep things in sync, I see no need to go back further with this one.
Committed and pushed 566b7d32e3 to 11.x and b27e31dc01 to 10.3.x. Thanks!
-
longwave β
committed b27e31dc on 10.3.x
Issue #3422641 by Wim Leers, longwave, smustgrave, fjgarlin: Add a "...
-
longwave β
committed b27e31dc on 10.3.x
-
longwave β
committed 566b7d32 on 11.x
Issue #3422641 by Wim Leers, longwave, smustgrave, fjgarlin: Add a "...
-
longwave β
committed 566b7d32 on 11.x
- Status changed to Fixed
11 months ago 12:07pm 13 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
YAY!
This allowed me to close π Create test that reports % of config entity types (and config schema types) that is validatable Postponed . And β¦ I updated one of the-in-progress config validation issues, and sure enough, it works great: #3422872-10: Add validation constraints to contact.settings β π Similarly, I checked a very important/huge scope issue ( π Move code from the experimental SDC module to core Fixed ), I see that the job is running there (because it modified a
.module
file), and it's passing. So: it's not disrupting anything shortly after introduction at least. I'll be keeping an eye on this. Feel free to ping me directly if this ever gets in the way.I'm excited about how this will empower π± [meta] Config validation for a more reliable Drupal + reliable Recipes from the start Active to move faster! π
- π¦πΊAustralia acbramley
This seems to be causing issues with MRs that are removing config entities
https://git.drupalcode.org/issue/drupal-3432874/-/jobs/1126875
- Status changed to Needs work
10 months ago 5:04pm 22 March 2024 - π¬π§United Kingdom catch
Re-opening. Could we potentially count the raw number of validatable and unvalidatable config objects and then the test would need to be updated every time, but if we're removing a validatable config object, it would be easy to keep the test passing.
- π¬π§United Kingdom longwave UK
Or, should we just mark the job as allow_failure, so it still runs but doesn't block anything?
- π·π΄Romania claudiu.cristea Arad π·π΄
Not sure I've landed in the right place. I have two different MRs from two different issue. Both are changing or add schemas. And both are failing in this job. I have no idea what I'm doing wrong or what should I fix. I think the failure deserves a good error message in the job's log. Now is so opaque...
My cases:
- πͺπΈSpain rcodina Barcelona
I'm in the same situation of @claudiu.cristea. I have a MR which modifies image field settings to add a property. How can I pass the test if the MR.json will always be different from HEAD.json?
.gitlab-ci.yml
# Compute statistics for coverage of validatable config for MR. - vendor/bin/drush config:inspect --statistics > MR.json # Output diff, but never fail the job. - diff -u HEAD.json MR.json || true
#3325551 β¨ Add "Disable image resize" setting to image fields Needs review > https://git.drupalcode.org/issue/drupal-3325551/-/jobs/1209260
- Status changed to Needs review
10 months ago 10:51pm 1 April 2024 - π¦πΊAustralia acbramley
Re #40 catch agreed we should allow failures until the kinks are ironed out https://drupal.slack.com/archives/C1BMUQ9U6/p1711664511341669?thread_ts=...
Created an MR to allow that.
- Status changed to RTBC
10 months ago 12:30pm 2 April 2024 - πΊπΈUnited States smustgrave
Hopefully helps the MRs
#42 I rebased and the validations least didnβt stop the MR that time.
- π¬π§United Kingdom alexpott πͺπΊπ
Whatever happens next should be in a new issue.
Committed and pushed 722ab9b218 to 11.x and 539e16021f to 10.3.x. Thanks!
Let's do this and open a follow-up to make this fail again and improve the checking so it doesn't trigger false positives.
-
alexpott β
committed 539e1602 on 10.3.x
Issue follow-up by #3422641 by acbramley, catch: Add a "Validatable...
-
alexpott β
committed 539e1602 on 10.3.x
- Status changed to Fixed
10 months ago 2:47pm 2 April 2024 -
alexpott β
committed 722ab9b2 on 11.x
Issue follow-up by #3422641 by acbramley, catch: Add a "Validatable...
-
alexpott β
committed 722ab9b2 on 11.x
- π¦πΊAustralia acbramley
Created π Fix issues with Validatable config job Active
Automatically closed - issue fixed for 2 weeks with no activity.