Problem/Motivation
Facts:
- Drupal 9.4 ships with CKEditor 4 enabled by default in Standard.
- Drupal 9.5 will ship with CKEditor 5 enabled by default in Standard.
Therefore the 9.4 DB fixtures for update path testing should contain CKE4. In principle only the 9.5 fixtures should contain CKE5. This would be fine for the 9 → 10 update path if it would migrate from CKE 4 to 5 automatically. That was the original plan in #3304736: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed, per release manager @xjm.
Except that release manager @catch argued for a different approach to upgrade from CKE4 to CKE5 in #3304736-19: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed:
9.5.x:
Install ckeditor5, update your settings, uninstall ckeditor 4 easily because it's still in core.10.0.x:
Install ckeditor 4 from contrib, update your settings, uninstall ckeditor 4 easily because you already installed it from contrib.10.0.x but didn't read the instructions:
Update to 10.0.x, missing module warning on update.php, abort the update, and do the 9.5.x steps, or install the contrib module and follow the 10.0.x steps.
Phrased differently:
Drupal 10 must require the owner of an existing Drupal 9 site to:
- manually install the CKEditor 5 module (in Drupal 9 or 10)
- manually uninstall the CKEditor 4 module (in Drupal 9 or 10)
- not allow updating a Drupal 9 site with CKEditor 4 still installed to Drupal 10 without also installing the https://www.drupal.org/project/ckeditor contrib module for D10 (necessary for point 1 to still be true)
After careful discussion, this plan was deemed safer & better, and release manager @xjm approved it in #3304736-26: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed.
So how do we then test the D9 → D10 update path, given that no 9.5 DB fixtures will be added? See the proposed resolution.
Steps to reproduce
N/A
Proposed resolution
Update the 9.4 DB fixtures to use CKEditor 5, in Drupal 10.0 and 10.1. This reflects the upgrade path plan by release managers @xjm and @catch that a site will have to stop using CKEditor 4 prior to upgrading to Drupal 10.
Quoting @catch from #3304326-14: Deprecate CKEditor 4 module in 9.5:
If we remove ckeditor from Drupal 10, but don't remove it from the 9.4.0 database dumps, those tests will fail due to the ckeditor module being missing from the filesystem - so we have to remove it from the dumps in 10.0.x
Simultaneously, we're adding ckeditor5 to the standard profile in 9.5.0, but if we want the standard upgrade path tests to run with ckeditor5 installed, we'll need to add it to the database dumps used for tests - currently we only have 9.4.0 database dumps, none for 9.5.0 or 10.0.0 (and might not add those until just before Drupal 11, certainly can't add them before 9.5.0 is released anyway).
More or less we need to replicate what we're expecting real sites to do, which is install ckeditor4 and uninstall ckeditor5.
Remaining tasks
Update DB dumps.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3306545-23.patch | 1.29 MB | spokje |
Comments
Comment #2
wim leersPer #3304736-26: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed, a decision has been made 👍
Comment #3
wim leersBumping to critical given it's blocking criticals (#3304736: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed and #3270438: Remove CKEditor 4 from core).
Comment #4
wim leersI found this issue along with #3304326: Deprecate CKEditor 4 module in 9.5, #3270438: Remove CKEditor 4 from core and #3304736: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed extremely confusing. So … updated issue summary that explains why we're updating the 9.4 DB dumps this way, by synthesizing all discussion in the past ~week into a (hopefully 🤞) cohesive explanation.
Title updated too:
Comment #5
wim leersHTML fix 😬
Comment #8
wim leers@xjm and @catch definitely deserve credit here! 😊
Comment #9
wim leersLet's run only the
Updatetests while figuring this out.Comment #10
wim leersComment #11
wim leersUgh.
phpunitdoes have a--groupargument. But this us actually usingcore/scripts/run-tests.sh…3rd time's a charm?
Comment #12
catch@Wim Leers: just a note because it's painful to find out later. For 9.5.x, it's necessary to generate the database dumps using PHP 7.3 - otherwise serialisation format causes errors. See #3275093: Drupal 9.3.0 dumps were created with PHP 8, needs to be PHP 7.3.
This isn't an issue for dumps to be committed to 10.0.x
Comment #13
wim leers9.4.xis currentlyf20c0a2030cb19bafa2f54d7e5da8c75459410fd.Wow, this is painful! We really really need #3305003: Create standard steps for creating database dumps 🤯
difforgit diffseem to be pointless: the order in which things are dumped is different 🤷♀️serialize()output — it was because I was using PHP 7.4 instead of 7.3 — previously seen in #3275093: Drupal 9.3.0 dumps were created with PHP 8, needs to be PHP 7.3.test_text_formatappears to be designed to test that a text format with all filters enabled still has all filters enabled after applying the update path. It also had CKEditor 4 enabled, but this made no sense, given that thefilter_html_escapefilter was enabled. So, disabled CKEditor 4 for it. This was wrong before, and during the CKE 4 → 5 upgrade that an end user would do as per #3304736: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed, they'd do the same.CKEditor4To5UpgradeTest's test cases to fail because it specifically accounted for the broken fixtures; if I'm right and they do fail, we'll be able to remove 10 lines of code from that file, making it also more maintainable in the long run 👍Now … how does one go about reviewing this? Since this involved manual steps? I do see a lot more changes than I'd like 😬 I don't know how to solve the different ordering of identical data. I can't find docs about it. I also see there's more LoC than before, but I didn't do anything besides the above so … 🤷♀️
Really curious about reviews on this. The above took hours to figure out already 🙃
EDIT: #12: too late 😅
Comment #14
wim leersWe really need #3213633: Improve DX of maintaining migration database fixtures: provide an option for creating per-table database fixtures in DbDumpcommand for our own sanity 😬
Comment #16
wim leersUpdate
UpdatePathTestBaseFilledTestexpectation.Hoping that this will address the otherwise inexplicable
Undefined variable $theme_listerrors 😬Comment #18
spokje@Wim Leers
If you can explain what you did to accomplish this:
So import what from where, I could have a stab at updating the dumps.
I've lost that long ago, actually whilst doing fixture updates, so there's no risk involved for me :)
Comment #19
wim leers#18:
Re-import these:
🤣
Comment #20
wim leersDown to 4 failures in #16! 🚀
But …
Undefined variable $theme_listall over the place. Let's investigate! It comes from the last line in this chunk of code:… that actually looks like a genuine bug. How is it possible that this has never been surfaced?! 🤯
Comment #21
spokjeHow is it possible that this has never been surfaced?!Looking at your previous comments I'm assuming the update of the fixtures wasn't done correctly, leaving the test with an "undefined" DB to work from and the most "fun" failures are returned from TestBot. I wouldn't spend to much time investigating that (Been there, done that, threw away the T-Shirt.)
I'm assuming I should be on
9.4.4to have the correct config?Comment #22
wim leersYes,
9.4.4. Or9.4.x— it doesn't matter (git diff 9.4.4 origin/9.4.x -- core/profiles/standard/config/installis empty).P.S.: I'd really love to know what I did wrong 😬
Comment #23
spokjeLet's give this a whirl
Comment #24
spokjeWhat's green enough for TestBot, is good enough for me.
I see several options:
1) Approaching this task too sane
2) Using PHP 7.3 while the
10.0.xand10.1.xfixtures are dumped in PHP 8.13) "Something weird", since the ordering of dumped things shouldn't change (much).
4) No ritual offering to Cthulhu.
My money is on #4, but it might be all of the above.
Comment #25
wim leersI definitely violated 4) and 2), I probably violated 1), and possibly 3). Clearly a case of PEBKACAC (classical PEBKAC with the addition of ).
I manually
gunzipped anddiffed thedrupal-9.4.0.bare.standard.php.gzanddrupal-9.4.0.filled.standard.php.gzbefore and after. The same observations I had about my own patch in #13 applies:I see the exact same number of lines before vs after, the same ordering differences. The only difference appears to be that @Spokje did it with PHP 8.1 instead of PHP 7.3. 👍
Comment #27
catchCommitted/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!