Problem/Motivation
Per discussion in #2942096: [policy, no patch] Remove old update hooks prior to each major version (Drupal 10 and later), we should remove all hook_update_N() and hook_post_update_NAME() up until 9.3.0 (i.e., any updates added since 9.3.0 should remain in core).
This will break test coverage, so we'll need to remove tests for specific updates and update the generic update path tests and database dumps to start on a 9.3.0 database (this could be the existing dump(s), updated, then dumped again).
Steps to reproduce
Proposed resolution
1. Remove all updates and post updates added to core prior to 9.3.0, anything since 9.3.0 stays in.
2. Implement hook_removed_post_updates() and hook_update_last_removed().
3. Update the bare and standard database dumps to 9.3.0 (by loading them on a 9.3.0 site then dumping them again)
4. Remove the 9.0.0 database dump since we don't have two 'base' versions to update from.
6. Removes test coverage and fixtures for all the specific update tests + fixtures (but not any helpers, those can be removed in deprecation removal patches)
Remaining tasks
#3261629: Database dumps are no longer driver-agnostic needs to land first.
User interface changes
API changes
Data model changes
Release notes snippet
Data updates added prior to 9.3.0 have been removed from Drupal 10.0.x. To update to Drupal 10, you must first ensure your site is running Drupal 9.3.0 or a later release. We recommend updating to the most recent core 9.x release, as well as updating all of your contributed modules to their latest releases, prior to updating to Drupal 10.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 3261486-32.9_4_x.patch | 729.21 KB | dww |
Issue fork drupal-3261486
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
andypostit will affect removal of views helpers in #3261245: Remove deprecated views module functions
Comment #4
catchI've done the removals for system module. That should cause all the legacy/one-off tests to fail, which we can then remove. Still need to remove old updates for all the other core modules too.
Comment #5
andypostLooking at related in #2 I bet we need to clean-up post updates as well
Comment #6
catchYeah we have to do hook_update_N() and hook_post_update_NAME() at the same time - I've done both for system to start.
Comment #7
spokjeSo the first testrun, starting at 12:45 CET (https://dispatcher.drupalci.org/job/drupal_patches/111933/) is _still_ on the PHPStan check. In fact, all testruns are busy PHPStanning.
Unsure what's going on there, but that seems a tad on the long side...
Comment #8
catchYep that's it. #3261539: Don't scan gzips.
Comment #9
catch#3261629: Database dumps are no longer driver-agnostic
Comment #10
catchOK finally, should be ready for review now.
Apart from #3261629: Database dumps are no longer driver-agnostic there's nothing actually tricky in the patch, it's just figuring out exactly which updates are OK to remove or not.
Comment #11
longwaveThere are a couple of omissions that I can see. The remaining post updates are:
However
workspaces_post_update_remove_association_schema_data()was added way back in #3098427: Manipulating the revision metadata keys before running the BC layer breaks the BC layer so it is time for it to be removed.Also, the remaining update hooks are:
migrate_drupal_update_8901()should be removed here.Otherwise the updated tests including database dumps look OK to me.
Comment #12
catchThese were all added post 9.3.0 - I already tried to remove them had to put them back ;)
workspaces_post_update_remove_association_schema_data()This one can go! Removed.
migrate_drupal_update_8901()Also removed.
Comment #13
longwaveSorry that's what I meant in #11 - I was listing all the remaining updates and only meant that the two I highlighted should be removed.
Comment #14
dwwI just did a very close review on the (giant) MR diff. The only thing I spotted was where this is going to conflict with #3261629: Database dumps are no longer driver-agnostic and need a quick reroll once that lands. Otherwise, this looks great and is IMHO RTBC. I'm not sure if I should move this to Postponed (since that's accurate) or leave it "Needs review" (since more eyes are always good). However, since both @longwave and I have done a thorough on this, probably best to spend available review efforts elsewhere. So I'm going for postponed for now. It'll have a brief period of needs work for the trivial reroll, then it should be RTBC.
Thanks!
-Derek
Comment #15
catch#3261629: Database dumps are no longer driver-agnostic is in.
Rebased the MR.
Comment #16
longwaveI've reread the entire patch and confirmed that:
- all hook_update_N() are correctly removed and hook_update_last_removed() updated to match.
- all post_update hooks are correctly removed and hook_removed_post_updates() updated to match.
- all relevant tests have been removed along with their fixtures.
One thing I did spot is that migrate_drupal_multilingual is hidden and deprecated, but isn't flagged in info.yml with the new method of deprecating modules; if we don't have an issue to fix this and remove in 10.0.x we should add one.
edit: could not find an issue, so opened #3261957: Properly deprecate migrate_drupal_multilingual for future removal
Comment #17
catchWe've got #2966859: Remove Migrate Drupal Multilingual module in Drupal 10, opened #3261961: Mark migrate_drupal_multilingual obsolete too.
Comment #18
dwwReroll looks good. Agreed, RTBC++.
Thanks!
-Derek
Comment #19
alexpottCommitted 4263042 and pushed to 10.0.x. Thanks!
Comment #21
jeroentDoes it make sense to add
drupal-9.3.0.bare.standard.php.gzanddrupal-9.3.0.filled.standard.php.gzto Drupal 9.3 and 9.4?contrib modules with update tests that try to add Drupal 10 support can reference those files, instead of adding a check if the current Drupal version is Drupal 10, use
drupal-9.3.0.bare.standard.php.gz. Else, usedrupal-9.0.0.bare.standard.php.gzComment #22
alexpott@JeroenT that does make sense - do you want to file an issue to do that?
Comment #23
jeroentCreated #3263886: Copy drupal-9.3.0.bare.standard.php.gz and drupal-9.3.0.filled.standard.php.gz from the Drupal 10 branch
Comment #24
tr commentedNo change notice for removing the fixtures?
My contributed module uses drupal-8.8.0.bare.standard.php.gz to test hook_update_N() for updates from D8 to D9. These tests have been running green on a weekly basis for 18 months now. But these tests started failing when this issue was committed. That's the only notice I got of the change - there is no change record.
What is the recommended course of action for contributed modules? Should we no longer test for the D8->D9 upgrade? Or, do we now need a separate branch for D10 support, because test code in the current branch won't work anymore in both D9 and D10?
This is the purpose of a change notice - if you remove something from core, there should be a change notice as well as an explanation about what contrib should do to deal with the change.
Comment #25
catchI've added a change record: https://www.drupal.org/node/3264237 and a release notes snippet.
There are 9.3.0 database dumps that can be used to test contributed module updates against Drupal 10. The test could check which fixture is available before including one of them.
If you have specific testing for the 8-9 upgrade path, i.e. your contrib module interacting with core updates or similar, then since Drupal 8.9 is months out of support now, I don't think these need explicit testing any more.
Comment #26
catchMoving this back to fixed.
Comment #27
alexpott@catch thanks for https://www.drupal.org/node/3264237. I think #25 answers @tr's question about updating from D8 to D9 - ie. Drupal 8 is not supported anymore so you should not expect Drupal 8 upgrade tests to work on Drupal 10. If you want to keep the Drupal 8 to 9 test running and have a module that claim D10 compatibility then you could test for the existence of the Drupal 8 db dump in the ::setUp method and mark the test skipped if it is not there... you could probably this in the \Drupal\FunctionalTests\Update\UpdatePathTestBase::setDatabaseDumpFiles() too - as that might be even simpler. Depends how you've organised your test.
Comment #28
xjmComment #29
xjmComment #30
tr commentedFor reference, I fixed this with conditional code in
setDatabaseDumpFiles(), which is the same thing I had done for this module in the D8.8->D9 transition when the old (pre-D8.8) fixtures were removed from core.For me, this is not a matter of supporting D8, it's a matter of allowing / enabling people to use D9. That transition is still going to be happening for years so I want to keep my tests that validate the upgrade process.
Comment #31
dwwLeaving aside the 8.8.x fixture, I just realized that the
drupal-9.0.0.bare.standard.php.gzfixture, also removed here, lived in core for a total of 7 days. The full git history on it is just:Removing this fixture makes life more difficult for bug fixes like #85494-386: Use email verification when changing user email addresses. Sadly, there's no single fixture that the upgrade path tests can use on both 9.4.x and 10.0.x branches. 😢 It means we'll need a separate branch and MR for that issue (and probably many others), or to rely on the hack of handling 9.4.x via the MR and posting patches to the issue for 10.0.x. If #3194562: Add database dumps for 9.0.0 was worth doing (which is great), we should leave that in core longer than a week. More like a couple of years. 😉
Should we revert and reopen this issue?
Should I open a new issue about restoring
drupal-9.0.0.bare.standard.php.gz?Thanks/sorry, -Derek
Comment #32
dwwHah! In Slack, @xjm pointed out I had pandemic timewarp brain and those 2 dates are 1 year 1 week apart. 😆 Tee hee...
Still, it's a pain there's no fixture in both 9.4.x and 10.0.x branches we can use right now. So here's a "backport" that only adds that fixture. I don't know if that's okay, or if we also need to backport some upgrade test changes to use it, too?
Although @xjm suggested I reopen this issue for the backport, I'm worried that "Remove core updates added prior to 9.3.0 and adjust test coverage" will be a terribly confusing git commit message for this. Should I move this patch to a new child issue so the history on it can be clear and accurate? Or will committers manually update the commit message?
Comment #33
xjmComment #34
catchThere's already an issue open to add the 9.3.0 database dumps to the 9.4.x, moving this one back to fixed. #3263886: Copy drupal-9.3.0.bare.standard.php.gz and drupal-9.3.0.filled.standard.php.gz from the Drupal 10 branch.